Skip to content

feat(advisor): add advisor workflow and composer controls - #296

Merged
astyfx merged 2 commits into
mainfrom
fix/advisor/ux
Aug 1, 2026
Merged

feat(advisor): add advisor workflow and composer controls#296
astyfx merged 2 commits into
mainfrom
fix/advisor/ux

Conversation

@astyfx

@astyfx astyfx commented Aug 1, 2026

Copy link
Copy Markdown
Member

Summary

  • add task-scoped Advisor arming, effort selection, exchange visibility, usage reporting, and cancellation handling
  • add provider marks across mixed model/provider selection surfaces
  • add persistent Bar, Tray, and Off placement for prompt composer controls with active-state force visibility and legacy Fast-setting migration
  • make Fast Off remove the selector control and support roving, selecting Arrow-key navigation in placement radio groups

Verification

  • bun run test:ci
  • targeted Playwright model-effort/composer-control suite (4 passed)
  • Lens visual verification in light and dark themes; production Advisor, Secrets, and Compare controls retain their existing ghost styling

astyfx and others added 2 commits August 1, 2026 14:10
Makes the cross-model Advisor something you turn on per task from the
composer instead of a Settings toggle that then runs on every turn, and
makes it possible to see whether it actually did anything.

- Composer control (split toggle + picker) arming the Advisor per task
  through the prompt draft's runtime overrides, with Alt+A / Alt+Shift+A.
  Off is `advisorEnabled: false` with the target kept, so off -> on is one
  click rather than re-picking a model.
- Per-model effort selection, resolved through one helper shared by the
  renderer that labels the tier and the main process that requests it, so
  the composer cannot promise a tier the call would not use.
- AdvisorExchangeMonitor: a checklist built only from reported fields.
  `applied` is emitted from the real injection site, which makes "the
  advisor ran but its advice never reached the prompt" visible for the
  first time. Isolation and effort are reported by the code that applied
  them, never inferred from a provider id.

Fixes found while auditing the above:

- Persistence: the new draft override fields were absent from the strict
  zod schema guarding workspace snapshots. Since `parseWorkspaceSnapshot`
  is all-or-nothing, arming the Advisor made the whole workspace fail to
  parse on relaunch, hydrate empty, and then get overwritten by the next
  autosave. The fields are now declared, unknown keys degrade to dropped
  instead of fatal, and a corrupt advisor target falls back to unset.
- Turn origin: `sendUserMessage` now requires `turnOrigin`, and only a
  `"conversation"` turn arms the Advisor. Compare runs previously ran a
  hidden third-model preflight inside each arm, which both doubled their
  cost and contaminated the comparison being measured.
- Usage: a skipped or timed-out advisor abandoned its runner and reported
  no usage at all, so the most expensive outcome the feature has looked
  free. Late usage is now harvested and folded into the turn total.
- Codex abort: `turn/start` does not resolve until generation finishes and
  no `turnId` exists before it does, so an abort in that window sent no
  interrupt and the model ran to completion server-side. The request now
  races the abort and falls through to ephemeral-thread deletion.
- The abort signal passed to `getCodexModelCatalog` was silently dropped;
  the paginated sweep now honours it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

@heath-s heath-s left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved

@astyfx
astyfx merged commit e69ee59 into main Aug 1, 2026
5 checks passed
@astyfx
astyfx deleted the fix/advisor/ux branch August 1, 2026 11:59
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