Repository navigation
Keep where each conversation runs in one place record - #1334
Conversation
Each conversation now has one file, conversations/places/<id>.json, holding where it was placed (here included) and, for a peer:any conversation, the worker that holds it and the provider context opened there. ConversationPlacements and ConversationBindings become one ConversationPlaces store; runs_on, in_workspace and the cloud-VM look-ups in environment_tools.rs read the record once. An earlier build's placements/ and bindings/ files are read until the record is first written, and for one release are still written beside it so a build put back finds every conversation where it runs. Erasing removes all three, the earlier files first. The stress pool step turns its conversation back into the older files and checks it stays put and then moves; the upgrade step restarts the gateway on older files for every conversation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JcBpmUavSQzUs5aJwmDfpv
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Codex Review Summary: ✅ CompletedThis 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: 1c64e443a3
ℹ️ 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".
This build writes the earlier binding before the place record, so the binding is never older than the record. A build put back moves a pool conversation in its binding alone, so on return the binding wins for a pool record; a record placed anywhere else still ignores it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JcBpmUavSQzUs5aJwmDfpv
|
@codex review Generated by Claude Code |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ 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". |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JcBpmUavSQzUs5aJwmDfpv
Two record helpers are used only by the Unix gateway's file store, and leases.rs uses Place only in Unix tests. The placement tests now write their files as private files the way a build does, so Windows reads the content rather than refusing a file it cannot trust. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JcBpmUavSQzUs5aJwmDfpv
|
Generated by Claude Code |
|
Generated by Claude Code |
<!-- 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>
Closes #1333. Slice P4 of the "where agents run" plan; lands after C1 (#1304).
Before / After
Before: a conversation's place was two facts in two files.
conversations/placements/<id>.jsonsaid where it was placed (absent for here). For apeer:anyconversation,conversations/bindings/<id>.jsonsaid which worker held it and which provider context it had opened there.runs_on,in_workspace,ofand the cloud-VM look-ups inenvironment_tools.rseach read one or both separately, so one command could read the placement and the binding at different moments.After: one file,
conversations/places/<id>.json:{"schemaVersion":1,"placed":"peer:any","worker":"peer:…","context":"…"}Here is written too (
{"schemaVersion":1,"placed":"here"}). Every look-up reads the record once (Environments::record), andenvironment_for(id, &record)answers from that same read.Background
The plan asked for one place record per conversation, so that S5 (#1312) and the "keep the main conversation on a move" work can change where a conversation runs in one place.
The problem
Two stores (
ConversationPlacements,ConversationBindings) held parts of one fact. Callers combined them by hand, and nothing kept a placement and its binding in step on disk.The solution
sequenceDiagram participant S as ConversationService participant E as Environments participant P as FilePlaces participant D as conversations/ S->>E: place(id, placed) E->>P: write(PlaceRecord::placed) P->>D: placements/<id>.json (not for here), then places/<id>.json S->>E: for_lease(id) / runs_on(id) / of(id) E->>P: read(id) P->>D: places/<id>.json alt no record yet (earlier build) P->>D: placements/<id>.json, then bindings/<id>.json for peer:any end P-->>E: PlaceRecord {placed, worker} Note over E: now() = Peer(worker) when bound, else placed E->>P: write(PlaceRecord::in_pool(binding)) on a rebind or a new context P->>D: bindings/<id>.json, then places/<id>.jsonPlaceRecord { placed, worker: Option<WorkerBinding> }. A worker is only valid withplaced == Pool, and a context only comes with a worker. A file that breaks either rule is refused as unreadable, never read as here.ConversationPlaces { write, read, erase }, replaces the two stores.FilePlaces::new(conversations_dir)owns all three directories.placedplus the current worker, not "asked" and "now". "Now" is derived (PlaceRecord::now), and nothing reads "asked" apart fromplaced. The cloud-VM receipt stays inboat-workspaces, because C1 did not move it into the SDK. Moving it is for when the SDK holds it.How we checked it
cargo test -p nessa-server --lib conversation::runs 1,657 tests and all pass.tests/conversation/placements.rsis rewritten to cover:pnpm test:e2e:stress), each knob run alone in the cloud box:pools, 5/5 held. After the first turn, the step turns the conversation back into an older build's placement and binding, then sends a message from the window. The conversation stays on its worker and no record is written. The worker then drains, the conversation moves, and the move writes the record and the older binding naming the new worker.upgrades, 5/5 held. Every place record is turned back into older files during the restart (upgrade: restarted on a version 6 file and 1 older place files), and the main conversation opens and answers.stress-upgrade.test.mjspasses 6/6, including stale older files being removed by the conversion.Tradeoffs and follow-ups
workerin it therefore refuses the conversation's placement read too, where before only its binding read failed. This is the record-scope rule (ADR 202): a file this build cannot read refuses that conversation alone.docs/statepage covers place files.worker-pool-preferences.md,auth/peer-gateways.mdandruntime-architecture.mdare updated.Rollout
No migration step. The gateway reads earlier files as before and writes the record on the next change.
Generated by Claude Code