Skip to content

feat: choose workspace run modes from the composer - #4293

Merged
reachjalil merged 3 commits into
devfrom
workspace-run-mode
Sep 5, 2026
Merged

reachjalil merged 3 commits into
devfrom
workspace-run-mode

Conversation

@reachjalil

@reachjalil reachjalil commented Sep 2, 2026 •

Copy link
Copy Markdown
Member

Summary

Add an opt-in workspace run-mode control immediately left of the composer attachment button, in both new tasks and existing chats.

  • Settings → Advanced → Show workspace run mode is off by default. Enabling it reveals the control without changing permissions.
  • The menu offers Ask before actions, Workspace defaults, and Keep going, with a selected indicator and short explanations.
  • Keep going requires confirmation before allowing tools by default. The warning explains outside-folder access, global-rule precedence, and repeated-action prompts. Specific workspace rules remain in force; this does not grant OS or connected-service access.
  • The choice applies to every chat in the workspace and is saved in its existing OpenCode JSON/JSONC file. Comments, unrelated settings, and narrower rules are preserved. Hiding the control does not reset the saved mode.
  • Active sessions and pending approvals block changes instead of being interrupted. Unsupported/custom configurations, the experimental v2 chat engine, and organization-controlled settings are not silently bypassed. A failed engine refresh is shown as pending, not applied.

Scope

Replaces this PR's older settings-only implementation with a standalone change targeting dev. It no longer depends on #4292; that PR's workspace-rule editor and approval actions remain separate.

Verification

Verdict: Incomplete for the extended permission-boundary matrix; the core desktop journey Passed. Current head: afbc0f8a7fa6903ffc0d419edec7a9db90f665a9, based on dev at 46d13af3f.

  • Passed — real desktop: OPENWORK_EVAL_REF=afbc0f8a7fa6903ffc0d419edec7a9db90f665a9 pnpm evals:e2e composer-run-mode. Printed placement: daytona (daytona CLI authenticated); exit 0; 1 passed, 0 failed, 0 skipped. Fresh isolated desktop, exact-head checkout, all 6 journey steps passed. Published test evidence.
  • Passed — focused component checks: pnpm --filter openwork-server exec bun --conditions=development test src/workspace-run-mode.test.ts; exit 0; 11 passed, 0 failed. Covers JSONC edits, authorization, invalid configurations, busy sessions, refresh retries, and v2 gating. These are component checks, not journey proof.
  • Passed — coherence: pnpm --filter @openwork/app typecheck, pnpm --filter openwork-server typecheck, and git diff --check; exit 0.
  • Failed earlier, corrected: the journey initially could not locate the switch using its label alone, then compared a runtime timestamp that legitimately advances on renderer reload. The final run uses an explicit switch test ID and compares configuration values; it passes on the current head.
  • Skipped: none in the final selected journey.
  • Deferred: actual cross-workspace/split-pane, organization-lock, and busy-session desktop journeys; engine-v2 support; cross-platform verification. Those boundaries are not claimed as fully runtime-proven by this PR.

The desktop journey covers the default-off flag, all three choices, cancellation/confirmation, effective engine permissions, renderer reload, and preserving a saved mode when the flag is disabled. No merge or release is included.

@vercel

vercel Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openwork-app Ready Ready Preview Sep 5, 2026 8:27pm UTC
openwork-den Ready Ready Preview Sep 5, 2026 8:27pm UTC
openwork-diagnostics Ready Ready Preview Sep 5, 2026 8:27pm UTC
openwork-landing Ready Ready Preview, v0 Sep 5, 2026 8:27pm UTC

@benjaminshafii

Copy link
Copy Markdown
Member

@OmarMcAdam Please resolve the explicit product decision in this PR: Run everything overrides global deny rules and outside-workspace/doom-loop prompts under the engine merge order. Confirm the intended permission semantics before merging this stack.

Holding for your review under the current merge instructions.

@reachjalil
reachjalil force-pushed the workspace-permission-rules branch from 616e905 to 508b925 Compare September 5, 2026 00:36
@vercel
vercel Bot temporarily deployed to Preview – openwork-den September 5, 2026 00:40 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-landing September 5, 2026 00:40 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-diagnostics September 5, 2026 00:40 Inactive
@reachjalil reachjalil changed the title feat(settings): choose a workspace run mode by editing its opencode.json catch-all feat: choose workspace run modes from the composer Sep 5, 2026
@reachjalil
reachjalil changed the base branch from workspace-permission-rules to dev September 5, 2026 20:20
@reachjalil

Copy link
Copy Markdown
Member Author

Test evidence — workspace-run-mode-is-opt-in-confirms-keep-going-and-preserves-policy-when-hidde — ✅ passed

SHA afbc0f8 · engine v1

✅ passed · 0 expectations passed · 0 failed · 0 pending

screenshots not attached (gh < 2.99; run brew upgrade gh)

[world] desktop(daytona) · workspace(/tmp/openwork-empty-session-1788639949471) · session("New task")
[user] see(composer, editable) · press(Escape)
[probe] desktopApi(GET /workspace/ws_edcc9a9ae63c/permissions/mode) · eventually(workspace persists default) · desktopApi(GET /workspace/ws_edcc9a9ae63c/permissions/effective) · storage(openwork.preferences)
[user] notSee(testId=workspace-run-mode-trigger)
[probe] desktopApi(GET /workspace/ws_edcc9a9ae63c/config)
[user] click(testId=account-status-menu) · click(Settings) · click(Advanced) · see(testId=workspace-run-mode-flag) · click(testId=workspace-run-mode-flag)
[probe] storage(openwork.preferences) · eventually(run mode flag enabled)
[user] click(Back to app) · see(testId=workspace-run-mode-trigger) · click(testId=workspace-run-mode-trigger) · see(text=Applies to every chat in this workspace. Specific workspace rules still apply.) · see(testId=run-mode-default) · see(testId=run-mode-approve) · see(testId=run-mode-run-everything)
[probe] desktopApi(GET /workspace/ws_edcc9a9ae63c/permissions/mode) · desktopApi(GET /workspace/ws_edcc9a9ae63c/config)
[user] click(testId=run-mode-approve)
[probe] desktopApi(GET /workspace/ws_edcc9a9ae63c/permissions/mode) · eventually(workspace persists approve) · desktopApi(GET /workspace/ws_edcc9a9ae63c/config) · desktopApi(GET /workspace/ws_edcc9a9ae63c/permissions/effective) · eventually(engine applies workspace MCP ask)
[user] see(testId=workspace-run-mode-trigger) · reload · see(testId=workspace-run-mode-trigger)
[probe] storage(openwork.preferences) · desktopApi(GET /workspace/ws_edcc9a9ae63c/permissions/mode) · desktopApi(GET /workspace/ws_edcc9a9ae63c/config) · desktopApi(GET /workspace/ws_edcc9a9ae63c/permissions/effective)
[user] see(testId=workspace-run-mode-trigger) · click(testId=workspace-run-mode-trigger) · see(text=Applies to every chat in this workspace. Specific workspace rules still apply.) · see(testId=run-mode-default) · see(testId=run-mode-approve) · see(testId=run-mode-run-everything) · click(testId=run-mode-run-everything) · see(text=Let OpenWork keep going?) · see(label=Enable Keep going)
[probe] desktopApi(GET /workspace/ws_edcc9a9ae63c/permissions/mode) · desktopApi(GET /workspace/ws_edcc9a9ae63c/config) · desktopApi(GET /workspace/ws_edcc9a9ae63c/permissions/effective)
[user] click(label=Cancel)
[probe] has("Let OpenWork keep going?") · eventually(Keep going confirmation dismissed)
[user] notSee(text=Let OpenWork keep going?) · see(testId=workspace-run-mode-trigger)
[probe] desktopApi(GET /workspace/ws_edcc9a9ae63c/permissions/mode) · desktopApi(GET /workspace/ws_edcc9a9ae63c/config) · desktopApi(GET /workspace/ws_edcc9a9ae63c/permissions/effective)
[user] see(testId=workspace-run-mode-trigger) · click(testId=workspace-run-mode-trigger) · see(text=Applies to every chat in this workspace. Specific workspace rules still apply.) · see(testId=run-mode-default) · see(testId=run-mode-approve) · see(testId=run-mode-run-everything) · click(testId=run-mode-run-everything) · see(text=Let OpenWork keep going?) · click(label=Enable Keep going)
[probe] has("Let OpenWork keep going?") ×2 · eventually(Keep going confirmation dismissed)
[user] notSee(text=Let OpenWork keep going?)
[probe] desktopApi(GET /workspace/ws_edcc9a9ae63c/permissions/mode) · eventually(workspace persists run-everything) · desktopApi(GET /workspace/ws_edcc9a9ae63c/config) · desktopApi(GET /workspace/ws_edcc9a9ae63c/permissions/effective) · eventually(engine applies workspace MCP allow)
[user] see(testId=workspace-run-mode-trigger) ×2 · click(testId=workspace-run-mode-trigger) · see(text=Applies to every chat in this workspace. Specific workspace rules still apply.) · see(testId=run-mode-default) · see(testId=run-mode-approve) · see(testId=run-mode-run-everything) · click(testId=run-mode-default)
[probe] desktopApi(GET /workspace/ws_edcc9a9ae63c/permissions/mode) · eventually(workspace persists default) · desktopApi(GET /workspace/ws_edcc9a9ae63c/config) · desktopApi(GET /workspace/ws_edcc9a9ae63c/permissions/effective) · eventually(inherited MCP permissions restored)
[user] see(testId=workspace-run-mode-trigger) ×2 · click(testId=workspace-run-mode-trigger) · see(text=Applies to every chat in this workspace. Specific workspace rules still apply.) · see(testId=run-mode-default) · see(testId=run-mode-approve) · see(testId=run-mode-run-everything) · click(testId=run-mode-approve)
[probe] desktopApi(GET /workspace/ws_edcc9a9ae63c/permissions/mode) · eventually(workspace persists approve) · desktopApi(GET /workspace/ws_edcc9a9ae63c/permissions/effective) · eventually(engine applies workspace MCP ask) · desktopApi(GET /workspace/ws_edcc9a9ae63c/config) · desktopApi(GET /workspace/ws_edcc9a9ae63c/permissions/effective)
[user] click(testId=account-status-menu) · click(Settings) · click(Advanced) · see(testId=workspace-run-mode-flag) · click(testId=workspace-run-mode-flag)
[probe] storage(openwork.preferences) · eventually(run mode flag disabled)
[user] click(Back to app) · see(composer, editable) · notSee(testId=workspace-run-mode-trigger) · reload · see(composer, editable) · notSee(testId=workspace-run-mode-trigger)
[probe] storage(openwork.preferences) · desktopApi(GET /workspace/ws_edcc9a9ae63c/permissions/mode) · desktopApi(GET /workspace/ws_edcc9a9ae63c/config) · desktopApi(GET /workspace/ws_edcc9a9ae63c/permissions/effective)
steps 1 ✅ the control is absent until enabled in Advanced, without a policy write (8.5s) · 2 ✅ Ask before actions persists a workspace catch-all and reaches the engine (3.1s) · 3 ✅ opening and cancelling Keep going leaves saved and effective permissions unchanged (8.4s) · 4 ✅ only confirming Keep going changes the workspace and effective MCP action to allow (7.8s) · 5 ✅ Workspace defaults removes the catch-all and restores inherited MCP permissions (3.1s) · 6 ✅ turning the flag off hides only the control, even with a non-default policy saved (15.4s)
verdict passed · 43 user observations (see ×38, notSee ×5) · 51 probes · steps 6/6


Test run created 2026-09-05T20:25:49.448Z · Source: evals/results/test-runs/2026-09-05T20-25-49-448Z-workspace-run-mode-is-opt-in-confirms-keep-going-and-preserves-policy-when-hidde/test-run.json · Repro: pnpm --dir evals artifacts:publish -- --pr 4293 --test-run 2026-09-05T20-25-49-448Z-workspace-run-mode-is-opt-in-confirms-keep-going-and-preserves-policy-when-hidde

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (afbc0f8a7fa6903ffc0d419edec7a9db90f665a9). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@reachjalil
reachjalil enabled auto-merge (squash) September 5, 2026 20:41
@reachjalil
reachjalil merged commit 94649b4 into dev Sep 5, 2026
28 checks passed
yomgui added a commit that referenced this pull request Sep 10, 2026
…he snapshot-error composer test

apps/app/tests/composer-editable-on-snapshot-error.test.tsx has been red on dev
since #4293 (composer renders WorkspaceRunModeMenu, which reads
DesktopConfigProvider) and #4650 (message list renders ActionContextMenu,
which reads PlatformProvider). Both providers exist at the real app root,
so this is test drift, not a product regression. Mirror the fix already
applied to composer-focus-continuity.test.tsx in #4631 and #4640.
yomgui added a commit that referenced this pull request Sep 11, 2026
…alette (#4722)

* fix(app): list every Advanced section in the developer-mode command palette

The empty-query settings preview was capped at 6, which matched the six
Advanced sections when #4505 put them first in developer mode. #4293 added
a seventh section (Workspace run mode), so Developer fell off the list.
Size the preview from ADVANCED_SETTINGS_SECTIONS instead.

* test(app): re-express palette settings expectations for Advanced section items

Both claims went stale when #4505 added per-section Advanced items: the id
list omitted them, and "reset" now surfaces Advanced › Organization server
(keyword "reset server") ahead of the Advanced tab. Red on origin/dev
before this change.

* test(evals): expect Workspace run mode in the developer-mode command palette

Tightens command-palette-search: the seventh Advanced section must be listed
without a search and reachable by its alias.
yomgui added a commit that referenced this pull request Sep 11, 2026
…r (missing PlatformProvider / run-mode menu) (#4802)

apps/app/tests/composer-editable-on-snapshot-error.test.tsx has been red on dev
since #4293 (composer renders WorkspaceRunModeMenu, which reads
DesktopConfigProvider) and #4650 (message list renders ActionContextMenu,
which reads PlatformProvider). Both providers exist at the real app root,
so this is test drift, not a product regression. Mirror the fix already
applied to composer-focus-continuity.test.tsx in #4631 and #4640.

This branch was successfully deployed

4 active deployments
Preview – openwork-landing — afbc0f8a Deployed Sep 5, 2026 by vercel[bot]
Preview – openwork-app — afbc0f8a Deployed Sep 5, 2026 by vercel[bot]
Preview – openwork-den — afbc0f8a Deployed Sep 5, 2026 by vercel[bot]
Preview – openwork-diagnostics — afbc0f8a Deployed Sep 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants