Skip to content

Provider retry status, session context persistence, and structured usage tracking#154

Merged
wangtsiao merged 26 commits into
mainfrom
dev/bug_fix_0630
Jul 8, 2026
Merged

Provider retry status, session context persistence, and structured usage tracking#154
wangtsiao merged 26 commits into
mainfrom
dev/bug_fix_0630

Conversation

@wangtsiao

Copy link
Copy Markdown
Contributor

Summary

Three feature areas plus supporting fixes, split across 25 commits for clean bisection.

Provider retry status

  • Protocol event TurnProviderRetryStatus emitted during exponential backoff between retries
  • Provider stream errors (InvalidContentType, network errors) classified as retryable
  • CancellationToken-based tool execution cancellation with INTERRUPTED_TOOL_RESULT_MESSAGE
  • TUI, CLI JSONL, and Desktop (ACP client + chat UI) display retry status inline
  • Interrupted-turn notice relocated to correct prompt position with improved guidance

Session context persistence

  • New SessionContextUpdated rollout line records locked session context once per durable file
  • append_turn_deduped writes context separately; recorded_session_context survives rollback
  • Server lifecycle (agents, goals, research, message edits, interrupts) routes through deduped path

Structured latest-query usage

  • SessionMetadata.last_query_usage: Option<TurnUsage> provides structured latest-query tokens
  • Replay state tracks latest_query_usage separately from cumulative session totals
  • TUI resume/session-switch prefers structured usage over legacy scalar
  • Server turn lifecycle (inline, subagent, finalize) populates the field

Misc

  • Skip context diff when turn metadata is unchanged
  • Desktop ACP compaction handler extracts session id from nested session objects
  • TUI blocks user input during session resume with status indicator

wangtsiao added 26 commits July 8, 2026 22:56
@wangtsiao wangtsiao merged commit d47b33d into main Jul 8, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant