Repository navigation
fix(cloud): the next session in a workspace is reachable and selectable; New thread survives an ended machine - #377
Conversation
… ended one Live test: clicking Ready on a just-started machine session connected it, but its project registers seconds later, so the selector took it for another project's machine, gave up, and the thread ran on This computer. It now keeps Connecting for a 30 s grace before calling it unavailable. New thread defaulted to the first project in sidebar order even when that project lived on a machine that had gone away; it did nothing. It now takes the first project whose environment is reachable. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ment it already knows Sessions in one workspace share their environment (the snapshot keeps its id), but the client's broker target pinned the session it first connected to. After that session ended, every reconnect attached the ended session (409), the composer blocked sending on "reconnecting", and the new machine was never reached. Attach now takes the environment id too: when the known session has ended, the live session serving the same environment is attached, and the client pairs and keeps its bearer under the session actually attached. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…r New thread lives there) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 84fcfa6a95
ℹ️ 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".
| typeof body.environmentId === "string" && /^[\w.:-]{1,128}$/.test(body.environmentId) | ||
| ? body.environmentId | ||
| : undefined; |
There was a problem hiding this comment.
Preserve opaque environment IDs in attach requests
When an environment uses a valid identifier containing characters outside \w.:- (for example workspace/prod) or longer than 128 characters, this parser silently discards it. The shared EnvironmentId contract in packages/contracts/src/baseSchemas.ts accepts any non-empty trimmed string, so after the pinned session ends, sessionToAttach receives no environmentId and cannot locate the replacement session, leaving these supported environments permanently unable to reconnect. Validate against the shared contract or forward the opaque string unchanged.
AGENTS.md reference: AGENTS.md:L51-L56
Useful? React with 👍 / 👎.
Thread transfer impact
This comment will update automatically after the next completed run. |
- two live sessions serving one environment: the newest run wins, so reconnects stay on one machine; an asked-for session is used only when it serves the environment the client expects (broker lists only the caller's sessions: services/nexi-broker/src/broker.mjs:131); - an environment is not called ended while the workspace's next session serves it; - the connect deadline is one timer per click (60 s), read against the latest state, so re-renders cannot restart it, and a connect that never completes no longer hangs on Connecting; - New thread never counts This computer as offline at startup; - the attach route accepts any non-empty environment id. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Three bugs found by the live resume test (fork #376 / distro #592 follow-up):
Tests: client-runtime resolver 16/16 (new: follows the live session), server
sessionToAttach4/4 + cloud service, web selector + cloud 92/92. Live: with these, a machine session from a fresh draft is selected on one click and the agent's work lands on the VM (verified: the local checkout untouched).🤖 Generated with Claude Code