Skip to content

perf(agent-runtime): skip thinking token progress persistence - #465

Draft
jerryliang64 wants to merge 1 commit into
masterfrom
codex/filter-thinking-token-persistence
Draft

perf(agent-runtime): skip thinking token progress persistence#465
jerryliang64 wants to merge 1 commit into
masterfrom
codex/filter-thinking-token-persistence

Conversation

@jerryliang64

Copy link
Copy Markdown
Contributor

Summary

  • exclude system/thinking_tokens progress counters from thread message persistence
  • keep those events available through /runs/stream and run-event replay
  • preserve the final assistant message, including its complete thinking content
  • cover the behavior at both MessageConverter and AgentRuntime integration levels

Root cause

After a run commits, the incremental message flusher attempts to mirror every executor message into the thread store. thinking_tokens is emitted frequently as a progress counter, so persisting it creates one awaited remote append per update on OSS/FUSE-backed stores and backpressures consumption of subsequent model events.

The counter is transient metadata rather than conversation history. Filtering it at the existing storage boundary removes that write amplification without changing the streaming protocol or final transcript.

Validation

  • core/agent-runtime: ut run test (210 passing)
  • core/agent-runtime: ut run tsc
  • core/agent-runtime: ut run tsc:pub
  • repository lint: ut run lint
  • independent correctness/security review: LGTM

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 91c934d6-a2e7-4e4f-8458-d9c96832f712

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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