Repository navigation
refactor(sessions): follow the chat by key for stored delivery references - #200099
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 changes before merge. What this changesThis PR makes retained delivery references follow a conversation key across edits and resets while preserving explicit live-writer fences. Example: A background command finishes after agent:main:dashboard:reset-waiter receives a new lifecycle revision.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness⛔ Needs changes before merge - 2 items remain Keep this PR open: following the chat by key addresses a concrete delivery problem, but the research cutover is incomplete and affected consumer tests still enforce the previous behavior. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherBackground producers retain conversation references; session admission resolves the current transcript, checks authority, and delivers events or commits visible results. flowchart LR
A[Background producers] --> B[Stored conversation key]
B --> C[Session admission]
C --> D[Current authority]
D --> E[Current transcript]
E --> F[Chat result]
Technical reviewBest possible solution: Keep key-following delivery in the existing session owner, migrate its consumer tests, and defer research changes until its transcript-keyed storage can follow the same contract safely. Do we have a high-confidence way to reproduce the issue? Current-main lifecycle comparisons and the exec withholding path establish the reported failure from source; no target code was executed during this review. Is this the best way to solve the issue? Using the existing session owner to resolve retained references by key is appropriate, but changing research predicates cannot repair a lookup that already selected the wrong persisted namespace. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b81742c8bfb5. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource -164, Tests -8, Config +1, Other +89. Total -82 across 30 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes: No label 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 Reviewed November 16, 2026, 8:00 AM ET / 13:00 UTC. |
…nces Stored and retained references (exec wakes, session events, memory audience, queued outbound sends, background results, goal continuation, deep-research job views) now match the chat by its session key. An edit, rewind or reset no longer withholds a result; a deleted chat still refuses it. Live-writer fences keep their exact transcript pin, and a scheduled occurrence keeps its exact lifecycle. Deletes the reset withhold path and its transcript note, and adds a CI ratchet so production pins on session id and lifecycle revision cannot grow. Co-authored-by: obviyus <[email protected]>
…tests Co-authored-by: obviyus <[email protected]>
Co-authored-by: obviyus <[email protected]>
Co-authored-by: obviyus <[email protected]>
d495229 to
e0e51b2
Compare
|
Maintainer override: the failing jobs on e0e51b2 fail on current main (59d9759) with the same tests, run locally from source at that main commit:
This PR does not touch these files or their owners. Exact-head local ClawSweeper review is clean, and the source-tier Gateway E2E (rewind, edit, queued input, archive, delete, compaction successor) is in the PR body. |
|
Landed in edbc5bc. Bug: an edit, rewind or reset withheld background exec wakes, background results, queued sends and goal continuations, because stored references compared the lifecycle revision. Fix: stored references follow the chat by key; live writers and scheduled occurrences keep their exact pins. Proof: source-tier Gateway, base withholds and head delivers on rewind and edit; delete still drops and stops the work; a compaction successor still delivers. |
…tgres-compaction-watched-prompt-20261116 * commit '9e810f7101557b006d5ff223d955f14dc43329f0': (23 commits) chore(ui): refresh control ui locales (#200164) fix(update): stop reporting unset git config keys as failing checks (#200153) test: consolidate redundant coverage (198793, part 2) (#198936) revert: skills-used full-transcript scan on every chat history page (#200159) refactor(sessions): follow the chat by key for stored delivery references (#200099) fix(update): bridge 2026.11.5-beta.4 updaters (#200152) fix(gateway): avoid filesystem stalls during catalog refresh (#200136) fix(ci): match update refusal probe to selected candidate (#200043) fix(agents): keep read-only steering carriers when publishing suppressed user envelopes (#200156) test: consolidate suites while retaining recovery owners (#198933) test: consolidate redundant coverage (198789, part 2) (#198932) refactor(cli): consolidate camera command tests (#200144) fix(cli): avoid initializing provider runtime during cleanup (#200139) fix(ui): show mobile destinations without the drawer exit delay (#198879) chore(ui): refresh control ui locales (#200146) fix(knowledge): keep historical claims distinct and reject changed retries (#200140) fix(ui): align dropdown arrows on mobile New Session improve(sessions): archive inactive transcripts by default (#199899) refactor(agents): own background commands and yield waits by the chat (#200097) fix(models): guessed non-chat models leave the default picker instead of being refused (#200102) ...
#200099 made deep-research job views and their view token follow the transcript (session id) instead of the lifecycle revision, so an edit or rewind keeps the conversation's research visible. The Gateway routing test still expected a lifecycle-only change to retire those jobs. Assert retention there instead, and move the retired-job denial checks onto the reset that changes the session id.
…#200245) #200099 made deep-research job views and their view token follow the transcript (session id) instead of the lifecycle revision, so an edit or rewind keeps the conversation's research visible. The Gateway routing test still expected a lifecycle-only change to retire those jobs. Assert retention there instead, and move the retired-job denial checks onto the reset that changes the session id.
…nces (openclaw#200099) ## Problem A message edit, rewind or `/new` mints a new lifecycle revision. References that were stored before the change still compared that revision, so the result was dropped: - A background exec that exits after a rewind or edit is withheld. The chat gets the note "Background command result withheld … reset, rewound or moved". - A background result (cron or subagent) commit fails with `session rebound`. - An automatic goal continuation stops after an edit. - Deep-research jobs disappear from the chat after an edit ("not found in this conversation generation"). - A queued outbound send and a memory audience lease are revoked after an edit. Only the session key stays the same across edit, switch, reset and compaction. ## Fix - Stored references match the chat by key alone (`matchesSessionGeneration`). Live transcript writers keep their exact transcript pin. A scheduled cron occurrence keeps its exact lifecycle (`exactLifecycle`). - Queued outbound sends follow the key across a reset. - A session event follows the key to the chat's current transcript before reply admission, so a compaction successor still gets the wake. - Deleted: `followSessionEventTargetForHost`, the exec withhold note, and the `expectedLifecycleRevision` thread through background results, cron conversation results, confirmed visible messages and outbound transcript pins. - Goal continuation matches by key and goal. Deep-research job views drop the revision compare; the job store stays per transcript. - New CI ratchet `check:session-identity-ratchet`: production `src` counts of `expectedSessionId`, `expectedLifecycleRevision` and `.lifecycleRevision` must not grow. Not changed here: - Reactions still read by transcript id. Message ids are 8 hex characters and unique only within one transcript, so a key-wide read is not safe yet. - GitHub publication keeps its incarnation pin. Its transition worker stores the revision in publication rows, so following the key needs a stored-row change. - Subagent requester ids and process ownership belong to a separate change. Production code: +48 / −208. ## User impact - Results that finish after an edit, rewind or `/new` arrive in the chat as it is now. - A deleted chat still drops the result. Delete already stops the key's processes, subagents and queued inputs, so a recreated key gets nothing. - An archived chat gets no wake (same as before). ## Proof Source-tier scratch Gateway (`ocx src`), base = merge base, scripted model with a real background `exec` (exit after 60–75 s): | Journey | Base | Head | |---|---|---| | Rewind while exec runs | withheld (note in chat) | wake delivered | | Edit (rewind + new message) while exec runs | withheld | wake delivered | | Queued input across a rewind during an active turn | input runs | input runs | | Archive while exec runs | no wake | no wake | | Delete, then recreate the key | no wake, process stopped | no wake, process stopped | | Compaction successor (new transcript id) | wake delivered | wake delivered | Focused tests: lease, session events, exec notify, goal continuation, deep research, background results, cron delivery, outbound transcript. `pnpm tsgo:core` and `pnpm check:test-types` pass. Co-authored-by: Ayaan Zaidi <[email protected]>
…openclaw#200245) openclaw#200099 made deep-research job views and their view token follow the transcript (session id) instead of the lifecycle revision, so an edit or rewind keeps the conversation's research visible. The Gateway routing test still expected a lifecycle-only change to retire those jobs. Assert retention there instead, and move the retired-job denial checks onto the reset that changes the session id.
…tent lane assertion-safety at 6e1a925 reported "subagent-registry-shutdown- notices.ts: 1 > 0". The cause was the cast that typed a parsed backup row. The undo now builds that row from its validated fields, so there is no assertion. test-lines at 6e1a925: net +113645 against a 400 allowance plus a 113043 credit, 202 over. The base e7de8c3 nets +113070, so this lane grew test lines by 575. The new continuation-shutdown-intent.txt record breaks that down per item: +271 for the item 1-3 restart custody pins (the custody suite +7, plus the shared registry world +264, which holds the helpers moved out of the suite) and +304 for item 4 (shutdown- notices +228, the continuations CLI +76). session-identity lists the same 31 files at e7de8c3 and here, entry for entry. That is upstream's openclaw#200099 residual, unchanged by this lane. Refs openclaw#129388 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…aw#194724) * fix(goals): continue local Codex goals without operator roles * docs: remove local goal continuation note * test(goals): cover local continuations without operator authority Prove local Codex continuation eligibility at enqueue and admission while retaining worker and required-placement denials. Co-authored-by: VACInc <[email protected]> * test(goals): remove unnecessary line allocation Co-authored-by: VACInc <[email protected]> --------- Co-authored-by: VACInc <[email protected]> (cherry picked from commit ec41ea8) Release adaptation: Require operator authority only for remote worker goals; keep local placement and existing admitted source checks. Existing baseline contains collected-child companion 3e78932. Later session-key and filesystem changes not prerequisites. Personally inspected sibling codex-rs/app-server/src/request_processors/thread_goal_processor.rs:149-251: local active goal runtime effects reuse materialized thread and GoalService. Follow-up dispositions: edbc5bc refactor(sessions): follow the chat by key for stored delivery references (openclaw#200099); 2c4413a fix: reduce Gateway stalls under filesystem pressure (openclaw#197510); 3e78932 fix: Goals stall after collected child work Validation: Baseline focused run timed out45 in compiled subprocess preparation before assertions; not red proof. Scoped diff/check and admission/placement guards inspected; full fixed regression queued for final focused group. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 28f718e2f9854c83fb6bed1fdcb9ae73b69286c0) (cherry picked from commit cf62b191e81adf86f72ac06a096f6adb18a7d0d8)
Problem
A message edit, rewind or
/newmints a new lifecycle revision. References that were stored before the change still compared that revision, so the result was dropped:session rebound.Only the session key stays the same across edit, switch, reset and compaction.
Fix
matchesSessionGeneration). Live transcript writers keep their exact transcript pin. A scheduled cron occurrence keeps its exact lifecycle (exactLifecycle).followSessionEventTargetForHost, the exec withhold note, and theexpectedLifecycleRevisionthread through background results, cron conversation results, confirmed visible messages and outbound transcript pins.check:session-identity-ratchet: productionsrccounts ofexpectedSessionId,expectedLifecycleRevisionand.lifecycleRevisionmust not grow.Not changed here:
Production code: +48 / −208.
User impact
/newarrive in the chat as it is now.Proof
Source-tier scratch Gateway (
ocx src), base = merge base, scripted model with a real backgroundexec(exit after 60–75 s):Focused tests: lease, session events, exec notify, goal continuation, deep research, background results, cron delivery, outbound transcript.
pnpm tsgo:coreandpnpm check:test-typespass.