feat(advisor): add advisor workflow and composer controls - #296
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Verification