fix: make remote app-server proxy acquisition idempotent#23385
fix: make remote app-server proxy acquisition idempotent#23385efrazer-oai wants to merge 1 commit into
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 838c631aab
ℹ️ 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".
838c631 to
2b24123
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2b241231a2
ℹ️ 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".
2b24123 to
3604750
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3604750780
ℹ️ 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".
3604750 to
86c5f75
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 86c5f75e20
ℹ️ 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".
86c5f75 to
345c054
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 345c05405e
ℹ️ 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".
345c054 to
5daafb4
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
5daafb4 to
5b41d03
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
Remote SSH clients can reconnect while an older detached
app-server --listen unix://process is still alive. Before this change, callers had to run their own "maybe start, then proxy" sequence, which could overlap and create duplicate startup work against oneCODEX_HOME.This PR adds a small app-server-owned acquisition primitive:
codex app-server proxy --ensure-listenerCallers that do not pass
--ensure-listenerkeep the existing attach-only proxy behavior.What Changed
codex app-server proxywith--ensure-listener.-c/--configoverrides forproxy --ensure-listener, because a reused long-lived listener cannot safely apply process-scoped startup overrides after it already exists.Why
The app-server process is the only layer that can coordinate ownership of a remote control socket across multiple callers. Moving attach-or-start into the CLI gives desktop and other clients one idempotent contract instead of asking each caller to recreate a race-prone bootstrap protocol.
Design Decisions
Testing
Tests: targeted Rust transport coverage, targeted CLI proxy coverage, and recorded CLI smoke tests showing the old duplicate-bootstrap failure mode and the new concurrent
--ensure-listenerpath collapsing to one listener without duplicate-start or SQLite startup errors.Evidence
Before: blind duplicate bootstrap reaches conflicting remote listener startup.
ssh-ownership-before-window-recaptured.mov
After: concurrent
--ensure-listenercalls converge on one listener and a ready socket.ssh-ownership-after-window-fresh.mov