Repository navigation
fix: show the selected global chat's context breakdown - #188731
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR preserves the selected stored session key in Context report requests and cache entries. Example: Select raw global for agent main while agent:main:global also exists without a saved report.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR fixes a current wrong-session read with a focused change; no actionable defects were found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Control UI’s shared Context report owner receives the selected session identity, requests its saved report through sessions.usage, and supplies the composer popover and Context panel. flowchart LR
A[Selected conversation] --> B[Shared Context report owner]
B --> C[Session usage adapter]
C --> D[Gateway stored row selection]
D --> E[Saved context report]
E --> B
B --> F[Popover and Context panel]
Technical reviewBest possible solution: Preserve the selected stored key and explicit agent in the existing shared report owner while retaining its matching and lifecycle guards. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the wrong-key conversion, and the supplied native browser baseline demonstrates its visible result; this read-only review did not execute a reproduction. Is this the best way to solve the issue? This is the smallest complete correction: both request targeting and cache identity use the existing stored-key-plus-agent contract without changing unrelated artifact semantics. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5d6e5aa36376. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +1, Tests +52, Other +2. Total +55 across 3 files. Added test files: 0. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed October 30, 2026, 7:14 PM ET / 23:14 UTC (Revision 3). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
60e0667 to
997a1ce
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Fixed: Context breakdown now displays the selected raw-global conversation’s own saved report. |
Use each selected conversation's stored identity when requesting and caching its saved Context breakdown, preserving distinct raw and literal sessions. Fixes openclaw#188676.
What Problem This Solves
Fixes #188676.
Opening the Context breakdown for a raw
globalchat can request the separate stored rowagent:main:global. When that literal row has no report, the selected chat shows no breakdown even though its own matching report is available. The real browser reproduction selected the raw session, sent the literal key, and displayed no categories.User Impact
The popover and Context panel use the selected conversation's saved report. A conversation without its own matching report keeps its existing unavailable state. Read permissions, cancellation, and session/model/provider matching continue to determine whether a result can be displayed.
This is the selection correction following the separately merged admission fix in #188670. It adds no configuration, migration, or Gateway interface.
Why This Change Was Made
The report owner used an artifact-wire projection for both its cache identity and the usage request. That projection can collapse raw and literal stored addresses.
sessions.usagealready accepts the stored key and agent separately, so this change retains that key at the existing owner and keeps distinct requests in distinct cache entries.The regression exercises the production report owner and request adapter with fixed external responses for raw, literal, and other-agent rows. It checks reverse completion, incomplete session-ID metadata, and report absence without using another row's cached report. The 52-line allocation covers this missing request/cache contract; existing lifecycle and permission controls remain.
Evidence
The real Gateway/browser baseline used the checked admission prerequisite e02c1f3. A native raw-key request returned an eligible report matching the selected session, model, and provider. The actual Context popover instead requested the distinct literal row and showed zero categories with no permission error.
Remote changed-file formatting, lint, i18n, and selected production/test type checks passed. Both new regression cases failed against the prerequisite owner for the intended reasons; all 22 owner/consumer tests then passed with the candidate (2.70 seconds in Vitest; the single-file red run took 2.46 seconds).
Those focused checks cover the identical patch before its content-equivalent replay onto the merged admission prerequisite; the relevant source delta and range-diff were inspected. Exact-head hosted code, type, UI unit, and UI E2E checks passed.
On head 60e0667, the native Gateway/browser flow requests
globalwith agentmain, returns the selected session’s matching report, and renders five categories. Closing and reopening preserves the breakdown with one usage request and no page errors. Selecting the coexisting literal row requests its distinct key and session, returns its own absent report, and displays no categories. Other-agent isolation and lifecycle controls are covered by the focused tests and source review. No new model turn or synthetic saved report was used for this final comparison.Independent engineering review and the separate P0 automated review remain clean for the unchanged patch. ClawSweeper’s review rates the current head Diamond with no findings. Current-head CI and the applicable security review passed, including the test-line gate after the separate budget correction in #188780.
The identical three-file patch was replayed onto a target containing that correction as 997a1ce. The media below retains its actual 60e0667 capture identity and remains applicable: the patch and 66 relevant selected-row, report-owner, request, guard, hydration, test, and dependency inputs are identical after replay. The inspected adjacent changes do not alter this flow; no fresh runtime execution is claimed.
Visual evidence
Open and reopen the selected raw chat context popover
context.mp4
Visual verification
60e066731214e82f71a72839f65825afd8781442