Repository navigation
perf(client): avoid temporary arrays in inbox snapshots - #27467
UtkarshUsername wants to merge 1 commit into
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Inbox snapshots now populate their Map directly, avoiding temporary arrays while retaining independent snapshot values. The change leaves product behavior and defaults unchanged and presents no obvious material risk. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Build observed snapshot packages/client-runtime/src/state/threadInbox.ts |
observedWorking is populated by iterating over states and storing each state’s working value by key. |
Priority:
Estimated code review effort: 1 (Trivial) | ~3 minutes
Change: Refactor
Possibly related PRs
- pingdotgg/t3code#22458: Introduces the tracker’s per-thread state and Working-placement grace behavior.
- pingdotgg/t3code#24760: Establishes the tracker state and snapshot-stable
observeresult. - pingdotgg/t3code#27460: Also changes allocation behavior in
createInboxReturnTracker.observe.
Suggested reviewers: t3dotgg, macroscopeapp
Merge Risk: 
Minimal · up to 90e36
-
No merge-blocking behavior change was found in this focused allocation optimization.
Pre-merge checks: 
4
-
Full details: Description check
-
Explanation
The description includes all required sections: Problem, Change, Scope and approval, and Verification. It explains the focused fix, reports measured allocation results, documents test and typecheck results, and identifies known pre-existing errors and limitations.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
Problem
Every sidebar inbox observation converts tracker state into two temporary arrays of entries just to copy working-state flags into a snapshot Map.
Change
Populate the snapshot Map directly. Observations still own a separate snapshot, so later tracker updates cannot change earlier answers.
Scope and approval
Small, focused removal of redundant intermediate allocations under CONTRIBUTING.md's focused-fix exception. No new cache, contract, setting, or intentional product behavior change.
Verification
Sampled allocation bytes per complete inbox observation:
Model: gpt-6.1-sol. Harness: Codex in T3 Code.