Skip to content

[repo-study-fable-advisor-orchestration-profiles] Add an orchestrated CoS execution mode with per-role provider/model and per-step reasoning effort #5992

Description

@atomantic

Phase 1 of #5991.

Provenance: studied DannyMac180/fable-advisor (MIT, © 2026 Dan McAteer) on 2026-09-03. Clean-room — the technique is reimplemented against PortOS modules, nothing is copied.

Rationale

A CoS task resolves one provider and one model for its entire run, so a user who wants strong reasoning for the planning pays that model's rate for the mechanical editing too. This phase adds an opt-in orchestration profile — architect / implementer / reviewer roles, each with its own provider+model — and the per-step spec contract that makes delegating to a context-free lane safe.

What exists today (the gap is real)

  • selectModelForTask (server/services/agentModelSelection.js) picks ONE model tier at spawn from task.metadata.model / metadata.provider, complexity heuristics and taskLearning's suggestModelTier. There is no role dimension.
  • resolveThinkingLevel / getModelForLevel (server/services/thinkingLevels.js) resolve a single effort for the whole run from task.metadata.thinkingLevel (task → agent → provider precedence). Per-step effort does not exist; Pipeline stage LLM calls can't set a reasoning effort — thread it as a soft run-level default #3641 shipped only a soft run-level default for pipeline stages.
  • agentProviderResolution.js resolves one provider per run.
  • agentPromptBuilder.js builds one prompt for one agent.

Fix

  • server/lib/validation.js — add an orchestrationProfile schema: { architect: {provider, model, effort}, implementer: {provider, model, defaultEffort}, reviewer: {provider, model, effort} }, plus executionMode: 'direct' | 'orchestrated' on the CoS task input schema. Keep direct the default so existing tasks are untouched.
  • server/services/agentModelSelection.js — add selectModelForRole(task, role, provider, agent) alongside selectModelForTask; the existing entry point becomes the direct-mode / architect-role caller so current behavior is byte-identical when no profile is set.
  • server/services/thinkingLevels.js — let a resolved effort be carried per delegated step rather than only per run; the architect names REASONING: <rung> in each spec and the lane passes it through unchanged (never rounds it — an unsupported rung is an error, not a downgrade).
  • server/services/agentPromptBuilder.js — when executionMode === 'orchestrated', splice in the architect doctrine: emit specs not code, delegate exploration, and carry all six spec parts (objective, files, interfaces, constraints, verification command, reasoning effort) into every delegated unit, since the lane shares none of the architect's context.
  • server/services/cosTaskStore.js + the CoS task DB schema — persist executionMode and the profile; keep schema parity per server/AGENTS.md and add a migration under scripts/migrations/ with the seed in data.reference/.
  • Client: a profile picker on the CoS task form and in /ai, with the storage-classification checklist in docs/STORAGE.md applied to the profile record.

Notes

  • Profiles are per-install config, not a federated record — keep them machine-local.
  • No cold-bootstrap calls: the profile only takes effect when a task actually runs.

Scope: medium-large — schema + migration + two service entry points + prompt assembly + one settings surface.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cos-agentsChief-of-Staff autonomous agentseffort:xhighDispatch reasoning effort: extra highmodel:heavyDispatch capability: strongest available coding modelplanTracked by /do:replanplanner:opus-5Plan authored by the opus-5 modelrepo-studyProposed from a study of a captured reference repository

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions