Home

mweinbach / agent-coworker

publicmweinbach/agent-coworker
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

feat: add durable tasks feature flag with opt-in control

3 months ago

a3df732
Authored
mweinbach6/29/2026, 3:16:13 PM
Introduce a `tasks` feature flag to gate the durable Tasks feature (task workspaces, UI, createTask tool, and task/* routes). The flag defaults off and can be enabled via `COWORK_ENABLE_TASKS=1` env var or the dev-only desktop settings toggle. Packaged builds intentionally ignore locally flipped overrides to prevent dev settings from leaking into production; they resolve all flags to build-time defaults plus env overrides as an escape hatch.

Gating is implemented at multiple layers: UI components conditionally render based on the flag, JSON-RPC routes are unregistered when disabled, the createTask tool is absent from the tool set, and the config layer materializes the resolved boolean.

Includes comprehensive test coverage for feature flag resolution, route registration, UI normalization, and tool availability.

Parente7d362e

27 files changed
  • apps/desktop/electron/services/serverManager.ts+3−2
  • apps/desktop/src/app/store.actions/bootstrap.ts+42−16
  • apps/desktop/src/app/store.actions/tasks.ts+7−0
  • apps/desktop/src/app/store.ts+1−0
  • apps/desktop/src/lib/webAdapter.ts+1−0
  • apps/desktop/src/ui/Sidebar.tsx+20−17
  • apps/desktop/src/ui/sidebar/SidebarWorkspaceItem.tsx+24−19
apps/desktop/test/bootstrap-cache.test.ts
+43
−0
  • apps/desktop/test/task-actions.test.ts+10−0
  • apps/desktop/test/task-mode-ui.test.tsx+1−0
  • docs/harness/config.md+7−0
  • docs/websocket-protocol.md+8−0
  • src/cli/repl/commandRouter.ts+6−0
  • src/config.ts+12−0
  • src/server/jsonrpc/routes/index.ts+4−1
  • src/server/runtime/SessionRegistry.ts+6−0
  • src/server/tasks/flags.ts+14−0
  • src/shared/featureFlags.ts+19−1
  • src/tools/createTask.ts+8−1
  • src/tools/index.ts+5−2
  • src/types.ts+8−0
  • test/config/config.loadConfig.test.ts+22−0
  • test/helpers/wsHarness.ts+3−0
  • test/jsonrpc.router.test.ts+38−1
  • test/jsonrpc.task-workspace-subscription.test.ts+6−0
  • test/shared.featureFlags.test.ts+21−4
  • test/tools/tools.createTools.test.ts+50−7