Repository navigation
fix(session): treat an unprovable connectionId as no host, not as ssh - #5
Conversation
A sleeping record's `connectionId` is a host STAMP, not a host kind. Round four gated the ssh answer on `sshTargetIds` hydration but left the runtime side unguarded, so an id neither list claimed still fell through to `ssh:<targetId>` — filing a runtime-stamped record captured during a catalog gap, or one whose environment was later removed, into a partition no runtime reader ever opens. Neither id space can disprove an id: the ssh list may not have loaded, and the runtime set is a best-effort union of whatever catalogs this boot holds. So only positive membership answers now, for both spaces. "Cannot prove" is null, which leaves the row local — the partition every reader loads, and the one `adoptStrandedHostPartitionSession` returns to its owner once some list can name it. A guessed `ssh:<id>` has no way back. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Review complete. No issues found — approved ✅. Tightens sleeping-record origin-host resolution to require proven SSH-target membership instead of guessing an SSH host id when the catalog is unhydrated. Reviewed commit: 4bae366 |
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4bae3662cc
ℹ️ 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".
Review follow-up. The six-line block restated the type doc and the function body; what it had to carry is that catalog absence is not authoritative, so an unplaceable id stays local and stays recoverable. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Review complete. No issues found — approved ✅. Inverts Reviewed commit: 8317188 |
|
Fixed in 8317188 — the six-line block is now three, keeping only what the code does not already say: catalog absence is not authoritative, so an unplaceable id stays local and stays recoverable, where a guessed |
Superseded by a newer Tenki approval on this pull request.
This test asserted the old contract — a nonempty connectionId reaching the ssh partition — and the routing fix changes that answer, so it failed rather than caught anything. Its setup is still the scenario worth pinning: a catalog with no row for the worktree, so only the record's own stamp names a host. What makes local the right answer is asymmetry, not preference. `fetchWorkspaceSessionWithRuntimeHostOwners` enumerates the local partition and one per KNOWN runtime and ssh host. A phantom `ssh:<id>` is not a known target, so it is never enumerated, never fetched, never merged — a wrong guess loses the pane's only resume handle permanently and silently. `local` is fetched unconditionally, and the next write re-routes the record once the target list can name it, so a mis-park corrects itself. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Review complete. No blocking issues — approved ✅; 2 nitpicks below. 🧹 Nitpicks (2) — 🟢 2 low
Reworks sleeping-session origin-host routing so records with unhydrated or unknown SSH target ids park locally instead of guessing an Reviewed commit: 5868a00 |
Superseded by a newer Tenki approval on this pull request.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5868a002c9
ℹ️ 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".
Review follow-up on the previous commit. The clear assertion compared the patch argument by reference, but `splitWorkspaceSessionForWrite` builds a new slice, so it could never match and the check passed without testing anything. It now asserts the record reached the local partition — verified to fail if the classifier goes back to guessing ssh — and the rationale is one line instead of a five-line walkthrough of what the assertions already show. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Review complete. No blocking issues — approved ✅; 1 nitpick below. 🧹 Nitpicks (1) — 🟢 1 low
This PR flips the sleeping-record origin-host fallback so unprovable Reviewed commit: adeaa9b |
Superseded by a newer Tenki approval on this pull request.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: adeaa9b33e
ℹ️ 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".
|
Two open findings, one already done and one I am declining with reasons. "Condense the routing walkthrough" — already addressed in "Preserve unhydrated SSH records in durable host storage" — not implementing, because the remedy is the failure mode this PR removes. Writing a durable copy to The finding is right that the local map is clearable, and that is a real cost — but a recoverable one, against an unrecoverable alternative. Where it is right, and what I did about it: the test's mock records patches without applying them, so it cannot observe what survives across the two writes. That was a fair criticism of the test's fidelity, and a separate finding on the same file — that its clear assertion compared by reference and so could never fail — was correct and is fixed in A test that observes the merged result across writes would be better than one that inspects patch calls. I have not written it here; it belongs with the persistence layer rather than in a routing fix. |
…anel (stablyai#7655) The workspace space-manager rendered every hosted review as "PR #N", so a GitLab merge request showed as "PR #5" instead of "MR !5". The cached review already carries its provider (HostedReviewInfo.provider) — the panel's local input type just narrowed it away. Thread provider through and format via the same localizedHostedReviewCopy / '!' vs '#' helpers the rest of the app uses. Extract the label formatting into hosted-review-label.ts (a pure module, away from the panel's heavy React/store imports) so it can be unit-tested directly, and add hosted-review-label.test.ts covering github / gitlab / azure-devops / gitea and the status suffix. linkedPR stays "PR #N" — it is the GitHub-specific workspace field, distinct from linkedGitLabMR. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Neil <4138956+nwparker@users.noreply.github.com> Co-authored-by: Neil <neil@stably.ai>
ELI5
When a terminal running an agent goes to sleep, Orca writes down which machine that conversation lives on so it can find it again. If it cannot actually tell which machine the note refers to, it used to guess "some SSH box" — and filed the note in a drawer nothing ever opens. The conversation was then unreachable even though nothing was wrong with it.
What changed
sleepingRecordOriginHostIdgated its SSH classification on whether the SSH target list had loaded, but had no equivalent guard on the runtime side. WhenruntimeEnvironmentIdswas empty, or simply did not contain the id, control fell through totoSshExecutionHostId(targetId). A record stamped with a perfectly valid runtime environment id during a catalog gap — or one whose environment had since been removed — was written to thessh:<environmentId>partition, which no runtime reader ever opens. That is the exact failure the module's own doc comment warns about.Neither id set is a complete census.
sshTargetIdsis null until the client loads the target set, andruntimeEnvironmentIdsis a best-effort union of whatever catalogs this boot happens to hold. So membership proves an id's kind; absence proves nothing. The classifier now says so: an id it cannot place in either space returns no host rather than being assumed to be an SSH target.Why this shape
The alternative was to widen the id sets until absence became meaningful. That cannot be done honestly — a client genuinely may not have loaded a catalog yet, and a removed environment is gone from every set by definition, which is precisely the case this code exists to survive.
Where this belongs
This is a fix to the change that merged as PR #1, which is on
swaplabs/mainbut has not yet reachedstablyai/orca. It targets the integration branch so fork builds carry the corrected version. When PR #1's content is upstreamed, this commit goes with it in the same changeset rather than following as a separate patch.Verification
pnpm tcclean,npx oxlintclean, and the two directly affected suites pass —workspace-session-sleeping-record-origin-host.test.tsandworkspace-session-host-split.test.ts, 38 tests.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.