Skip to content

Resolve Docs project-backed opener sources - #2101

Merged
ymichael merged 1 commit into
mainfrom
bb/post-merge-fix-docs-ignores-project-opener-host-thr_pqpb7c4p4t
Aug 20, 2026
Merged

Resolve Docs project-backed opener sources#2101
ymichael merged 1 commit into
mainfrom
bb/post-merge-fix-docs-ignores-project-opener-host-thr_pqpb7c4p4t

Conversation

@ymichael

Copy link
Copy Markdown
Collaborator

What was wrong

PR #2088 correctly preserved PluginFileOpenerSource.experimental_hostId through the Docs frontend and private RPC, but resolveOpenerFile consumed it only for source.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_hostId selects that host; omission resolves through system.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_VERSION is 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.ts

After the fix and the final rebase onto deb723091 / merged #2059:

  • The focused server suite passed 32 tests. The regression proves selected-host read, preview, and optimistic save routing; omitted-host primary routing even when a different project source is marked default; and rejection of an unknown selected host before file I/O.
  • pnpm exec turbo run test typecheck build --filter=bb-plugin-simple-notes --force passed: 66 tests, Docs build and typecheck, 7 successful Turbo tasks.
  • git diff --check origin/main...HEAD passed.

Related to #2088, #2083, and #2059.

AGENT GENERATED: by GPT-5.6-Sol

@ymichael
ymichael merged commit 82b9a00 into main Aug 20, 2026
13 checks passed
@ymichael
ymichael deleted the bb/post-merge-fix-docs-ignores-project-opener-host-thr_pqpb7c4p4t branch August 20, 2026 23:20
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.

1 participant