Additional

Browser application preview

Synced from github.com/CoWork-OS/CoWork-OS/docs

The browser application serves the desktop app to a web browser. It is off by default and still a preview: not every desktop workflow has been reviewed for the browser (see Web capability matrix).

In the desktop app, turn it on in Settings > Web Access: enable Web Access, then Full app in the browser. A headless host turns it on with COWORK_WEB_ENABLED=1, which still works on desktop too. Its routes live on the Control Plane listener at /app/ and, in desktop mode, on the Web Access listener at /app/. Without a public address, the deployment policy accepts only a loopback listener and loopback Host header. The native Control Plane protocol and existing Web Access bearer-token API retain their own authentication.

Opening it

  • Desktop: Settings > Web Access > Open in browser opens the app signed in. Copy sign-in link copies a link for another browser. On Linux, where other local accounts can read a browser's command line, Open in browser copies the link instead of opening it.
  • Terminal: cowork web does the same through the Control Plane. cowork web link prints the link alone, cowork web status shows the address and how many browsers are signed in, and cowork web sign-out signs every browser out. On macOS the link reaches the browser through osascript on stdin, so it never appears on a command line; on Linux cowork web prints the link for you to open.

A sign-in link is the app's address with a one-use pairing code in the fragment: <origin>/app/#pair=<code>. Browsers never send the fragment to the server, and the page removes it from the address bar before redeeming it. The code works once and expires after 90 seconds.

Sign out all browsers in Settings, or cowork web sign-out, ends every browser session at once, and their sockets and terminals close with them. Turning the app off or changing its public address does the same.

A browser stays signed in across host restarts. How long depends on how it reaches the host:

  • Through the public HTTPS address (another device): signed out after 30 days without use, or 90 days after it signed in, whichever comes first.
  • On this computer (http://127.0.0.1): signed out after 30 minutes without use, or 24 hours after it signed in. Browsers send a cookie to every port of a host, so another local web server the browser visits is shown this one; a new link is one click away here.

Open a new link to sign in again. The host keeps only a hash of each session cookie, in its encrypted settings, so a copy of that store cannot be used to sign in. Everything else ends with the host process: after a restart an open tab reloads itself once (and stops after three reloads in a minute, leaving a Retry button), and file, artifact and terminal handles from before the restart no longer work. Restarting only the Web Access or Control Plane listener keeps sign-ins too. If the host cannot save a sign-out, Sign out all browsers says so instead of reporting success; sign out again before restarting. Signing out all browsers also forgets the sign-ins of a headless daemon sharing the same profile.

Other devices

Put an HTTPS proxy on the host computer in front of the Web Access listener, for example tailscale serve --bg 3847, and enter the proxy's address in Settings > Web Access > Public HTTPS address. The app then trusts only a proxy on this computer (127.0.0.1 and ::1), requires X-Forwarded-Proto: https and the original Host header, and sets __Host- session cookies. Use Copy sign-in link and open the link on the other device. While a public address is set, browsers on this computer use that address too.

COWORK_WEB_PUBLIC_ORIGIN and COWORK_WEB_TRUSTED_PROXY_ADDRESSES override the saved address, for proxies on another machine and for headless hosts.

When a task needs you

In a browser session the tab itself shows when tasks wait on you, so a background tab still says come back. Desktop is unchanged.

  • Tab title and icon: with tasks waiting, the title reads (2) CoWork OS and the tab icon gets a small dot. When a task starts waiting while you are in another tab or app, the title also alternates once a second with the reason, such as Approval needed · CoWork OS for one new task or Needs you · CoWork OS for several. It stops alternating when you come back, so a task you have already seen and left waiting keeps the count and the dot but doesn't flash. It never alternates when the system asks for reduced motion. The count is the sessions blocked on you (approvals, questions and waiting sessions), not every item in Today. Title and icon return to normal when nothing waits.
  • Browser notifications (opt in): open the bell and choose Turn on under Browser notifications. The browser asks for permission only then, never on load, and a first notification confirms it works. The choice is kept in this browser, not on the host. While you are away from the tab, the app shows a system notification for the same notifications the desktop app alerts on (approvals, questions, pauses that need you, scheduled runs, bot deliveries; an ordinary task finishing does not alert). Clicking one focuses the tab and opens what the bell would open. The text is cut to about 140 characters because it can show on a lock screen.

Limits: notifications need HTTPS or localhost; a plain http:// LAN address can't use them, so open the app through its public HTTPS address. They arrive only while a tab of the app is open (closed tabs get no push), and the feed is polled, so one can arrive a few seconds late. Phones mostly can't use them: iOS Safari doesn't offer notifications to a page outside a home-screen app, and Chrome on Android only lets a service worker show them, which the app doesn't have. The bell says so in both cases; the tab title and icon still work there. If the browser's site settings block notifications, the bell says so; allow them there and reopen the bell.

Desktop isolation and local builds

The browser preview must preserve native desktop UI and behavior. Its approval explanation, unavailable-action presentation, sidebar adjustments and browser draft recovery belong only to browser clients. They must not be enabled in desktop merely because COWORK_WEB_ENABLED=1 is set. That environment variable controls host routes; the browser renderer has a separate explicit identity.

An approval explanation in the desktop composer was an unintended shared-component regression. The local correction hides it on desktop without changing approval settings. Related desktop sidebar, composer structure, draft and feedback behavior were restored. This is not a claim that all shared runtime changes have been audited.

Updating a source checkout and rebuilding it changes the app launched from that checkout. It does not replace an installed application bundle. Identify the running process, checkout, profile and build before comparing desktop and browser results; preserve existing data and credentials. The browser QA profile is separate from the normal desktop profile.

Starting the preview

Build the assets with npm run build:web. For a disposable Node host, start node bin/coworkd-node.js --user-data-dir <disposable-dir> --enable-control-plane with COWORK_WEB_ENABLED=1. Its log reports the actual Control Plane address. From a trusted admin client, run cowork web link --url <ws-url> --token <control-plane-token> for a sign-in link, or node bin/coworkctl.js --url <ws-url> --token <control-plane-token> call web.pair for a bare one-use code to type at <http-url>/app/. Codes expire after 90 seconds. In desktop mode, the Web Access settings panel creates links and codes for its own listener. Codes and browser sessions are specific to one listener, profile, and host generation.

Remote exposure requires COWORK_WEB_PUBLIC_ORIGIN set to a canonical HTTPS origin and COWORK_WEB_TRUSTED_PROXY_ADDRESSES set to the exact address of the TLS-terminating proxy. Forward the original Host and X-Forwarded-Proto: https; route /app/ and /api/web/v1/ to the same host listener. Browser routes fail closed when the deployment policy does not match the listener and request. A proxy path prefix must rewrite to these host paths while preserving the same prefix on the client side.

The browser entry now mounts the same React App, styles, sidebar, home screen, composer, and task view used by the desktop application. Pairing and the browser transport initialize before the shared app loads. The browser host adapter provides authorized workspace/task reads and maps core task actions to browser host methods, including workspace changes, task resume, message/step feedback, and integration mentions. The host publishes a closed method manifest for settings, task rename/pin/archive/fork, project creation, managed agents, automations, Inbox, and device workflows. Forks require a readable, writable workspace and use replay-safe operation receipts; a stale side-chat fork is archived when the browser host lacks permanent task deletion. Shared navigation follows that manifest instead of a blanket browser lock. Opening a screen is not proof that all of its optional integrations are available. Canvas session restoration is skipped when the host does not expose the required methods, and the interactive Browser Workbench stays unavailable until a browser stream is provided. Configure a working model provider in AI & Models before expecting a task to run. The browser can edit provider settings and models; saved credentials are represented by presence flags, never returned to the browser. Provider saves send changed fields against an opaque host-generated revision, while credential replacements use a protected field and host-managed OAuth values and credential-presence flags stay read-only. A conflict asks the user to reload AI & Models before retrying. Focused host and bridge tests cover secret redaction, protected replacement, rejected unprotected or stale writes, revision refresh after success, and reload-before-retry behavior. Guardrail and permission-runtime reads, admin policy summaries, usage reports, user profile facts, and open commitments are served by the host; report reads enforce current workspace read access. Local model hardware detection and server start/stop controls remain desktop-only and explain that limitation in the settings UI. ChatGPT subscription sign-in now starts from the shared AI & Models screen: the host owns the OAuth flow and token persistence, while the browser receives a session-owned flow ID, authorization URL, expiry, and status. Complete the account login, or paste the complete localhost callback URL into that screen when the redirect cannot reach the host. Requests expire after fifteen minutes and can be cancelled. Storage refusal never reports a connected account; session revocation discards pending credentials. Other OAuth routes and native settings services still require their own adapters. The browser start/cancel path has passed source-checkout smoke; successful personal login, provider execution, and restart recovery remain acceptance gates. The notifications panel uses the host profile service and polls for changes while the paired app is mounted; reads and mutations are filtered through current workspace access. Mailbox and personality change subscriptions poll compact host state while a subscriber is mounted and stop when the view unsubscribes. Mission Control Teams remains disabled until its complete host service is available, and command-center summaries, planner settings, execution, run history, and core harness review data explain when host methods are absent. Session-wide auto-approval is held only in the current browser page and is not persisted to the host.

Composer drafts are stored locally for the host installation and profile. Mutations serialize across browser tabs using Web Locks; browsers without that facility receive an explicit draft-storage error. Attachment references are opaque, and a failed rekey restores attachment ownership before reporting failure.

Browser appearance and first-run display preferences are stored in the browser for that host profile. They do not change the host's desktop settings or grant host capabilities.

The host API supports pairing, workspace/task summaries, durable task submission with a stable browser request key, task cancellation with a durable receipt, follow-ups backed by a durable message receipt, committed task activity with older-page navigation, pending approval and structured-input decisions, workspace file transfer, task artifact downloads, bounded Git status and diff, selected-file stage/unstage, staged-only commits, and host terminal attachment for eligible workspaces. Git changes require the workspace's current write permission and an unchanged status revision; durable receipts reconcile retries after a lost reply. A task submission, cancellation, or follow-up whose reply is lost can be reconciled by its key. Approval/input decisions can also be checked against their durable outcome after an uncertain reply. Follow-up recovery marks terminal tasks with queued/started receipts for resume and replays a transcript-consumed message when the host stopped between snapshot persistence and receipt advancement. Focused tests cover those restart-state boundaries, including attachment restoration; real-model crash/restart acceptance remains open. Workspace downloads and uploads are capped at 64 MiB per file. Uploads create a new file only; an existing name returns a conflict. Browser file requests use current effective workspace permissions. Artifact downloads use short-lived, single-use handles with current permission checks. Terminal access rechecks the current task/workspace shell policy, retains bounded output for reconnect, and requires a writer attachment for input. The shared desktop terminal dock supports scoped tabs, input, output replay, resize, Stop, and Close. If the host has no configured model provider, the shared app links directly to AI & Models settings. Session-sharing and protected-credential administration remain native services. An attempted shared-app action without a browser host method now reports that it is unavailable in the browser session; it does not claim success or perform a host side effect. Some desktop-only or optional integrations remain unavailable in the browser.

Browser uploads also have durable cumulative budgets: 512 MiB and 2,048 files per workspace directory, 1 GiB and 4,096 files per profile, and 4 GiB and 8,192 files across profiles sharing a configured host data root. Admissions are limited to 60 per profile per minute, including failed attempts that reserved capacity. Every upload preserves at least 1 GiB of available space on its target filesystem, checked before admission, each write, and commit. Pending uploads reserve their declared size, or the full per-file limit for chunked bodies, before staging starts. A successful upload releases only its unused reservation; confirmed cleanup releases a failed upload's storage reservation. Existing-file conflicts are returned before quota admission, so attachment retry reconciliation remains available at the limit.

These budgets measure browser uploads since accounting was enabled. They survive host restarts, new browser sessions, workspace ID aliases, directory renames, and local deletion of uploaded files. Existing files are covered by the free-space check. Accounting lives in <host-data-root>/.cowork/policy/browser-upload-quota, outside browser upload authority. A crash retains uncertain reservations; a crash during a ledger transaction can also leave quota.lock, which blocks uploads instead of risking concurrent writers. For local recovery, stop every host using that data root, confirm no writer remains, back up quota.json, and remove only the abandoned lock. Retain the ledger unless a trusted local operator has reviewed and reclaimed the uploaded storage and explicitly intends to reset the cumulative budgets. Corrupt accounting must be restored from a valid backup or reviewed locally; it is never silently reset. The same configured data root is required for Electron and Node hosts to share a budget. Windows flushes the ledger file before atomic replacement; directory flushing and real Windows power-loss recovery remain unverified.

Use npm run qa:web:ui-smoke to drive pairing, shared navigation, all 26 Settings routes and supported secondary tabs, scheduled-task create/live-update/delete, queue-setting interaction/save/restore, project creation, agent save, notification read/clear, Git stage/commit, and capability-disabled Mission Control controls in a disposable browser. It verifies Usage Insights loads and unsupported Integrations/actions explain their unavailable state. It also fails if a tested route invokes a host method that the browser does not provide. It uses a locally available Chromium browser; set COWORK_WEB_UI_BROWSER_EXECUTABLE to select another executable. Run npm run qa:web:smoke for a disposable local host check of pairing, scoped file listing and transfer, Git status/diff/stage/commit replay, terminal detach and output replay, upload/no-overwrite, artifact download with one-use handle, project creation, message feedback persistence, task fork and side-chat replay, task cancellation and receipt replay, traversal denial, and logout. npm run release:smoke also installs the built npm tarball into a clean temporary project and runs that browser workflow through the installed Node daemon launcher. After npm run package:mac:unsigned (or signed macOS packaging), npm run qa:web:desktop-smoke starts the packaged Electron host in a disposable headless profile, pairs through the browser, and checks the packaged app assets and shared CoWork UI. These browser checks create disposable task records and an artifact file; they do not run a real model task or validate a visible native window. The Linux server package and daemon-health smoke passed, but pairing and the full browser workflow against that packaged Linux artifact remain unverified. Timeline replay begins with a bounded recent snapshot, pages older activity on request, and polls committed changes. The mutation journal retains 10,000 changes per task and signals an expired cursor so the client can resnapshot. The browser stores unresolved decision identifiers, but not structured-input answer text. Ordinary free-form task messages can contain user-provided secrets, so pair only trusted clients.

The shared composer now sends workspace-scoped visual attachment descriptors for new tasks and follow-ups. The host verifies the open file, declared size and media signature, captures its bytes, and persists a private copy rather than reopening a mutable workspace path during execution. A message accepts up to five files, with 25 MiB per image, 64 MiB per video and 128 MiB total; simultaneous captures are limited to 256 MiB. The disposable smoke checks an uploaded PNG's admission event, private receipt, hash and exact stored bytes. It does not prove model interpretation of the image. Follow-ups also carry validated integration mentions, assistant quotes and an expected turn; quoted event IDs must identify an assistant message in that task. Real-model turns and historical visual-context recovery still require acceptance checks.

Add tools and the Skill Store use host-backed catalog and status reads. Installed Feature Packs expose desired-state pack and skill toggles through the shared desktop service, with admin policy and quarantine checks. Installation, import and native settings actions require their own browser services. Desktop-only settings, voice capture, and media embedded in generated task artifacts remain separate delivery work. Workspace MP4, MOV, and WebM previews use short-lived session-bound URLs and authenticated byte-range requests; the host rechecks origin, pairing session, workspace permission, and file identity during playback. The interactive Browser Workbench requires the host to advertise browser.interactive; until a browser stream is available, its task action is disabled with the host's reason instead of mounting Electron-only controls. Text, raster-image, PDF, and supported workspace video previews are available; HTML and SVG download as attachments. Do not treat this preview as a complete browser task workflow or a release-quality remote deployment.

Task Queue settings use the same host queue manager as desktop. Writes require host-admin capability, accept only bounded concurrency and timeout values, and persist before applying runtime changes. The browser confirms saved values by reading them back. Failed or refused storage writes report an error and retain the previous runtime settings.

Workspace Memory settings now use the existing host memory services for settings, stats, recent/search/detail/timeline reads, deterministic pasted-text imports, imported-memory recall flags, and individually authorized deletion. The shared Memory screen also supports manual profile facts, relationship records, observation search/detail/timeline and metadata/privacy edits, and stored Chronicle observation summaries without local asset paths. Workspace reads require current read access; edits require write access; deletion requires delete access independently. Failed loads and edits display errors, and delayed settings/observation reads from a previous workspace are ignored. The disposable browser smoke verifies retention save/readback/restore, fact add/pin/delete, text-import persistence and its completion popup, and delayed workspace replies. Host acceptance also verifies observation edits, recall flags, denied deletion followed by authorized deletion in its disposable fixture. External memory setup, autonomy, Chronicle deletion and file imports remain unfinished browser engineering. Real-model recall after edits and memory reads under active streaming load remain unverified.

Pending memory write review uses bounded workspace reads and the existing host approval service. Approve requires current write permission, removal also requires delete permission, and external writes require automatic network access. Replay receives the effective workspace policy, including curated-file guards and archive mirroring restrictions. Reject requires write permission. Detail responses use redacted display records, including legacy summaries. The Memory settings no longer show a Pending Memory Writes card (the review queue is off unless COWORK_MEMORY_WRITE_APPROVAL_MODE is set); disposable host smoke verifies list/count/detail and repeated approval-operation reconciliation. External-provider execution, approvals generated by a real model task, and crash/restart acceptance remain open.

Observation Inspector Promote now calls the same curated-memory service as desktop. The Node daemon initializes that service before queue recovery. Promotion authorizes the stored observation's workspace and applies current filesystem read/write guards; unsuccessful writes display an error, while staged writes explicitly report that review is required. Wake-Up Layers uses the most recent task prompt/agent role, asynchronously prefetches local Box Brain recall, and guards workspace-file reads. Failed preview reads display an error. Browser acceptance imports a disposable memory, rebuilds metadata, searches/selects it, clicks Promote, confirms completion and verifies its title in .cowork/MEMORY.md. Host acceptance verifies promotion content and the layer preview payload. Review-required promotion, subsequent real-task injection and preview performance under active streaming remain unverified.

Workspace Kit status, initialization and project creation now use shared desktop templates, project-file helpers and default scheduling behavior. Browser status reads do not create lifecycle files. Filesystem guards bound reads to 2 MiB and enforce workspace scope, explicit denies and canonical paths, including revision history. The owner setup API can seed only the built-in policy templates; arbitrary policy writes remain protected. Scheduling refusals are reported rather than treated as successful initialization. Markdown indexing uses the same read guard. In the browser, Open USER.md, MEMORY.md and DESIGN.md use the existing file viewer; desktop retains its native open action. Browser smoke verifies Initialize, project-file persistence and USER.md viewing. Host smoke verifies repeated initialization leaves exactly three default jobs. Actual scheduled execution and recovery after a partial initialization remain unverified.

Choosing a host folder uses a host folder picker in place of the native folder dialog. The composer's folder menu, the Build panel's folder menu and the sidebar's New project dialog (Choose existing folder…) open it in browser sessions only; desktop keeps the native dialog. The picker starts at the host user's home folder, or where the current workspace lives. Its other starting points are the folders of existing workspaces the session can read, for workspaces outside the home folder. Use this folder returns the workspace that folder already is, or adds one with the same baseline as a browser-created project (read, write and network; no delete; commands left to access profiles). The browser names a folder by a starting point and folder names, never an absolute path, and the host re-checks it on every request. Dot folders (and ~/Library on macOS) are hidden unless Show hidden folders is on. The host never lists or accepts OS locations, .git, .cowork/policy or transcript folders, credential stores such as ~/.ssh, CoWork's own data folder, or links that lead outside the starting point. One listing returns at most 500 folders. MCP server paths and profile export or import still need the desktop app.

Checking shared controls

After rebuilding the host, reload /app/. A restarted host keeps browsers signed in, and an open tab reloads itself when it reconnects. Use a disposable profile for testing changes.

  1. Open Settings → AI & Models. Check the configured provider, choose a model, test its connection, and save. A real model task requires valid host credentials or a reachable local model.

  2. Open Notifications. Confirm host notices appear, use Mark all read, then Clear all. The browser only shows notices associated with readable workspaces.

  3. Use Projects → Add folder or project. Name a test project and confirm it appears as the current project; the host creates its directory. Open the dialog again and use Choose existing folder… to browse to a disposable folder, then Use this folder, and confirm it becomes the current project. Choosing the same folder again must reopen that project rather than add a second one.

  4. Open Agents → Create agent → Start blank. Edit the name, save, reopen, and confirm the saved values.

  5. Open Automations. Verify the Library and Builder load, save a draft in the test project, and reload to confirm it persists. In Settings → Automations, confirm Routines loads saved definitions and Edit opens their values without requiring optional hook services. Unsupported engine tabs must explain their availability; a failed routine-list read must not appear as an empty list. Keep test automations disabled until you intend to execute them.

  6. Submit a test task, then verify Pin, Rename, Archive, Fork, workspace changes, and Open side chat in its task menu. Use the response thumbs to submit message feedback. With a running task, test step feedback and resume after approving a paused task. Without a configured model, the app should offer AI setup rather than pretend to run the task.

  7. Add a small test file to the composer. Confirm it stays visible, type a draft, and reload to confirm text and attachment references recover. Local file bytes are not persisted; select an attachment again if it is no longer available. Sending imports the file into the selected project.

  8. In Calm style, open Library, browse a project folder, preview a text file, and download it. HTML and SVG files download as attachments rather than running in the application origin.

  9. Open Personality, save the assistant name, leave the screen, and verify the name is retained. Open Devices and check that the fleet view loads; task controls require a saved, connected device.

  10. Open an authorized task, expand its side panel, and open the terminal. Type a harmless command, check output, reconnect, then test Stop, Close tab, and New tab. The terminal requires a task whose current access profile permits shell use; the host chooses the workspace-root directory.

  11. Open Settings → Skills. Check that Skill Store status loads, search the catalog, and open a result. Open Feature Packs → QA & Testing and confirm its Commands, Skills and Agents tabs show host-backed details. Disable the test pack, reload, check the saved state, then restore it. Repeat for an individual skill. Required or quarantined packs must respect their restrictions. Installation and import controls must explain their availability instead of failing silently.

  12. Open Settings → Automations → Task Queue. Note the original limits, change one value, save, and confirm the saved status. Reopen the tab and verify the value; restart the disposable host, let the tab reload, and verify it remains saved. Restore the original limits and save. Load or save failures must appear in the page instead of showing defaults or a false success.

  13. Open Git Changes in a disposable Git-backed workspace. Stage one changed file, unstage it, stage it again, and commit with a message. Confirm unrelated unstaged files remain outside the commit. Refresh between actions; a stale revision must prompt a refresh, and retrying the same operation must not create a duplicate commit. Browser commits skip repository hooks.

  14. Open Settings → Memory in a disposable project. In What CoWork knows, add a fact, pin it, then delete it. In Settings, change Keep history for, leave and return to confirm the saved value, then restore it. Use Import → From another assistant to paste a disposable memory; confirm Import complete stays visible and the imported record persists after closing. Switch workspaces while data loads and verify only the selected workspace's settings appear. Workspace deletion controls should explain missing delete permission; a permission rejection must never appear as successful deletion.

Run npm run qa:web:smoke for disposable host/service checks. It also checks the shared method manifest, provider/personality/agent/automation reads, optional positional arguments, project creation, and task fork/side-chat replay. This is separate from interactive browser testing, a real-model workflow, and packaged release acceptance.

Current runtime and control audit

qa:web:ui-smoke emits a control ledger to the OS temporary directory as cowork-web-control-audit.json; set COWORK_WEB_CONTROL_AUDIT_PATH to choose a destination. Visible/enabled controls are inventory, not proof of their effects. Nested dialogs and populated-data states remain separate audit work.

Awareness settings and belief actions now use the existing host service. Browser config writes send changed fields and merge against current host state; explicit config/belief changes publish only after persistence succeeds. Workspace beliefs authorize their stored workspace, and deletion requires delete access independently. Browser acceptance saves/restores Private Mode and confirms/forgets a belief generated through ordinary task feedback. Node hosts do not imply desktop device collectors are running. Real-task prompt effects, restart and load acceptance remain open.