code-mode: use client cell ids and linear observations#29398
Closed
cconger wants to merge 1 commit into
Closed
Conversation
b9578cb to
cb43921
Compare
ba7fa7b to
846a04a
Compare
cb43921 to
9139181
Compare
846a04a to
8ec0e02
Compare
9139181 to
86200fe
Compare
8ec0e02 to
12fe361
Compare
28b4f57 to
2cb2170
Compare
74b9705 to
aaa1d51
Compare
2cb2170 to
474422b
Compare
This was referenced Jun 22, 2026
aaa1d51 to
ffe72de
Compare
474422b to
abbe7df
Compare
ffe72de to
e7f4fc2
Compare
abbe7df to
28536e0
Compare
jif-oai
reviewed
Jun 22, 2026
| source: args.code.clone(), | ||
| }) | ||
| .await | ||
| .map_err(|error| { |
Collaborator
There was a problem hiding this comment.
(found by Codex)
This also runs for ConflictingCreate. In that case this attempt was not admitted, but finish_with_error closes and terminates the original cell that owns this ID. Can we make cleanup ownership-aware so a conflicting retry cannot tear down the existing cell?
| .observation_generations | ||
| .lock() | ||
| .unwrap_or_else(std::sync::PoisonError::into_inner); | ||
| generations.insert(cell_id, next_generation); |
Collaborator
There was a problem hiding this comment.
Missing also reaches this insert..
| struct IdempotentCell { | ||
| id: CellId, | ||
| kind: CellKind, | ||
| request: CreateCellRequest, |
Collaborator
There was a problem hiding this comment.
nit: created_cells outlives the actor entry, so retaining the full request here pins every script plus a duplicate enabled-tool catalog for the whole session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Core already owns stable thread and tool-call identity. A separate idempotency key plus a host-generated cell ID adds protocol state, while retaining every arbitrary observation key grows replay storage for the session lifetime.
What
CellIdvalues in Core from thread ID and tool-call ID.cell_id: CellIdin the wireCreateCellRequest.generation: ObservationGenerationin the wireObserveRequest.ObserveOutcomevariants from code-mode: expose create and observe operations #29291 unchanged and retain only the latest value per cell for replay.Host/Core wire sequence
sequenceDiagram participant Core participant Host Core->>Core: derive CellId(thread_id, tool_call_id) Core->>Host: CreateCellRequest { cell_id, ... } Host-->>Core: same CellId Core->>Host: ObserveRequest { cell_id, generation: 0, ... } Host-->>Core: ObserveOutcome for generation 0 opt outcome is ObserveOutcome::Yielded Core->>Host: ObserveRequest { cell_id, generation: 1, ... } Host->>Host: evict generation 0 outcome Host-->>Core: ObserveOutcome for generation 1 endStack boundary
At this commit an
ObserveOutcome::CompletedorObserveOutcome::Terminatedvalue has no successor generation, so its replay payload remains retained until session shutdown. #29401 adds explicit terminal acknowledgement and release.Validation
just test -p codex-code-modejust test -p codex-code-mode-protocolStack parent: #29310.