fix: avoid stale dashboard child context budgets#97332
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 28, 2026, 12:23 AM ET / 04:23 UTC. Summary PR surface: Source +1802, Tests +2446, Docs -78, Generated +26, Other +167. Total +4363 across 74 files. Reproducibility: yes. at source level: current main copies Review metrics: 3 noteworthy metrics.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Land a narrowed PR containing only the session inheritance fix and focused regression test, or explicitly split and approve the additional plugin/catalog/protocol/media/schema work with its own proof. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main copies Is this the best way to solve the issue? No, not as submitted. Removing cached context-budget inheritance at the gateway session creation boundary is the right narrow fix, but bundling unrelated plugin catalog, schema, protocol, media, docs, and QA changes is not the best merge shape. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 07b934901a32. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +1802, Tests +2446, Docs -78, Generated +26, Other +167. Total +4363 across 74 files. View PR surface stats
Security concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Merged via squash.
|
* fix(gateway): avoid stale child session context tokens * fix(gateway): avoid stale child session context tokens --------- Co-authored-by: Galin Iliev <[email protected]>
* fix(gateway): avoid stale child session context tokens * fix(gateway): avoid stale child session context tokens --------- Co-authored-by: Galin Iliev <[email protected]>
* fix(gateway): avoid stale child session context tokens * fix(gateway): avoid stale child session context tokens --------- Co-authored-by: Galin Iliev <[email protected]>
* fix(gateway): avoid stale child session context tokens * fix(gateway): avoid stale child session context tokens --------- Co-authored-by: Galin Iliev <[email protected]>
Closes #97331
What Problem This Solves
Fixes an issue where users opening a new Control UI dashboard chat could see and use a stale inherited context budget when the parent dashboard session had cached context metadata from an older model/config state.
Why This Change Was Made
Dashboard child sessions still inherit the parent runtime selection that represents user intent, including provider/model/auth profile and run settings. They no longer inherit cached context or usage metadata, so the new session can derive the current budget from the active model/config/catalog.
User Impact
New Control UI dashboard chats no longer get pinned to a stale smaller context window from their parent session. For the observed
github-copilot/claude-opus-4.8case, a child session can derive the current 1M budget instead of carrying forward the parent's cached 128k budget.Evidence
Before evidence:
Sanitized BUG-folder log excerpt:
Redaction note: exact agent names, session keys, session IDs, local state paths, and local backup filenames are redacted. Provider/model names, timestamps, field names, context values, and line numbers are retained because they are behavior-relevant.
After-fix local proof:
Real behavior proof
Behavior addressed: Newly created dashboard child sessions no longer inherit stale parent
contextTokens,inputTokens,outputTokens,totalTokens,totalTokensFresh, orcontextBudgetStatusmetadata while still inheriting runtime model selection.Real environment tested: Local source checkout worktree on
upstream/mainat36722014ef, branchbug-050-dashboard-contexttokens, Nodev26.3.0, pnpm11.2.2aftercorepack pnpm install.Exact steps or command run after this patch:
node scripts/run-vitest.mjs src/gateway/server.sessions.create.test.ts --reporter=verbose;git diff --check;.agents/skills/autoreview/scripts/autoreview --mode local.Evidence after fix:
Observed result after fix: The regression test creates a parent entry with stale context and usage metadata, then verifies the child session keeps the intended runtime provider/model/auth settings while all stale context/usage metadata fields are absent so current model metadata can be resolved normally.
What was not tested: I did not rerun a live Control UI browser session against the private affected dashboard chain after the code patch; the reproducible seam is covered at
sessions.create, which is where the stale metadata was copied.