Repository navigation
fix(ui): require exact active run ownership - #126116
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Land-ready evidence for Root cause and owner: Best-fix verdict: this is the narrow canonical consumer cleanup. Removing Proof:
Known proof gap: transcript cache-key ownership is not honestly observable black-box without instrumentation. It is covered by the focused regression and source-aware autoreview and is not claimed as live proof. ClawSweeper: the exact-head review published with no actionable findings, 4/6 patch quality, and sufficient video-backed proof. Its only before-merge item was exact-head CI plus a clean current-main merge result; CI run 32205555238 is green and the native Testbox-backed prepare gate completed successfully against current main. There is no Rank-up moves section, and no post-review behavior push requires re-review. The unrelated duplicate steered assistant-output observation remains separately tracked and excluded. |
|
Codex review: needs maintainer review before merge. Reviewed August 18, 2026, 9:43 PM ET / August 19, 2026, 01:43 UTC. ClawSweeper reviewWhat this changesThe PR stops Control UI from selecting an arbitrary active run and instead renders run-specific activity and transcript state only for a locally owned or exactly matched run ID. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessNo blocking patch defect found. This focused UI fix remains open because it carries the protected Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherGateway projects aggregate session activity plus any known exact run identities to Control UI. The UI uses those facts for activity headlines, inspector links, and transcript projection. flowchart LR
A[Gateway session projection] --> B[Aggregate activity]
A --> C[Exact active run IDs]
D[Local or observer run ID] --> E[Exact ownership check]
B --> E
C --> E
E --> F[Activity headline and inspector]
E --> G[Transcript projection]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -9, Tests +80, Docs +11. Total +82 across 8 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land after exact-head CI completes, keeping the aggregate running indicator while allowing run-specific UI only for local or exact Gateway-owned identities. Do we have a high-confidence way to reproduce the issue? Yes. The base implementation selected Is this the best way to solve the issue? Yes. Requiring an exact owned identity is the narrowest fix and preserves aggregate activity plus the existing reconnecting-outbox recovery path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against fea219831940. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Related: #125983
What Problem This Solves
Fixes an issue where Control UI consumers could treat the first server-reported active run ID as the owner of aggregate session activity. With overlapping or externally started runs, that arbitrary choice could expose a stale observer headline or Inspect run link and project transcript state under the wrong run identity.
Why This Change Was Made
The Gateway remains the owner of exact active-run facts:
hasActiveRunis aggregate direct-session activity, while a presentactiveRunIdscontains known exact identities. Omission provides no identity information; on incremental merge events, a present empty array replaces and clears the cached list.Consumers now require an identity they actually own. Observer headlines and inspector links require exact
observerDigest.runIdmembership, and transcript projection receivesnullwhen the pane has no explicit/local run. The patch intentionally retainsactiveRunIds; it does not reopensessions.steer, remove protocol fields, or change selected-session send semantics. Main already delegates selected-session input to the runtime's ordered start-or-steer owner.This follows the maintainer decision that closed #125983: keep Gateway-owned exact facts and remove arbitrary first-run selection. The broader producer-normalization work in #126106 is independent; this PR does not redefine field presence as completeness.
User Impact
Activity and chat surfaces no longer attach stale or unrelated run-owned UI to a session merely because that run ID happened to sort first. Exact matching observers remain visible, aggregate running indicators remain intact, reconnecting outbox-owned transcript projection remains intact, and selected-session steering still works without browser-selected run targeting.
Evidence
Judged diff: production UI
+10/-19(net-9), tests+90/-10, docs+19/-8.Post-rebase validation on
54ebb307cdfc28f8c232162179b9734b19662dbd:node scripts/run-vitest.mjs ui/src/lib/observer-digest.test.ts ui/src/pages/activity/session-activity-view.test.ts ui/src/pages/chat/chat-projection-run-id.test.ts— 3 files, 10 tests passed.node scripts/check-changed.mjs -- docs/gateway/clients.md docs/gateway/protocol.md ui/src/lib/observer-digest.ts ui/src/lib/observer-digest.test.ts ui/src/pages/activity/session-activity-view.ts ui/src/pages/activity/session-activity-view.test.ts ui/src/pages/chat/components/chat-transcript-projection.ts ui/src/pages/chat/chat-projection-run-id.test.ts— passed, including formatting, ratchets, dead-export scans, UI i18n, TypeScript, and lint lanes.pnpm ui:build— passed; 2,957 modules transformed and 908 finalized sidecars verified.pnpm check:docs— passed; formatting, markdownlint, MDX, glossary, 6,542 internal links with 0 broken, and 1,180 config fences validated.git diff --check— passed.--mode uncommitted, default P0 scope — clean; no accepted/actionable findings, patch correct at 0.99 confidence.Source-blind behavior validation passed Activity ownership and selected-session steering. The transcript-internal clause is black-box blocked because it has no honest UI-visible observation without instrumentation; the focused behavior regression and source-aware autoreview cover it, and it is not claimed as live proof.
Live selected-session proof used an isolated Gateway. An idle real turn completed, then a second
chat.sendreached the same visibly active selected session withqueueMode=steer, noexpectedRunId, and noexpectedLeafEntryId; the final visible reply includedUI3_STEER_OK, and the legacy uniqueness error was absent. An unrelated duplicate steered assistant-output observation is tracked separately and excluded from this patch.Direct Codex OSS contract inspection at
86b1123ff6b5d089a146be4e603a324cf454223a:codex-rs/core/src/session/session.rs:58and:1311— the session ownsactive_turnand initializes it once.codex-rs/core/src/codex_thread.rs:278-289and:370-383—start_or_steer_turnsubmits through the ordered turn-input path.codex-rs/core/src/session/turn_input.rs:141-155,:167-245, and:478-565— Core alone decides start versus steer while checking the active turn and returns the exact accepted turn ID.codex-rs/protocol/src/turn_input.rs:115-159and:180-207— the protocol defines start-or-steer and its exactStarted/Steered/NotSubmittedoutcomes.Visual proof
Before: the stale nonmember observer headline is shown.
After: the stale headline and Inspect run affordance are absent, while the matching active observer remains visible.
Selected session while the real turn is active:
The same selected session after steering, with
UI3_STEER_OKvisible:Live steering recording:
selected-session-steering.webm