Skip to content

Finish a stuck VM creation by asking Boat again; VM config as data (C4) - #1353

Merged
Varuas37 merged 11 commits into
mainfrom
claude/project-thread-mrby4w
Nov 15, 2026
Merged

Varuas37 merged 11 commits into
mainfrom
claude/project-thread-mrby4w

Conversation

@Varuas37

@Varuas37 Varuas37 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Before: If Nessa asked Boat for a VM and lost the answer (a crash or a timeout), the thread stayed stuck in "Provisioning" for good. Every later opening was refused as uncertain.

After: The next opening asks Boat again with the same key. Boat either returns the VM it already made or makes it now, and the thread carries on.

Part of #1287.

Background

Before Nessa asks Boat for a VM for a thread, it saves a "Provisioning" record for that thread. Once Boat answers, it replaces that record with "Assigned". Boat's create takes a key (nessa-thread-<thread>), and asking twice with the same key gives back the same VM.

The problem

sequenceDiagram
    participant P as Person
    participant N as Nessa
    participant B as Boat
    P->>N: open the chat
    N->>N: save "Provisioning"
    N->>B: create VM (key nessa-thread-1)
    B--xN: answer lost
    P->>N: open the chat again
    N-->>P: refused: provisioning uncertain (forever)
Loading

The solution

sequenceDiagram
    participant P as Person
    participant N as Nessa
    participant B as Boat
    P->>N: open the chat again
    N->>N: "Provisioning" is already saved, keep it
    N->>B: create VM (same key)
    B-->>N: the VM (same one, or new)
    N->>N: save "Assigned"
    N-->>P: chat opens
Loading
  • b7ff9aa: when a thread's record is still "Provisioning" and the caller may provision, allocate_held asks Boat again with the same key instead of refusing. A read-only open (provision=false) still says uncertain. An "Assigned" record for a different thread is still refused. Saurav picked this option ("Retry with the same Boat key").
  • b9036d1: the Boat VM's Nessa config moves out of Rust string building into vm_config.json, and vm_config(root) fills in the workspace. A test runs the result through this build's own RuntimeConfig::parse, so a config the VM can't read fails here first.
  • b61a936 and 33ceaf5: the stress check's fake Boat can make the VM and then drop its answer (it does this when the fixture holds lose-next-create-<thread>). It answers a repeat of the same key with that same VM.
  • 33ceaf5: ADR 1160 rows B5 and B16 now say what the retry does. New rows B16a and B16b cover a retry after an unconfirmed rollback and after a confirmed one. A VM that Boat replays is never rolled back.

How we checked it

  • Allocation tests now expect the retry: after a lost answer, the next opening creates again and succeeds. A read-only open stays uncertain. A new test follows B16a and B16b: in both, Boat replays the VM, a refusal keeps it, and nothing is removed a second time.
  • A test parses the VM config with the reader this build ships.
  • pnpm test:e2e:stress --only vmBackground passed 5/5. The fake Boat's creation events run created, create_lost, create_replayed, with exactly one created, so the retry recovers the VM Boat already made.
  • clippy (-D warnings), cargo fmt --check and prettier are clean after merging main at 9267adf.
  • Codex's two findings (the stress scenario and the design table) are fixed, and its re-review found nothing.
  • Not run: a real Boat VM. That check is parked until the Mac is available.

Tradeoffs and follow-ups

  • The retry depends on Boat treating the same key as the same request. If Boat ever stops doing that, a retry could make a second VM. The key is unchanged from today, so nothing new depends on it.
  • After a confirmed rollback, Boat may replay the removed VM's id while it still remembers the key. That VM is never removed again, and the opening ends as a missing saved VM (B6).
  • The person-facing reason for a refused VM is still Show why a cloud VM refused, not "environment unreachable" #1290, which needs a lease change and so a new worker image.

Rollout

Nothing special. Old "Provisioning" records are retried on their next opening.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JcBpmR4KqePxnFf8j2359i

Workspaces drops its own count and lock maps for workspace_sdk::Uses,
keyed by conversation id. An opening takes the first use under the VM's
turn; a served connection and a background command extend it, so a rest
waits for the last one and logs who still holds the VM. RestCause moves
to the conversation domain and replaces WorkspaceRest.

Part of #1287. The lease-side half waits for the next worker image (#1290).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JcBpmR4KqePxnFf8j2359i
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JcBpmR4KqePxnFf8j2359i
An opening that found a saved Provisioning intent refused with
provisioning_uncertain forever, so any create whose answer was lost (a
timeout, a crash, a receipt that could not be saved) left the thread with
no VM. The next opening now asks Boat again under the same key (the
thread's), as the SDK's create documents: Boat answers with the VM it made
then while it remembers the key. Accounting reads still never create.

Part of #1287.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JcBpmR4KqePxnFf8j2359i
The VM's config.json was a literal in boat.rs, so a key the gateway's
reader no longer takes, or an agent it has no adapter for, showed only on
a real VM as an opening that never finished. It is now vm_config.json,
with only the thread's workspace added at connect, and a test parses it
with the same RuntimeConfig reader nessa uses on the VM.

Part of #1287.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JcBpmR4KqePxnFf8j2359i
…ening

The vmBackground step makes the fake Boat lose its answer to a thread's
first creation. Creating the conversation is refused, the next attempt
asks again under the same key, and exactly one VM is made.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JcBpmR4KqePxnFf8j2359i
@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6f11fe08-32f4-4fb3-a90c-17ce26b8534c
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@Varuas37
Varuas37 marked this pull request as ready for review November 14, 2026 23:40
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T23:56:27.970887Z 33ceaf5 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3a867b8d40

ℹ️ 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".

…ering

The stress fake now makes the VM before dropping its answer, and answers a
repeat of the same key with that VM (create_replayed), so the check shows the
retry recovers the existing VM rather than making the first one.

ADR 1160 rows B5 and B16 now say what the retry does, with B16a and B16b for
a retry after an unconfirmed and a confirmed rollback. A new allocation test
follows both: Boat replays the VM, a refusal keeps it, and nothing is
removed again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JcBpmR4KqePxnFf8j2359i

Copy link
Copy Markdown
Contributor Author

@codex review


Generated by Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 33ceaf5bf0

ℹ️ 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".

`workspaces` is a Unix-only module, so the Windows server tests could not
compile the new configuration test. Boat VMs are opened only by the Unix
gateway, so the test runs there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JcBpmR4KqePxnFf8j2359i

Copy link
Copy Markdown
Contributor Author

On 53c0393, "Windows server library tests (server-other)" failed on 6 wall-clock tests:

  • nessa-gateway: 4 in external_events::tests and subscriptions::a_lagging_subscriber_resumes_from_its_cursor
  • nessa-server: peer_reading_tests::a_slow_peer_does_not_hold_up_the_others

The run took 1,565 s, against about 1,200 s for the same group on main.

This PR doesn't change any of those areas. It only changes workspaces, which is Unix-only and so isn't built on Windows, plus the server workspace tests and the stress script. The same group failed on other timeouts on #1339 (both runs) and on main at b29c91f. All the other checks that have finished are green, including Windows server-conversation and the stress check. local-auth is still running.

I'll re-run the failed job once when the run finishes.


Generated by Claude Code

@Varuas37
Varuas37 merged commit a8ee3b1 into main Nov 15, 2026
25 of 27 checks passed
@Varuas37
Varuas37 deleted the claude/project-thread-mrby4w branch November 15, 2026 01:34
Varuas37 added a commit that referenced this pull request Nov 18, 2026
<!-- claude-projects-attribution: {"github_login":"Varuas37"} -->
_Requested by **Saurav** · [project
thread](https://claude.ai/code/project/chan_01UZaufydjNk2K88KGgoAfmr?thread=cmsg_01UZaufydjNk2K88KGgoAfmrX5YyyUXBGeQoMRRr3igVbS)_

**Before:** Of the 11 changes merged to main in the last day, two fixes
had no check in CI. A sidebar row losing its hover fill under its
actions (#1337), or onboarding asking for the vault passphrase (#1340),
could come back unnoticed.

**After:** The conversation stress suite (run by every PR's CI) fails if
either comes back. 2 gaps closed, no issues opened.

## Background

The daily test-gap run reviews what merged to main in the last 26 hours.
For each fix it puts the bug back and checks that a test CI runs fails.
A fix only a local script checks counts as a gap.

## The problem

- **#1337 (row hover).** When the pointer moved from a sidebar row onto
its trailing action (a channel's settings), the row lost its highlight.
Only `shared-controls.mjs --only rows` checked this, and no CI job runs
that script.
- **#1340 (onboarding vault).** The setup window opened the vault's
unlock dialog on its own. The stress `onboarding` step already refused a
vault dialog, but it ran over an unlocked vault. There the old code drew
no dialog either, so the step passed with the bug put back.

## The solution

All in `verification/desktop/scripts/conversation-stress.mjs`:

1. **`channel` step.** Once two channels exist, it finds the channel row
that is not selected (its rest and hover fills differ). It points at the
row, then at its settings beside it, and requires the same hover fill
both times.
2. **`onboarding` step.** It locks the vault through its native session,
as after a restart. Then it opens the setup window, which already
refuses any vault dialog. It unlocks the vault again afterwards.

## How we checked it

| Entry | Bug | What holds it now |
| --- | --- | --- |
| #1353 | A VM creation whose answer was lost never finished | Existing:
2 allocation tests fail with it put back |
| #1351 | A voice call ended when its chat left the panes | Existing: 2
VoiceController V16 tests fail with it put back |
| #1337 | Row hover dropped under its trailing actions | **New**
channel-step check: fails with the CSS put back (`rgba(0, 0, 0, 0), not
oklab(0.985 0 0 / 0.05)`), holds on main |
| #1340 | Onboarding asked for the passphrase | **New** locked vault in
the onboarding step: fails with the fix put back ("the setup window
opened a vault dialog on its own"), holds on main |
| #1350 #1346 #1339 #1332 | Features, copy, and SDK guard naming | Not
fixes |
| #1341 #1338 #1336 #1334 | Crate moves and refactors | Not fixes |

- Stress `--only onboarding,passphrase,channel,stop` in Chromium held
9/9 on this branch. `verification/desktop/scripts/lib/*.test.mjs` passed
698 tests. eslint and prettier are clean.
- Not run: WebKit (it cannot be downloaded in the cloud sandbox).

## Tradeoffs and follow-ups

- The hover check needs an unselected channel row. In the `stop` step
only one channel exists, and it is selected, so the check runs in the
`channel` step.
- The onboarding step briefly locks the shared vault. It unlocks it
again in a `finally`, so later steps see it unlocked.

## Rollout

Nothing special. Test-only change.

---
_Generated by [Claude
Code](https://claude.ai/code/session_018rccRX3nxAcKBWu6gcEXWB)_

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants