Repository navigation
fix(operator): name Workspaces mounted past the first Branch page - #490
Merged
yifanxuaaa merged 1 commit intoOct 28, 2026
Merged
Conversation
…hemeral-AI-Lab#480) `snapshot` built the Branch id -> name map from one 64-Branch page, so `sandbox.list_workspaces` answered `branch: null` for a Workspace mounted on any later Branch, and the project page's own Workspace views had the same gap. The page still lists the Branches and sets `moreBranches`, but a mounted id it does not hold is now resolved through the history catalog by id, so a Workspace's `branch` no longer depends on how many other Branches the project has. The same map feeds `headMovedSinceMount`, so that answer is now the Branch's current head rather than the page's. Tests: - added workspaces_name_branches_beyond_the_first_page in engine/crates/layerfs-api/tests/operator_history.rs: 70 Branches, a view bound on b70 before a later Commit, asserting `moreBranches: true`, `branch: "b70"` and `headMovedSinceMount: true`. It fails on the parent with `branch: null`. - deleted: none. Production LOC: 102763 -> 102775 (delta +12) first-parent comparison (upstream/main 582bc78 -> this commit); engine layerfs-store-service +12. Scopes: api 2659 -> 2659 (0), core 38395 -> 38395 (0), engine 61709 -> 61721 (+12); reference absent (retired R9c; last counted 65,417 at tree 498dd19). Counted with tools/production_loc.py (blob 3341e4d) --root on a checkout of the parent commit and on the staged tree.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #480.
Problem
snapshot()(engine/crates/layerfs-store-service/src/operator/inspect.rs) reads one page of 64 Branches and builds the id -> name map from that page only.sandbox.list_workspacesand the project page's Workspace views then answerbranch: nullfor a Workspace mounted on any later Branch. The same map feedsheadMovedSinceMount, so it also compared against the page's head instead of the Branch's current head.Fix
The page still lists Branches and still sets
moreBranches. After it loads, each mounted Branch id that the page does not hold is resolved once through the history catalog (store.history().branch(id)), so bothbranchandheadMovedSinceMountare correct regardless of how many Branches the project has. Ids already on the page cost no extra read, and the work is bounded by the mounted Workspaces this daemon reports, not by the Branch count.Names still cannot be missing for a mounted Branch, so
sandbox.list_workspacesdoes not need to passmoreBranchesthrough.Tests
New
workspaces_name_branches_beyond_the_first_pageinengine/crates/layerfs-api/tests/operator_history.rs: 70 Branches, a seeded Workspace view bound onb70before a later Commit, then assertsmoreBranches: true,branch: "b70"andheadMovedSinceMount: true.On the parent commit the same test fails with:
Checks (macOS, Rust 1.85.1)
cargo test -p layerfs-api --test operator_history— 2 passed.cargo test --locked --all-targets --no-run— builds.cargo clippy --locked --all-targets -- -D warnings— clean.cargo fmt --all -- --check— clean.python3 -B tools/check_product_boundary.py— PASS (956 files).python3 -B -m unittest discover -s tools -p 'test_*.py'— 155 passed.Gap: this host's system SQLite is 3.54.0, which the overlay profile does not qualify, so the fixture panics before any test body. For the local runs above I temporarily enabled rusqlite's
bundledfeature (SQLite 3.53.2, already allowlisted) and did not commit that change. Linux CI uses the bundled build already. Not run: Linux FUSE/daemon mount targets and the Node SDK surface.Production LOC: 102,763 -> 102,775 (delta +12),
layerfs-store-serviceonly; tests and comments are not counted.