Remove unused items tracking from Claude adapter state - #13718
Conversation
The Claude adapter copied each turn's SDK user and assistant messages into context.turns and kept them until the session stopped. Nothing reads them: rollback works from Claude's on-disk history and turnStartMessageIds, and no production caller uses readThread's items. Keep only turn ids. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vkxwfu3bhLfZE4x2Fx8hra
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: pingdotgg/t3code/.coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughClaudeAdapter no longer retains SDK message objects in active or completed turn state. Completed turns retain their IDs, and ChangesClaude turn state
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Refactor Merge Risk: ⚪ Minimal · up to The change reduces retained message data without an identified break in thread reads or rollback. No actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vkxwfu3bhLfZE4x2Fx8hra
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This focused refactor removes unused Claude SDK message retention, reducing memory use while preserving turn IDs and rollback behavior. The added test verifies that completed-turn snapshots retain IDs with empty item lists. You can add or adjust custom eligibility rules. Learn more. |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vkxwfu3bhLfZE4x2Fx8hra
Dismissing prior approval to re-evaluate c290b0e
## What's Changed * feat(desktop): honor the standard OTLP variables in the main process and WSL backends by @yordis in pingdotgg/t3code#13641 * fix(web): restore compact provider instance badges by @t3-code[bot] in pingdotgg/t3code#13700 * perf(mobile): lighter Home rows away from the viewport by @AKolenda in pingdotgg/t3code#13702 * fix(usage): price Cursor cache savings by base model by @Yash-Singh1 in pingdotgg/t3code#13731 * perf(mobile): render Home rows further ahead while scrolling by @AKolenda in pingdotgg/t3code#13705 * refactor(observability): name each service after its application by @yordis in pingdotgg/t3code#13699 * perf(server): stop remapping every thread on each thread event by @t3dotgg in pingdotgg/t3code#13720 * Remove unused items tracking from Claude adapter state by @t3dotgg in pingdotgg/t3code#13718 * feat(observability): name the command on subprocess spans by @t3dotgg in pingdotgg/t3code#13701 * fix(cli): t3 triage points agents at log files that exist by @t3dotgg in pingdotgg/t3code#13685 * fix(server): the SQLite WAL file shrinks back after large writes by @t3dotgg in pingdotgg/t3code#13684 * feat(cli): summarize the server trace file from the command line by @t3dotgg in pingdotgg/t3code#13698 * perf(server): pull request sync reads only threads with linked pull requests by @t3dotgg in pingdotgg/t3code#13704 ## New Contributors * @AKolenda made their first contribution in pingdotgg/t3code#13702 **Full Changelog**: pingdotgg/t3code@v0.0.43-nightly.20260925.2269...v0.0.43-nightly.20260926.2282 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.43-nightly.20260926.2282
What Changed
Removed the
itemsarray fromClaudeTurnStateandClaudeSessionContext.turnsentries, along with all code that populated and copied this data structure. Theitemsarray was being tracked but never read or used anywhere in the codebase.Why
This change eliminates unnecessary memory overhead in long-lived sessions. The
itemsarray was accumulating messages throughout a session's lifetime but served no functional purpose. By removing it:The rollback mechanism relies on Claude's own history (via the SDK), not on locally stored messages, so this data was redundant.
Checklist
https://claude.ai/code/session_01Vkxwfu3bhLfZE4x2Fx8hra
Summary by CodeRabbit