Skip to content

feat(hosts): enable daemon-owned remote workspace features - #391

Merged
andrebrait merged 1 commit into
ompweb-dev:mainfrom
andrebrait:feature/388-remote-workspaces
Nov 5, 2026
Merged

andrebrait merged 1 commit into
ompweb-dev:mainfrom
andrebrait:feature/388-remote-workspaces

Conversation

@andrebrait

Copy link
Copy Markdown
Collaborator

Summary

Implements sub-project 2 of #388; the tracking issue remains open for configuration, archive, search, usage and import parity.

  • Route Explorer, previews, downloads/ranges, file search, referenced shell output and live watches through the owning daemon, including This machine. No direct-local fallback.
  • Reuse the existing staged uploader for Explorer: 2 GiB per file, no legacy 25 MiB/file or 100 MiB/batch multipart cap. Preserve conflict choices, safe replacement and receipt replay. Preview/search limits stay separate and unchanged.
  • Retain host/cwd/session ownership in tabs, relative links, images, downloads, suggestions and agent file-open confirmations; fence stale responses and pending actions.
  • Run Git status/diffs/GitHub lookup and worktree create/select/remove on that host, preserving dirty-removal confirmation and host-local grants.
  • Enable host-owned directory navigation, default workspaces and HTTPS/SSH clone jobs with bounded progress, cancellation-confirmed process exit, safe cleanup and explicit uncertain outcomes.

Workspace capabilities are additive; link protocol remains v6 with minimum v4. Older daemons receive an upgrade explanation rather than a filesystem fallback. No new dependency.

Verification

  • npm run typecheck && npm run lint && npm test && npm run build && npm run smoke passed on 52d28932: 2,539 passed, 12 skipped, 0 failed, 255 test files. Lint has only the 7 existing hook warnings; build retains existing locale-key/highlight warnings.
  • bun scripts/build-binary.ts --target bun-linux-x64 and env -u OMP_WEB_PACKAGE_DIR npm run smoke -- --binary release/ompweb-linux-x64/ompweb passed. The unset prevents an inherited installed-release asset-root override from contaminating the binary smoke.
  • Actual browser + Node daemons in separate filesystem namespaces: identical absolute paths with distinct contents; owner-preserving tabs/links/images/downloads/suggestions; four local/remote × WS/SSE 108 MiB upload batches, with all eight 54 MiB destination SHA-256 digests matching.
  • Actual Node cross-device publication: staging on /dev/shm, destination on another device, streamed 8 MiB digest/size verified. Sparse 2 GiB acceptance and +1 refusal tested without whole-file allocation.
  • Real Git status/diff/worktree create/select/dirty-force removal; real HTTPS clone success and cancellation on both hosts; controlled real child survived a fresh web-process replacement. Replacement-daemon unknown jobs did not report success.
  • Main/browser stayed running during 4.5-second daemon-only outages in both WS and SSE: viewer refreshed missed bytes and received later saves. Actual upgrade-error presentation checked in Git and Worktrees.

One condensed adversarial review was completed. Its publication/cancellation races, watch recovery, UNC handling, HTTP reconciliation, upgrade messaging and bounded-log findings were fixed with failing-before/passing-after regressions, followed by the full gates above. Generated Graphify output is updated by the repository hooks.

Limits and delivery

  • This is one complete workspace cutover PR rather than three dependent stack branches.
  • No live Windows host and no actual 2 GiB network transfer were exercised; deterministic path/UNC and sparse-boundary coverage are included.
  • Safe no-clobber publication fails closed on filesystems without the required atomic link operation. A cleanup race preserves captured replacement data in private quarantine and reports its recovery location. An abrupt death before the prepared upload receipt can leave a private sibling requiring manual removal.
  • No production service was restarted, and nothing was merged or deployed.

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 103 files, which is 3 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

Check out review usage here.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f6b5a6f8-6920-460a-9e97-b183b8f204e1
Commits

Reviewing files that changed from the base of the PR and between a1cf666 and 64ca9a8.

Files selected for processing: 103

  • AGENTS.md
  • CHANGELOG.md
  • README.ja.md
  • README.md
  • README.zh-CN.md
  • app/api/agent/[id]/bash-output/route.ts
  • app/api/cwd/browse/route.ts
  • app/api/cwd/validate/route.ts
  • app/api/default-cwd/route.ts
  • app/api/file-index/route.ts
  • app/api/files/[...path]/route.ts
  • app/api/git/diff/route.ts
  • app/api/git/status/route.ts
  • app/api/github-repo/route.ts
  • app/api/home/route.ts
  • app/api/projects/clone/route.ts
  • app/api/worktrees/route.ts
  • components/AppShell.test.mjs
  • components/AppShell.tsx
  • components/ChatInput.host-files.test.mjs
  • components/ChatInput.tsx
  • components/ChatWindow.tsx
  • components/DirectoryPicker.tsx
  • components/FileExplorer.hosts.test.mjs
  • components/FileExplorer.tsx
  • components/FileExplorer.uploads.test.mjs
  • components/FileViewer.hosts.test.mjs
  • components/FileViewer.markdown-links.test.mjs
  • components/FileViewer.tsx
  • components/GitChangesPanel.hosts.test.mjs
  • components/GitChangesPanel.tsx
  • components/MarkdownBody.tsx
  • components/MessageView.tsx
  • components/RightPanel.tsx
  • components/SessionSidebar-helpers.ts
  • components/SessionSidebar.tsx
  • components/TabBar.tsx
  • components/WorkspaceUpgrade.test.mjs
  • components/WorktreesPanel.tsx
  • docs/plans/2026-11-03-remote-workspaces.md
  • docs/specs/2026-11-03-remote-workspaces-design.md
  • graphify-out/graph.json
  • hooks/useAgentSession.ts
  • lib/api-utils.ts
  • lib/event-stream-hub.test.mjs
  • lib/event-stream-hub.ts
  • lib/event-stream-protocol.ts
  • lib/event-stream-worker.test.mjs
  • lib/event-stream-worker.ts
  • lib/file-access.test.mjs
  • lib/file-authorization.ts
  • lib/file-dirent.ts
  • lib/file-index-route.test.mjs
  • lib/file-index.ts
  • lib/file-links.ts
  • lib/file-paths.ts
  • lib/file-types.ts
  • lib/files-list-hidden.test.mjs
  • lib/git-clone.test.mjs
  • lib/git-clone.ts
  • lib/hosts/daemon.ts
  • lib/hosts/host.ts
  • lib/hosts/hub.ts
  • lib/hosts/link-driver.test-helper.mjs
  • lib/hosts/link-protocol.ts
  • lib/hosts/local-host.ts
  • lib/hosts/session-ops.ts
  • lib/hosts/update-worker.ts
  • lib/hosts/update-worker.windows.test.mjs
  • lib/hosts/uploads.ts
  • lib/hosts/workspace-clone.test.mjs
  • lib/hosts/workspace-clone.ts
  • lib/hosts/workspace-directories.test.mjs
  • lib/hosts/workspace-files.integration.test.mjs
  • lib/hosts/workspace-git.test.mjs
  • lib/hosts/workspace-ops.ts
  • lib/hosts/workspace-reads.test.mjs
  • lib/hosts/workspace-reads.ts
  • lib/hosts/workspace-results.ts
  • lib/hosts/workspace-roots.test.mjs
  • lib/hosts/workspace-roots.ts
  • lib/hosts/workspace-test-helper.mjs
  • lib/hosts/workspace-unc.test.mjs
  • lib/hosts/workspace-upload-http.test.mjs
  • lib/hosts/workspace-upload.test.mjs
  • lib/hosts/workspace-watch.test.mjs
  • lib/hosts/workspace-watch.ts
  • lib/hosts/workspace-worktrees.integration.test.mjs
  • lib/i18n/locales/en.json
  • lib/i18n/locales/ja.json
  • lib/i18n/locales/zh-CN.json
  • lib/initial-navigation.test.mjs
  • lib/initial-navigation.ts
  • lib/rpc-manager.test.mjs
  • lib/rpc-manager.ts
  • lib/types.ts
  • lib/uploads.test.mjs
  • lib/uploads.ts
  • lib/workspace-file-context.ts
  • lib/workspace-http.ts
  • lib/workspace-types.ts
  • lib/worktree.ts
  • server/app.test.ts

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@kilo-code-bot

kilo-code-bot Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Code Review Roast 🔥

Verdict: No Issues Found | Recommendation: Merge

Reviewed the incremental changes since 3723d50 (5 files, focused on hooks/useAgentSession.ts run/compaction attachment and its RPC tests). I went in expecting the usual “async state machine held together by hope and setTimeout” — and instead found generation guards, blocked/covered checks, and tests that actually try to make stale lookups misbehave. Rude.

📊 Overall: The race conditions brought receipts, the refs brought receipts, and the only thing left hanging was my skepticism. Clean incremental cut.

Previous Review Summaries (3 snapshots, latest commit 3723d50)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 3723d50)

Verdict: No Issues Found | Recommendation: Merge

Oh wait, this PR is actually clean too. I need to sit down. I had my flamethrower warmed up and everything.

Six review shards combed every changed source line across uploads/workspace publication, worktrees/clones, RPC/session/types, server routes, components/hooks, and the event stream/file layer. Zero high-confidence defects found on changed lines.

📊 Overall: Like finding a unicorn in production — I didn't think clean PRs existed anymore, but here we are.

Files Reviewed (~100 files)
  • AGENTS.md
  • CHANGELOG.md
  • README.ja.md
  • README.md
  • README.zh-CN.md
  • app/api/agent/[id]/bash-output/route.ts
  • app/api/cwd/browse/route.ts
  • app/api/cwd/validate/route.ts
  • app/api/default-cwd/route.ts
  • app/api/file-index/route.ts
  • app/api/files/[...path]/route.ts
  • app/api/git/diff/route.ts
  • app/api/git/status/route.ts
  • app/api/github-repo/route.ts
  • app/api/home/route.ts
  • app/api/projects/clone/route.ts
  • app/api/worktrees/route.ts
  • components/AppShell.test.mjs
  • components/AppShell.tsx
  • components/ChatInput.host-files.test.mjs
  • components/ChatInput.tsx
  • components/ChatWindow.tsx
  • components/DirectoryPicker.tsx
  • components/FileExplorer.hosts.test.mjs
  • components/FileExplorer.tsx
  • components/FileExplorer.uploads.test.mjs
  • components/FileViewer.hosts.test.mjs
  • components/FileViewer.markdown-links.test.mjs
  • components/FileViewer.tsx
  • components/GitChangesPanel.hosts.test.mjs
  • components/GitChangesPanel.tsx
  • components/MarkdownBody.tsx
  • components/MessageView.tsx
  • components/RightPanel.tsx
  • components/SessionSidebar-helpers.ts
  • components/SessionSidebar.tsx
  • components/TabBar.tsx
  • components/WorkspaceUpgrade.test.mjs
  • components/WorktreesPanel.tsx
  • docs/plans/2026-11-03-remote-workspaces.md
  • docs/specs/2026-11-03-remote-workspaces-design.md
  • graphify-out/graph.json
  • hooks/useAgentSession.ts
  • lib/api-utils.ts
  • lib/event-stream-hub.test.mjs
  • lib/event-stream-hub.ts
  • lib/event-stream-protocol.ts
  • lib/event-stream-worker.test.mjs
  • lib/event-stream-worker.ts
  • lib/file-access.test.mjs
  • lib/file-authorization.ts
  • lib/file-dirent.ts
  • lib/file-index-route.test.mjs
  • lib/file-index.ts
  • lib/file-links.ts
  • lib/file-paths.ts
  • lib/file-types.ts
  • lib/files-list-hidden.test.mjs
  • lib/git-clone.test.mjs
  • lib/git-clone.ts
  • lib/hosts/daemon.ts
  • lib/hosts/host.ts
  • lib/hosts/hub.ts
  • lib/hosts/link-driver.test-helper.mjs
  • lib/hosts/link-protocol.ts
  • lib/hosts/local-host.ts
  • lib/hosts/session-ops.ts
  • lib/hosts/update-worker.ts
  • lib/hosts/update-worker.windows.test.mjs
  • lib/hosts/uploads.ts
  • lib/hosts/workspace-clone.test.mjs
  • lib/hosts/workspace-clone.ts
  • lib/hosts/workspace-directories.test.mjs
  • lib/hosts/workspace-files.integration.test.mjs
  • lib/hosts/workspace-git.test.mjs
  • lib/hosts/workspace-ops.ts
  • lib/hosts/workspace-reads.test.mjs
  • lib/hosts/workspace-reads.ts
  • lib/hosts/workspace-results.ts
  • lib/hosts/workspace-roots.test.mjs
  • lib/hosts/workspace-roots.ts
  • lib/hosts/workspace-test-helper.mjs
  • lib/hosts/workspace-unc.test.mjs
  • lib/hosts/workspace-upload-http.test.mjs
  • lib/hosts/workspace-upload.test.mjs
  • lib/hosts/workspace-watch.test.mjs
  • lib/hosts/workspace-watch.ts
  • lib/hosts/workspace-worktrees.integration.test.mjs
  • lib/i18n/locales/en.json
  • lib/i18n/locales/ja.json
  • lib/i18n/locales/zh-CN.json
  • lib/initial-navigation.test.mjs
  • lib/initial-navigation.ts
  • lib/rpc-manager.test.mjs
  • lib/rpc-manager.ts
  • lib/types.ts
  • lib/uploads.test.mjs
  • lib/uploads.ts
  • lib/workspace-file-context.ts
  • lib/workspace-http.ts
  • lib/workspace-types.ts
  • lib/worktree.ts
  • server/app.test.ts
  • server/client-env.test.ts
  • server/client-env.ts
  • server/dev.test.ts
  • server/dev.ts
  • server/http.test.ts
  • server/http.ts

Previous review (commit 8ba5071)

Verdict: No Issues Found | Recommendation: Merge

Oh wait, incremental changes are actually clean too. I need to sit down. I had my flamethrower warmed up and everything.

📊 Overall: Like finding a unicorn in production — I didn't think clean PRs existed anymore, but here we are.

Files Reviewed (8 files)
  • CHANGELOG.md
  • graphify-out/graph.json
  • lib/hosts/update-worker.ts
  • lib/hosts/update-worker.windows.test.mjs
  • lib/hosts/workspace-directories.test.mjs
  • lib/hosts/workspace-git.test.mjs
  • lib/hosts/workspace-test-helper.mjs
  • lib/hosts/workspace-worktrees.integration.test.mjs

Previous review (commit 52d2893)

Verdict: No Issues Found | Recommendation: Merge

Oh wait, this PR is actually clean. I need to sit down. I had my flamethrower warmed up and everything.

📊 Overall: Like finding a unicorn in production — I didn't think clean PRs existed anymore, but here we are.

Files Reviewed (101 files)
  • Reviewed changed files across hosts, uploads, workspace ops, watches, and UI.

Reviewed by free · Input: 68K · Output: 2.8K · Cached: 279.6K

@andrebrait

Copy link
Copy Markdown
Collaborator Author

Pushed 8ba5071 to address the Windows CI failures. The workspace harness canonicalizes its temporary root before deriving daemon paths, request fixtures use platform-aware segments/native joins, and the Git escape test uses a real outside-workspace file instead of /etc/passwd. The Windows-only process inventory deadline is now 20 seconds; POSIX remains at 5 seconds, and the 8 MiB bound, fail-closed behavior, planner check and both pre-stop worker checks remain unchanged. A new slow-inventory regression failed before the fix and passes afterward, covering private, shared, failed and malformed inventories. Verification: 2,540 passed, 12 skipped, zero failures across 256 files; typecheck, lint, build and source smoke passed. Existing seven hook warnings and build warnings remain. Also passed 11 real-daemon workspace integration tests and three with an aliased temporary root. One condensed adversarial review found no should-fix issues. The original Windows catch hides the precise inventory error, so timeout causation remains an inference until native Windows CI confirms this candidate fix. No checks were skipped or weakened. Nothing merged or deployed.

@andrebrait

Copy link
Copy Markdown
Collaborator Author

Updated the PR with current main (dc48126) in 439292f, preserving the published commit history. The only textual conflict was additive CHANGELOG entries; both were retained. Reviewed the automatic source merges. The combined tree passed typecheck, lint, 2,577 tests (12 skipped, zero failed; 258 files), client build and source smoke. Current-head native CI is still required before merge; the prior head had no Verify results because the PR conflicted with main. CodeRabbit remains unavailable due its file/capacity limit. Codex will be requested after CI is green. The user has authorized a squash merge once the current-head gates are satisfied. No deployment is requested.

@kahme247 kahme247 added the needs rebase Rebase onto current main; needs re-review label Nov 5, 2026
@andrebrait
andrebrait force-pushed the feature/388-remote-workspaces branch from 439292f to 3723d50 Compare November 5, 2026 14:34
@andrebrait

andrebrait commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator Author

Rebased onto current main (53697ad) as a single commit, 3723d50. This PR was already written against the Bun server and host-daemon architecture (its previous base, dc48126, includes it): every workspace operation goes through the owning ompweb host daemon, including This machine.

Conflicts resolved:

  • lib/file-authorization.ts: kept main's symlink-aware isOmpSecretFile check and dropped this PR's older config-root realpath check it supersedes; the daemon still passes its own allowed roots explicitly.
  • components/ChatInput.tsx: kept main's auto-retry countdown alongside the host-keyed file-suggestion state.
  • CHANGELOG.md: kept both sides.
  • main's new credential-file tests now pass their roots to authorizeFileAccess, matching the daemon-side signature.

Local verification on 3723d50: typecheck, lint (existing 7 warnings), 2,604 tests passed (12 skipped, 0 failed), build and source smoke. I will request re-review once CI is green.

@kahme247 kahme247 removed the needs rebase Rebase onto current main; needs re-review label Nov 5, 2026
@andrebrait

Copy link
Copy Markdown
Collaborator Author

@codex review

@andrebrait

Copy link
Copy Markdown
Collaborator Author

@kahme247 CI is green on the rebased head 3723d50 (Ubuntu and Windows). Ready for re-review.

@andrebrait
andrebrait requested a review from kahme247 November 5, 2026 14:45
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-05T15:14:52.364940Z
We couldn’t complete this review. Comment @codex review to try again.
3723d50 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Failed to sample tokens
ℹ️ 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".

@andrebrait

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Failed to sample tokens
ℹ️ 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".

Route Explorer, previews, downloads, file search, live watches, Git, worktrees, directory browsing and clone jobs through the owning host daemon, including this machine. Explorer uploads reuse the 2 GiB staged uploader. Rebased onto main 53697ad: file authorization keeps main's symlink-aware omp secret check and takes the daemon's allowed roots explicitly.
@andrebrait
andrebrait force-pushed the feature/388-remote-workspaces branch from 3723d50 to 64ca9a8 Compare November 5, 2026 16:43
@andrebrait

Copy link
Copy Markdown
Collaborator Author

Rebased onto latest main a1cf666 as 64ca9a8, preserving the new open-chat run-attachment behavior from #390. A fresh condensed integration review covered all 103 changed files and found no should-fix issues, including daemon-owned authorization roots, main’s symlink-aware credential protection, host-scoped attachments/suggestions, retry countdown and run attachment. Range-diff confirms the feature patch is equivalent across the latest rebase. Local gates passed: typecheck, lint (7 existing warnings), 2,634 tests (12 skipped, zero failed), client build and source smoke. Awaiting fresh Ubuntu/Windows CI on 64ca9a8 before a SHA-pinned squash merge. CodeRabbit remains unavailable under its file/capacity limit; Codex failed twice with Failed to sample tokens and produced no completed review. No deployment.

@andrebrait
andrebrait merged commit 986764e into ompweb-dev:main Nov 5, 2026
4 checks passed
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.

2 participants