Resolve Docs project-backed opener sources - #2101
Merged
ymichael merged 1 commit intoAug 20, 2026
Merged
Conversation
ymichael
deleted the
bb/post-merge-fix-docs-ignores-project-opener-host-thr_pqpb7c4p4t
branch
August 20, 2026 23:20
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.
What was wrong
PR #2088 correctly preserved
PluginFileOpenerSource.experimental_hostIdthrough the Docs frontend and private RPC, butresolveOpenerFileconsumed it only forsource.kind === "host". Root Compose opens a project-source Markdown file as{ kind: "workspace", environmentId: null, projectId, experimental_hostId }, so Docs accepted the source identity and then skipped its only workspace branch, throwing “Docs can open workspace, host, and thread-storage files only.” The same project-backed file already works in the PDF opener through the core project content route.What changed
Docs now resolves a workspace source with no environment and a project ID through the project's authoritative local-path source. An explicit
experimental_hostIdselects that host; omission resolves throughsystem.config().primaryHostId, matching the public opener contract and core project-workspace routing. The resolved source root and host feed the existing confined Files SDK read, preview, and optimistic-write calls. Missing, duplicate, or non-absolute project-source identities fail closed instead of selecting another machine.This is the smallest complete fix: one resolver branch plus one server regression. Environment-backed workspace, absolute host-file, and thread-storage behavior is unchanged. There is no SDK, CLI, guide, configuration, or host-daemon wire change, so
HOST_DAEMON_PROTOCOL_VERSIONis unchanged.How you verified
The pre-fix focused regression failed both project-backed cases with the reported error (2 failed, 31 passed):
pnpm exec turbo run test --filter=bb-plugin-simple-notes -- server.test.tsAfter the fix and the final rebase onto
deb723091/ merged #2059:pnpm exec turbo run test typecheck build --filter=bb-plugin-simple-notes --forcepassed: 66 tests, Docs build and typecheck, 7 successful Turbo tasks.git diff --check origin/main...HEADpassed.Related to #2088, #2083, and #2059.