Refactor runtime registry ownership#152
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 158a14f83f
ℹ️ 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".
| workspaceRoot, | ||
| stateRoot, | ||
| }), | ||
| runtimeHost: RuntimeHostResolver.resolveLiveServer(), |
There was a problem hiding this comment.
Keep daemon-backed routing scoped to this workspace
When a daemon is running for workspace A, resolving the CLI host with resolveLiveServer() now returns that server for workspace B as well, because it no longer checks the current workspaceRoot/stateRoot. Commands like heddle ask then send requests without a workspaceId, and chat-v2 passes the local id (often just default), while the server context in src/server/routes/trpc/trpc.ts only resolves against the daemon's own workspace catalog; the result is that running these commands from workspace B can read/write sessions and tasks in workspace A instead of B. Please either keep the daemon-backed path workspace-scoped or teach the server request path to resolve registered workspaces by state root before attaching.
Useful? React with 👍 / 👎.
60c5d59 to
d3020f5
Compare
d3020f5 to
931dfdd
Compare
Summary
workspace-*id, and legacydefaultcatalog ids are migrated on readworkspaceId, so one live server can handle clients from different workspacesheddle askchanges minimal: daemon-backed ask now sends the cwd-derived workspace id explicitly, with inline comments marking the v1-only compatibility pathyarn buildHow to test
./node_modules/.bin/vitest run src/__tests__/integration/control-plane/workspace-catalog.test.ts src/__tests__/integration/control-plane/session-lifecycle.test.ts src/__tests__/integration/server/daemon-registry.test.ts src/__tests__/integration/server/runtime-hosts.test.ts src/__tests__/integration/tui/ask-cli.test.tsyarn buildyarn test:browser-integration:v2npm link, then run the linked bin or/Users/roackb2/.asdf/installs/nodejs/22.21.1/bin/heddle --versionManual verification focus
~/.heddle/daemon-registry.json: it should contain a top-levelserver; the current Heddle workspace should be registered with a generatedworkspace-*id rather thandefaultdefaultidheddle asksends the cwd-derived workspace id with session list/create/prompt callschat-v2still passes its active workspace id separately from the resolved live server endpointheddlestill starts the current default chat path until the final cli-v2 default switch PR