Fix Telegram tool progress and project context UX #1598

Closed
opened 2026-10-27 13:41:02 +00:00 by sam · 4 comments
Owner

Investigate and fix Telegram tool-call rendering so progress is compact, cleaned, bounded, and failure-aware without raw schema placeholders; ensure chat/task tool context roots at the actual configured project/worktree; add regression tests for rendering, truncation/offload, context root, and failures; run gates and deploy runtime changes.

Acceptance criteria

Telegram progress is readable and Telegram-safe; oversized tool output is bounded or offloaded; task tools use the task worktree rather than unrelated home paths; malformed shell/input failures remain visible; targeted and full checks pass.

Notes

GitHub #604 reopened after PR #605. Building integration regression at the chat-stream → Telegram Bot API seam; tool-output budget is character/result-volume only, never token based.
PR #608 (5d45633) on fix/604-telegram-tool-output-pipeline. Waiting on live Telegram verification after deploy; do not close until Sam confirms.

Close reason

Operator confirmed live Telegram verification (2026-10-03), which is the condition the bead's own NOTE reserved closure for. Code verified shipped at 11974196 before that: compact/cleaned/failure-aware tool rendering with no raw schema placeholders (internal/domain/messaging/tool_render.go RenderToolCall/FailureKey, consumed at internal/channels/telegram/live.go:340-348); bounded and offloaded output (live.go liveToolMaxRunes/toolBlock/clampToRunes; internal/tools/budget.go CapPayload); context rooted at the configured project/worktree (config chat.workspace -> app/archied/bootstrap.go:1419-1421 -> tools/provider/builtin, with the task side on workspaceToolset); turn caps removed. Landed as cc53e525 (PR #608's content; the unmerged branch tip 5d45633 is NOT an ancestor of main) plus 72bc95cc, d783bebf, 5539f2b3, 3b266c71, 5fa43b7e, all in tag archied/v1.46.0. Tests: TestLiveReplyRendersNoisyToolTurnAsCompactTelegramText, TestLiveReplyCollapsesRepeatedSuccessfulEquivalentToolCalls, TestRemovedTurnCapsAreIgnoredByLegacyConfig.


Imported from beads archie-core-tzzn · GitHub #728 · type bug · priority P1 · created 2026-08-23 · closed 2026-10-02

Investigate and fix Telegram tool-call rendering so progress is compact, cleaned, bounded, and failure-aware without raw schema placeholders; ensure chat/task tool context roots at the actual configured project/worktree; add regression tests for rendering, truncation/offload, context root, and failures; run gates and deploy runtime changes. ### Acceptance criteria Telegram progress is readable and Telegram-safe; oversized tool output is bounded or offloaded; task tools use the task worktree rather than unrelated home paths; malformed shell/input failures remain visible; targeted and full checks pass. ### Notes GitHub #604 reopened after PR #605. Building integration regression at the chat-stream → Telegram Bot API seam; tool-output budget is character/result-volume only, never token based. PR #608 (5d45633) on fix/604-telegram-tool-output-pipeline. Waiting on live Telegram verification after deploy; do not close until Sam confirms. ### Close reason Operator confirmed live Telegram verification (2026-10-03), which is the condition the bead's own NOTE reserved closure for. Code verified shipped at 11974196 before that: compact/cleaned/failure-aware tool rendering with no raw schema placeholders (internal/domain/messaging/tool_render.go RenderToolCall/FailureKey, consumed at internal/channels/telegram/live.go:340-348); bounded and offloaded output (live.go liveToolMaxRunes/toolBlock/clampToRunes; internal/tools/budget.go CapPayload); context rooted at the configured project/worktree (config chat.workspace -> app/archied/bootstrap.go:1419-1421 -> tools/provider/builtin, with the task side on workspaceToolset); turn caps removed. Landed as cc53e525 (PR #608's content; the unmerged branch tip 5d45633 is NOT an ancestor of main) plus 72bc95cc, d783bebf, 5539f2b3, 3b266c71, 5fa43b7e, all in tag archied/v1.46.0. Tests: TestLiveReplyRendersNoisyToolTurnAsCompactTelegramText, TestLiveReplyCollapsesRepeatedSuccessfulEquivalentToolCalls, TestRemovedTurnCapsAreIgnoredByLegacyConfig. --- _Imported from beads `archie-core-tzzn` · GitHub #728 · type bug · priority P1 · created 2026-08-23 · closed 2026-10-02_
sam added the highbug labels 2026-10-27 13:41:02 +00:00
sam self-assigned this 2026-10-27 13:41:02 +00:00
sam closed this issue 2026-10-27 13:41:02 +00:00
Author
Owner

sam wrote (originally 2026-08-23):

Reopened after live deployment evidence: full source files and module-cache results are still exposed, output is quoted/escaped, repeated turn-budget failures continue, searches wander outside the active project, and failed shell probes remain noisy. The bounded wrapper alone did not meet acceptance criteria.

_sam wrote (originally 2026-08-23):_ Reopened after live deployment evidence: full source files and module-cache results are still exposed, output is quoted/escaped, repeated turn-budget failures continue, searches wander outside the active project, and failed shell probes remain noisy. The bounded wrapper alone did not meet acceptance criteria.
Author
Owner

sam wrote (originally 2026-08-23):

Architecture correction from Sam: turn continuation must never be token-count based. The observed 200000-char failure is the aggregate tool-result character/output-volume cap. Fix via spill/offload/summarization and suppression of repeated oversized results; do not add token-based stopping.

_sam wrote (originally 2026-08-23):_ Architecture correction from Sam: turn continuation must never be token-count based. The observed 200000-char failure is the aggregate tool-result character/output-volume cap. Fix via spill/offload/summarization and suppression of repeated oversized results; do not add token-based stopping.
Author
Owner

sam wrote (originally 2026-08-23):

PR #608 opened at 5d45633. Telegram integration regression + turn-cap removal + workspace-only discovery. task check passed. Not deployed; live Telegram confirmation still needed.

_sam wrote (originally 2026-08-23):_ PR #608 opened at 5d45633. Telegram integration regression + turn-cap removal + workspace-only discovery. task check passed. Not deployed; live Telegram confirmation still needed.
Author
Owner

sam wrote (originally 2026-10-02):

Triage 2026-10-02 @ 11974196: CODE SHIPPED, awaiting operator sign-off. Live: compact/cleaned/failure-aware rendering with no raw schema placeholders (domain/messaging/tool_render.go:20,35,241; consumer channels/telegram/live.go:340-348); bounded/offloaded output (live.go:49,713,757; tools/budget.go:48 CapPayload); context root at the configured project/worktree (config.chat.workspace -> app/archied/bootstrap.go:1419-1421 -> tools/provider/builtin), with the task side on workspaceToolset. Landed as cc53e525 (PR #608's content; the unmerged branch tip 5d45633 is NOT an ancestor of main), plus 72bc95cc, d783bebf, 5539f2b3, 3b266c71, 5fa43b7e, all in tag archied/v1.46.0. Tests: TestLiveReplyRendersNoisyToolTurnAsCompactTelegramText, TestLiveReplyCollapsesRepeatedSuccessfulEquivalentToolCalls, TestRemovedTurnCapsAreIgnoredByLegacyConfig. No code remains. The bead NOTE reserves closure for live Telegram verification after deploy, which is not derivable from the tree.

_sam wrote (originally 2026-10-02):_ Triage 2026-10-02 @ 11974196: CODE SHIPPED, awaiting operator sign-off. Live: compact/cleaned/failure-aware rendering with no raw schema placeholders (domain/messaging/tool_render.go:20,35,241; consumer channels/telegram/live.go:340-348); bounded/offloaded output (live.go:49,713,757; tools/budget.go:48 CapPayload); context root at the configured project/worktree (config.chat.workspace -> app/archied/bootstrap.go:1419-1421 -> tools/provider/builtin), with the task side on workspaceToolset. Landed as cc53e525 (PR #608's content; the unmerged branch tip 5d45633 is NOT an ancestor of main), plus 72bc95cc, d783bebf, 5539f2b3, 3b266c71, 5fa43b7e, all in tag archied/v1.46.0. Tests: TestLiveReplyRendersNoisyToolTurnAsCompactTelegramText, TestLiveReplyCollapsesRepeatedSuccessfulEquivalentToolCalls, TestRemovedTurnCapsAreIgnoredByLegacyConfig. No code remains. The bead NOTE reserves closure for live Telegram verification after deploy, which is not derivable from the tree.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1598