fix(worktrees): route OpenCode calls through workspaces#521
Conversation
|
I want you to perform the gatekeeper checks for latest PR state check for regressions |
|
Gatekeeper review for latest PR state. Request understood: review PR #521 ruthlessly for regressions, implementation quality, and whether the fix should be implemented differently. Assumption: scope is the current single-commit PR diff against Findings: no blocking code findings found in the PR diff. Review notes:
Validation:
Residual risk:
Gatekeeper verdict: no code-quality blocker found. I would not request implementation changes for this diff, but I would want either CI typecheck confirmation or a clean local dependency install before merge, plus preferably a focused regression test for #518. -- |
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/26833236698 Artifacts expire in 7 days.
|
cbb0e22 to
b3594d2
Compare
|
PR is changed completely go through it again. check for regressions |
|
Gatekeeper review for the changed PR state. Request understood: the previous review is obsolete; review the current PR #521 diff against Findings:
Implementation review notes:
Validation:
Gatekeeper verdict: do not merge yet. The workspace-routing approach is directionally plausible, but the file browser save path is currently inconsistent with the new read routing and can write to the wrong directory for non-root worktrees. -- |
4111d14 to
0d24ce9
Compare
|
Check now |
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/26845457913 Artifacts expire in 7 days.
|
|
Re-check for latest PR state after the file-save fix. Request understood: verify the previous blocker and run another gatekeeper pass on the current PR state. Assumption: scope is the latest local PR head Findings: no blocking findings found in this pass. What changed relative to the previous blocker:
Gatekeeper assessment:
Validation:
Verdict: the previously blocking file-save issue is resolved. I would still require CI or a clean dependency-installed typecheck before merge, but I do not have a remaining code-level blocker from this re-check. -- |
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/26845817287 Artifacts expire in 7 days.
|
1 similar comment
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/26845817287 Artifacts expire in 7 days.
|
0d24ce9 to
754fd9f
Compare
Migrate CodeNomad worktree execution from per-worktree OpenCode proxy clients and x-opencode-directory headers to OpenCode experimental workspace routing. OpenCode is now started with OPENCODE_EXPERIMENTAL_WORKSPACES=true and the root instance proxy path. The UI syncs OpenCode workspaces after worktree hydration and maps CodeNomad worktree slugs to OpenCode workspace IDs. Session, file, git status, permission, and question calls now use the root OpenCode client and pass the resolved workspace ID when the active session belongs to a worktree. Worktree metadata updates also use the root client. The obsolete worktree instance proxy routes, directory override handling, and x-opencode-directory forwarding were removed so existing-session routing no longer depends on stale directory headers. Validated with npm run typecheck --workspace @codenomad/ui, npm run typecheck --workspace @neuralnomads/codenomad, and git diff --check.
754fd9f to
c51dfd4
Compare
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/26902083433 Artifacts expire in 7 days.
|
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/26902427539 Artifacts expire in 7 days.
|
…ions, safer settings, more languages and smoother desktop performance (#534) ## Thanks for contributions - [@pascalandr](https://github.com/pascalandr): [#242](#242), [#340](#340), [#357](#357), [#406](#406), [#407](#407), [#458](#458), [#472](#472), [#501](#501), [#513](#513), [#528](#528), [#531](#531) - [@OfflinePing](https://github.com/OfflinePing): [#413](#413), [#497](#497), [#498](#498), [#499](#499) - [@omercnet](https://github.com/omercnet): [#459](#459), [#466](#466), [#512](#512) - [@VooDisss](https://github.com/VooDisss): [#493](#493), [#511](#511) - [@JDis03](https://github.com/JDis03): [#481](#481), [#519](#519) - [@bluelovers](https://github.com/bluelovers): [#278](#278), [#284](#284) - [@aayurt](https://github.com/aayurt): [#523](#523) - [@MusiCode1](https://github.com/MusiCode1): [#388](#388) - [@jollyxenon](https://github.com/jollyxenon): [#439](#439) ## Highlights - **Provider setup is easier from the model selector**: Manage provider authentication directly from the place where you choose models, with provider settings scoped to the current CodeNomad instance. - **Settings are more useful and transparent**: A new Info section shows version, runtime, and diagnostic details, and a new global config editor makes it easier to inspect and update CodeNomad/OpenCode configuration without leaving the app. - **Sessions load faster and are easier to find**: Session history now supports progressive loading, server-side search, and stronger workspace scoping, making large workspaces feel much more responsive. - **Workspace names are customizable**: Give workspaces friendlier names so multi-project and multi-instance setups are easier to recognize. - **Desktop event handling is faster and more reliable**: Tauri desktop builds now use a Rust-native event transport for better performance and fewer moving parts during live session updates. - **More languages are available**: German and Nepali localization support was added, and Hebrew translation coverage was improved. ## What’s Improved - **Better chat readability**: Pasted text can collapse in chat history, session titles now appear in the header bar, and message timing metrics make it easier to understand how long responses take. - **More flexible composer experience**: The session composer can now be resized, making long prompts and detailed instructions easier to work with. - **Safer environment variable editing**: Environment variable values are hidden and password-style inputs are masked, reducing the chance of exposing sensitive values on screen. - **Better permission feedback**: Permission requests now show clearer rejection feedback, and YOLO mode behavior is shared more consistently across related session flows. - **More helpful notifications and logs**: Toast notification history and server log access were improved so important events are easier to revisit after they disappear. - **Cleaner status panels**: Status panel sections can now collapse, making dense side-panel information easier to scan. - **Smaller desktop packages**: Electron package size was reduced, making downloads and installs lighter. ## Fixes - **More reliable live updates**: SSE pong retry logic and message-load retry handling were tightened to avoid connection issues and runaway retry loops. - **Smoother scrolling while sessions stream**: Virtual follow/autoscroll behavior is more stable, so active conversations should jump around less while new content arrives. - **Better OpenCode SDK compatibility**: CodeNomad now supports OpenCode SDK 1.16 runtime APIs. - **More reliable worktree behavior**: Worktree mappings now live in session metadata, and OpenCode calls are routed through workspaces more consistently. - **Better draft prompt handling**: Draft prompt command sessions are supported more reliably, and switching focus between tabs no longer accidentally clears prompts. - **Improved mobile usability**: Instance and project tabs remain tappable while the session drawer is open, and the folder home screen behaves better on small mobile viewports. - **Improved Linux browser launching**: Linux browser launch detection now checks more common browser candidates. - **Better plugin handling**: Plugin base URLs work better with host binding, and tuple-style plugin metadata is supported. - **Markdown rendering polish**: Horizontal rules now render correctly in markdown content. - **Simpler session diff UI**: The session diff right-drawer flow was removed to reduce UI complexity and avoid confusing side-panel behavior. ## Docs - **Contributor architecture guide added**: A CodeNomad architecture guide skill was added to help contributors understand the project structure and key integration patterns. - **Quick-start guidance improved**: Authentication requirements and self-signed certificate warnings were added to the quick-start docs. - **Release automation documented**: Winget release automation docs and workflow support were added. ### Contributors - [@shantur](https://github.com/shantur) - [@pascalandr](https://github.com/pascalandr) - [@OfflinePing](https://github.com/OfflinePing) - [@omercnet](https://github.com/omercnet) - [@JDis03](https://github.com/JDis03) - [@VooDisss](https://github.com/VooDisss) - [@bluelovers](https://github.com/bluelovers) - [@aayurt](https://github.com/aayurt) - [@MusiCode1](https://github.com/MusiCode1) - [@jollyxenon](https://github.com/jollyxenon) **Full Changelog**: [v0.16.0...v0.17.0](v0.16.0...v0.17.0) ## Merged Pull Requests ### [@shantur](https://github.com/shantur) - PR [#446](#446) “fix(ui): support draft prompt command sessions” - PR [#452](#452) “fix(ui): keep home actions visible on short viewports” - PR [#453](#453) “Reduce Electron package size” - PR [#476](#476) “feat(ui): add instance-scoped provider manager from model selector” - PR [#477](#477) “Add global config file editor” - PR [#514](#514) “Migrate worktree mappings to session metadata” - PR [#521](#521) “fix(worktrees): route OpenCode calls through workspaces” - PR [#522](#522) “feat(ui): support custom workspace names” - PR [#526](#526) “Support OpenCode SDK 1.16 runtime APIs” - PR [#529](#529) “fix(ui): stop message load retry loop” - PR [#532](#532) “fix(ui): remove session diff right drawer flow” ### [@pascalandr](https://github.com/pascalandr) - PR [#242](#242) “perf(tauri): Rust-native desktop event transport” - PR [#340](#340) “feat(ui): show the session title in the header bar” - PR [#357](#357) “feat(ui): add message timing metrics” - PR [#406](#406) “fix(ui): stabilize virtual follow autoscroll” - PR [#407](#407) “feat(ui): collapse pasted text in chat history” - PR [#458](#458) “fix(ui): allow status panel sections to collapse” - PR [#472](#472) “revert: remove tracked NomadWorks repo state” - PR [#501](#501) “fix(ui): support tuple plugin metadata” - PR [#513](#513) “chore: TASK-075 automate Winget updates on release” - PR [#528](#528) “fix(ui): scope primary agent selector to selectable agents” - PR [#531](#531) “revert: remove tracked NomadWorks task artifacts” ### [@OfflinePing](https://github.com/OfflinePing) - PR [#413](#413) “feat(settings): add Info section with version, runtime, and diagnostics” - PR [#497](#497) “Share YOLO mode across session families” - PR [#498](#498) “fix(ui): render markdown horizontal rules” - PR [#499](#499) “Add reject feedback to permission UI” ### [@omercnet](https://github.com/omercnet) - PR [#459](#459) “fix(mobile): tappable instance/project tab bar while session drawer is open” - PR [#466](#466) “ci: increase comment-pr-artifacts polling timeout” - PR [#512](#512) “fix: handle plugin base URL for host binding” ### [@VooDisss](https://github.com/VooDisss) - PR [#493](#493) “feat: add CodeNomad architecture guide skill for contributors” - PR [#511](#511) “feat(sessions): progressive loading, server-side search, and workspace scoping” ### [@JDis03](https://github.com/JDis03) - PR [#481](#481) “docs: add auth requirement and self-signed cert warning to quick-start” - PR [#519](#519) “fix(ui): add retry logic to SSE pong to improve connection resilience” ### [@bluelovers](https://github.com/bluelovers) - PR [#278](#278) “feat(ui): Toast Notification History & Server Logs Enhancements” - PR [#284](#284) “fix(ui): hide environment variable values and mask inputs as password” ### [@aayurt](https://github.com/aayurt) - PR [#523](#523) “Add German and Nepali Localizations” ### [@MusiCode1](https://github.com/MusiCode1) - PR [#388](#388) “Update Hebrew translation coverage” ### [@jollyxenon](https://github.com/jollyxenon) - PR [#439](#439) “feat(ui): add resizable session composer”
Summary
This fixes #518 by moving CodeNomad worktree execution from directory-header routing to OpenCode experimental workspace routing.
OpenCode changed existing-session routing so session routes can prefer the session's stored directory over
x-opencode-directory. That made the old CodeNomad worktree proxy model unreliable for sessions that should execute in a worktree. This PR switches CodeNomad to resolve an OpenCode workspace ID for each CodeNomad worktree and pass that workspace ID on worktree-scoped OpenCode calls.What changed
OPENCODE_EXPERIMENTAL_WORKSPACES=true./workspaces/:id/worktrees/root/instanceto/workspaces/:id/instance.packages/ui/src/stores/opencode-client.ts.packages/ui/src/stores/opencode-workspaces.ts.workspace.idvalues discovered byexperimental.workspace.syncListandexperimental.workspace.list.workspacepayloads where the active session/worktree requires it.Review fix
worktreequery parameter.worktreeSlugForViewer(), and the server resolves that slug to the same worktree directory used by local git worktree APIs before writing.Removed old routing
/workspaces/:id/worktrees/:slug/instanceOpenCode proxy routes./__dir/<encoded>.x-opencode-directory.x-opencode-directoryheader.getOrCreateWorktreeClient,getOrCreateWorktreeClientWithDirectoryOverride, and worktree proxy path helpers from the UI worktree store.sdkManager.createClientbecause clients are no longer keyed by worktree slug.Why this fixes #518
Worktree sessions can now stay visible under the root project session listing while worktree execution is selected through OpenCode's workspace routing model. CodeNomad no longer depends on
x-opencode-directoryto override existing session directories, so sessions should not disappear from the root-directory list or execute in the wrong directory because of stale session directory fallback behavior.Fixes #518
Validation
npm run typecheck --workspace @codenomad/uinpm run typecheck --workspace @neuralnomads/codenomadgit diff --checkNotes
Some touched files are already oversized and were not refactored as part of this migration:
packages/server/src/server/http-server.ts,packages/ui/src/stores/instances.ts,packages/ui/src/stores/session-api.ts,packages/ui/src/stores/session-state.ts,packages/ui/src/components/instance/shell/right-panel/RightPanel.tsx,packages/ui/src/stores/session-events.ts, andpackages/server/src/background-processes/manager.ts.