Add an opt-in orchestrated CoS mode with per-role provider/model and per-step reasoning effort - #6095
Merged
Conversation
…per-step reasoning (#5992) A CoS task resolves one provider and one model for its whole run, so a user who wants strong reasoning for the planning also pays that model's rate for the mechanical editing. This adds an opt-in orchestration profile: three roles (architect plans and delegates, implementer executes one spec, reviewer checks it), each with its own provider/model/effort. - `server/lib/orchestrationProfile.js` owns the vocabulary, the normalizer, and the six-part spec contract a context-free delegated lane needs. Its `parseReasoningDirective` NEVER rounds an unsupported rung — a substituted level would run a step at an effort nobody chose while reporting success. - `selectModelForRole` sits alongside `selectModelForTask`, which now resolves through the architect role; with no profile the selection is unchanged. - `resolveStepEffort` resolves a delegated step's rung as spec directive → role default → run effort, instead of one effort for the whole run. - The architect doctrine renders into both prompt paths and is empty for every `direct`-mode task, which is the default, so an install that configures no profile behaves exactly as before. Named `orchestrationMode` rather than the issue's `executionMode`: agent metadata already carries an `executionMode` meaning tui/runner/direct, and reusing the name — including the value `direct` — for an unrelated axis would have made both unreadable.
Owner
Author
|
Required code review was not completed before publication. This PR is intentionally left open and will not be merged until the required review completes. |
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
Adds the opt-in orchestration profile from #5992: a CoS run can be split into three roles — architect (plans, writes specs, delegates), implementer (executes one spec), reviewer (checks it) — each with its own provider, model, and reasoning effort, instead of resolving one provider + one model + one effort for the whole run.
server/lib/orchestrationProfile.js— vocabulary, normalizer, role gating, and the six-part spec contract a context-free delegated lane needs.parseReasoningDirectivenever rounds: an unsupported rung is an error, because substituting the nearest supported level would run a step at an effort nobody chose while still reporting success.selectModelForRolesits alongsideselectModelForTask, which now resolves through the architect role. With no profile the selection is unchanged, and there is a test asserting that equivalence.resolveStepEffortresolves a delegated step's rung as spec directive → role default → run effort.buildOrchestrationDoctrineSectionrenders the architect doctrine into all three prompt paths (template, full, light). It returns''for everydirect-mode task — the default — so an install that configures no profile is untouched.addTask,updateTask, and the create/update routes), with the repo's absent-vs-cleared semantics.No migration or
data.reference/seed: both keys ride the existing free-form task-metadata blob, additively, so an older peer ignores them.Naming decision: the issue proposed
executionMode: 'direct' | 'orchestrated'. Agent metadata already carries anexecutionModemeaningtui/runner/runner-tui/direct— reusing the name, including the valuedirect, for an unrelated axis would have made both unreadable. Shipped asorchestrationModeinstead.Test plan
cd server && npm test— full server suite green (1 unrelated load-timeout flake inroutes/settings.secretsStrip.test.js, passes on its own re-run).server/lib/orchestrationProfile.test.js,server/services/promptSections/orchestrationDoctrine.test.js.agentModelSelection.test.js(role pin wins; unpinned role and direct-mode task are identical toselectModelForTask),agentProviderResolution.test.js(architect provider pin resolves; a direct-mode task keeps its own metadata pin),thinkingLevels.test.js(spec → role → run precedence; unsupported rung errors),cosTaskRoutes.test.js(pass-through, unknown role rejected, bad rung rejected, clear-on-update).Remaining
Deliberate partial ship — the rest of #5992 stays open:
/ai.resolveStepEffortfrom a returned spec at the point PortOS re-dispatches a delegated unit, once that lane exists — today the rung reaches the lane through the prompt contract, which is the only channel available while sub-agent dispatch happens inside the agent CLI.Refs #5992