Telegram agent leaks tool-call JSON after step limit #64

Closed
opened 2026-07-05 20:10:13 +00:00 by MrSphay · 1 comment
Owner

Problem

When a local LLM requests another tool after TELEGRAM_AGENT_MAX_STEPS is exhausted, the terminal agent returns the raw protocol object to Telegram instead of a user-facing answer.

Observed response begins with {type:tool_call,...} after successful evidence/scenario/brief tools.

Acceptance criteria

  • Tool protocol JSON is never sent as the final chat answer.
  • Exhausted agents use a final-only synthesis prompt with existing tool results.
  • Repeated protocol violations fail closed with a clear user-facing message.
  • Regression tests cover both successful finalization and repeated tool calls.
## Problem When a local LLM requests another tool after TELEGRAM_AGENT_MAX_STEPS is exhausted, the terminal agent returns the raw protocol object to Telegram instead of a user-facing answer. Observed response begins with {type:tool_call,...} after successful evidence/scenario/brief tools. ## Acceptance criteria - Tool protocol JSON is never sent as the final chat answer. - Exhausted agents use a final-only synthesis prompt with existing tool results. - Repeated protocol violations fail closed with a clear user-facing message. - Regression tests cover both successful finalization and repeated tool calls.
Author
Owner

Actively handled now on branch codex/issue-64-agent-finalization.

Actively handled now on branch `codex/issue-64-agent-finalization`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Code-Inc/intelligence-terminal#64