fix(codex): keep fork and delete state consistent - #34
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 21082a7240
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
21082a7 to
300bf50
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 300bf50a19
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
300bf50 to
3497ac9
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3497ac93a9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
3497ac9 to
6f1eb1a
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6f1eb1a956
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
6f1eb1a to
a622fe3
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a622fe3949
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
a622fe3 to
ae28404
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ae28404703
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
ae28404 to
91f6305
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 91f6305103
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
91f6305 to
251a980
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 251a98055d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
251a980 to
a21d1a4
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a21d1a4e22
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
a21d1a4 to
3f0bc5c
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3f0bc5c1d6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
3f0bc5c to
eecebb5
Compare
|
@codex review |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fbfb18389e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
fbfb183 to
a46031a
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a46031a49a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
a46031a to
877b03a
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 877b03a56b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
877b03a to
2cea47c
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2cea47c9e5
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
2cea47c to
1e98846
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1e9884686c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
1e98846 to
f1430f9
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f1430f97ae
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
f1430f9 to
b760136
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b760136cec
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
b760136 to
b1e7322
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
- Invalidate stale catalogs before publishing both fork variants. - Recover journaled fork-only threads until native list indexes a turn. - Preserve rename titles while those threads remain catalog-only. - Ignore deleted fork records whose rollout no longer exists.
- Route resident deletion through the app-server that owns the thread. - Keep cold deletion outside the pool with a transient control connection. - Preserve state on rejection and reconcile unknown outcomes exactly. - Cover Code, Work, multi-profile, busy, and descendant deletion paths.
- Clear provider model overrides in curated-default regressions. - Ignore host managed settings so local and CI results stay deterministic.
- Pair wheel availability changes atomically to preserve gesture intent. - Bound the native selection drag workload without weakening assertions. - Dispatch the follow-up pointer-style click on the target DOM node. - Keep virtual-row geometry outside the interaction-state regression.
b1e7322 to
9ecd740
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9ecd74022f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if engine == "claude": | ||
| await self._delete_claude_client_message_ids(sid) | ||
| else: | ||
| await self._delete_codex_client_message_ids(codex_alias_path) |
There was a problem hiding this comment.
Purge aliases for every recursively deleted rollout
When deleting a parent with fork descendants, deleted_sids includes the recursively removed children, but this call deletes client-message aliases only for the root's codex_alias_path. Any descendant previously used through Remote has its own CodexClientMessageStore record; after thread/delete removes its rollout, that path can no longer be rediscovered, so the stale record remains in the bounded store and can prematurely evict aliases for live sessions, breaking stable client message IDs in history. Capture descendant rollout paths during preflight and delete each confirmed descendant's aliases as well.
Useful? React with 👍 / 👎.
Summary
Fix two consistency failures in Codex session lifecycle handling:
error.
Root cause
Fork completion published
SessionForkedand then reused a cached sessioncatalog that did not contain the new child. The browser correctly treated the
missing focused child as stale and selected another session. A later fork could
therefore use that unrelated session as its parent.
A successful zero-turn fork can also remain absent from
thread/listuntilits first model turn. Without a durable catalog overlay, a later refresh loses
the child again, and a rename only updates app-server state that is still
missing from the list.
Deletion disconnected the cc-remote daemon proxy before issuing
thread/deletethrough a separate app-server process. Disconnecting the proxydoes not release the shared daemon's writer, so the second process rejected the
delete.
Changes
fork results.
active or archived rollout still exists.
indexes the child.
resurrect a catalog-only child.
thread/deletethrough the app-server connection that owns a residentthread.
connection without consuming or evicting a resident pool slot, with a
loaded stdio fallback when the shared proxy is unavailable.
shared-daemon lifecycle notifications so sibling threads cannot bind it.
so transient deletion cannot reject a sibling thread approval.
ownership scans using their exact PID and process start time.
deletion fails closed until a terminal marker or normal stale-owner cleanup.
thread/readand rollout checksinstead of a bounded session-list scan.
deletion, verify exact ancestry, and reject active cold descendants.
used only for its transient control connection.
rollout is missing or unreadable.
disappears, or cannot complete its holder scan.
preflight descendant set with exact reads.
checkpoint journals across their former repositories.
wrapper-owned queued prompts cannot be discarded.
rejecting active private-App and shared-daemon CLI turns before deletion.
thread/deletedbatch even when the requestedroot notification arrives before descendant notifications.
including resident descendants and cold sessions.
spontaneous turns, and preflight races consistently.
ID so recursively deleted private /btw forks are evicted exactly once.
preserving fail-closed behavior for every other app-server rejection.
controls, plans, presentation, pins, watches, and focus are cleaned atomically.
pool removal, then reject commands that captured a now-detached context.
repositories instead of deriving a bucket from a fallback cwd.
preflight instead of requiring a nonexistent rollout ownership watch.
metadata cleanup and list refresh still complete.
mobile WebKit virtual-row layouts, Chromium wheel-lease timing, and loaded
host drag cost.
Regression coverage
The new tests cover:
and the unavailable-proxy stdio fallback.
requests arrive during and after initialization.
both with and without an existing watch.
descendant ordering.
plus active and archived catalog pagination.
scans during resident deletion.
journal removal.
including cleanup of every route-keyed metadata store.
block deletion of an unrelated root.
reconciliation are rejected explicitly without retaining or dropping payloads.
persisted checkpoint bucket from the former repository.
an external owner under the native thread id.
OSErrorafter native deletion cannotinterrupt shared metadata cleanup or session-list refresh.
Validation
.venv/bin/python -m pytest: 1815 passed, 2 skippedruff check cc_remote tests deploynpm --prefix web run buildnpm --prefix web run test:reliabilitynpm --prefix web run test:history-browser: 222 passed, 20 skippednpm --prefix web run lintbash -nfor deployment scriptsshellcheck -xfor deployment scriptsgit diff --checkAll commits are GPG-signed, and all added source lines stay within 80 columns.