Repository navigation
Description
Timeout continuation ("I'm still working on this in the background…") has two footer/diagnostics gaps:
1. Pause notice posts with no footer
When a turn times out and the continuation notice is posted, it goes out as raw text with no Slack footer. Neither reply-executor.ts nor slack-resume.ts attaches blocks or a footer to the pause message, so there is no conversation ID / Sentry trace link.
reply-executor.tsposts viathread.post(buildSlackOutputMessage(buildTurnContinuationResponse()))— no footerslack-resume.tsposts viapostSlackApiMessage({ text: buildTurnContinuationResponse() })— even more raw
At minimum, the pause notice should include a conversation ID footer with the Sentry trace link so the turn is traceable.
2. Resumed turn footer only reflects the final slice
When the resumed slice completes, slack-resume.ts builds the footer from only that slice's reply.diagnostics:
const footer = buildSlackReplyFooter({
durationMs: reply.diagnostics.durationMs,
usage: reply.diagnostics.usage,
...
});Duration and token counts are per-invocation — prior slices' usage is lost. The checkpoint (AgentTurnSessionCheckpoint) does not store cumulative usage or duration, so there is nothing to aggregate against.
Fix direction
- Pause notice: post with
buildSlackReplyBlocks(text, footer)where footer includes at least the conversation ID. Consolidate the two posting paths into one shared helper. - Cumulative diagnostics: extend checkpoint with
cumulativeUsage?: AgentTurnUsageandcumulativeDurationMs?: number. Accumulate at each checkpoint boundary. Build the final reply footer from cumulative totals, not just the last slice. - Old checkpoints without cumulative fields should degrade gracefully (show partial data, not break).
Key files
packages/junior/src/chat/services/turn-continuation-response.tspackages/junior/src/chat/runtime/reply-executor.ts(§postTurnContinuationNotice)packages/junior/src/chat/runtime/slack-resume.ts(§postTurnContinuationNoticeBestEffort, footer construction)packages/junior/src/chat/slack/footer.tspackages/junior/src/chat/services/turn-checkpoint.ts
Raised by David Cramer.
Action taken on behalf of David Cramer.
Activity
dcramer commentedon May 23, 2026
more work to do here but its a start