Skip to content

Add compact model and thinking controls for discovery and execution - #19

Open
tolimarchuk wants to merge 4 commits into
browser-use:mainfrom
tolimarchuk:feat/model-routing
Open

tolimarchuk wants to merge 4 commits into
browser-use:mainfrom
tolimarchuk:feat/model-routing

Conversation

@tolimarchuk

@tolimarchuk tolimarchuk commented Sep 13, 2026

Copy link
Copy Markdown

Add model and thinking controls for discovery and execution

Agency currently uses the coordinator's model for every phase. This adds separate model and thinking defaults for discovering ideas and executing approved work, with per-task overrides in New cards and New Task.

The controls stay compact: a small chip above task feedback opens the selectors, Settings keeps defaults in a collapsed Models row, and requested/actual worker details expand on demand. Unsaved or unavailable choices remain visible and block execution until resolved.

The model catalog comes from the installed runner. Approval freezes the selected configuration, dispatch prepares explicit model/thinking arguments with fresh context, and worker claims must match that configuration. Requested configuration and claimed worker metadata are recorded separately. Revision checks reject stale saves; later default changes cannot alter queued jobs. Unconfigured installations retain their existing coordinator workflow.

Task submission, decisions and completion each save their related records atomically. Conflicting updates leave neither partial task state nor stray audit rows.

Includes the database migration, catalog-sync and dispatch helpers, setup documentation, and regression coverage. The active coordinator still launches workers; this change does not install a background runner.

Validation:

  • 59 automated tests pass on Node 22.13.0, including actual SQLite route regressions; typecheck, lint, and production build pass.
  • Nine local D1/API scenarios cover settings, overrides, revisions, approval, claims, and dispatch failures. Five additional checks inject failures into actual local D1 writes and verify rollback and legacy worker-metadata retention.
  • Browser checks cover desktop and phone layouts, independent save/reload, per-task persistence, unavailable-model/thinking blocking, unsaved choices during concurrent edits, explicit conflict resolution, previous-run details, dirty-state action blocking, discard/reload, and keyboard dismissal.
  • Real fresh-context workers verified discovery and execution defaults, a per-task override, and claim confirmation before work; saved selections and completed records survived a preview restart.

Summary by cubic

Adds separate model and thinking controls for discovery and execution, replacing the old behavior of using the coordinator's model for every phase. Each New card and New Task can override the execution default; approval freezes the selected configuration and dispatch passes explicit model/thinking arguments with fresh context.

Migration

  • Apply drizzle/0007_shocking_spectrum.sql for agent_settings and the new config/run columns.
  • Run npm run models:sync to register the installed Codex runner's catalog; other runners can POST to /api/agent-models.

Notes

  • Unconfigured installations keep the existing coordinator workflow.
  • A selected model that disappears from the catalog stays visible as unavailable and blocks execution until resolved.
  • Worker claims must match the job's frozen config; revision checks reject stale saves.
  • Adds unit, integration, and browser regression coverage; race injections stay armed across schema maintenance and the active coordinator still launches workers.

Written for commit 68baaf6. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 37 files

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread app/components/agent-picker.tsx Outdated
Comment thread scripts/lib/codex-models.mjs
Comment thread app/agency.tsx Outdated
Comment thread app/api/tasks/route.ts Outdated
Comment thread app/api/agent-jobs/route.ts Outdated
Comment thread lib/agent-settings.ts Outdated
Comment thread app/api/ideas/action/route.ts Outdated
Comment thread app/api/ideas/action/route.ts Outdated
Comment thread app/api/state/route.ts Outdated
Comment thread app/globals.css Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 16 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread tests/helpers/route-harness.mjs Outdated
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.

1 participant