feat: structured JSON output for brain and evaluate turns#13
Open
Savolent wants to merge 2 commits intovcarl:mainfrom
Open
feat: structured JSON output for brain and evaluate turns#13Savolent wants to merge 2 commits intovcarl:mainfrom
Savolent wants to merge 2 commits intovcarl:mainfrom
Conversation
Brain functions no longer hardcode opus. Each brain role now defaults to a cheaper model (plan/interrupt → sonnet, evaluate → haiku) and accepts an optional model override via StateMachineConfig. Any non-Anthropic model string routes to OpenRouter via HTTP, bypassing the Docker container. - Add AnyModel type and callOpenRouter() to Claude service - Add model override fields to StateMachineConfig, BrainContainerContext, PlanningServices, EvaluateServices, SpawnSubagentConfig - Make dream and timeout-summarizer models configurable via env vars (DREAM_MODEL, TIMEOUT_SUMMARIZER_MODEL) - Default step timeoutTicks raised from 10 to 30 ticks - Body effort logic simplified: only body role gets normal effort Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add JSON schemas for plan and eval turns so the LLM is constrained to produce valid JSON directly rather than wrapping in markdown. Eliminates fence-stripping as the primary parse path (kept as fallback). Also adds TurnConfig fields for fallbackModel, maxBudgetUsd, and jsonSchema, wired through to claude CLI flags. Body turns now correctly use role: "body" instead of role: "brain", enabling effort differentiation. Depends on: feat/brain-model-flexibility (AnyModel, model override) Co-Authored-By: Claude Sonnet 4.6 <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
--json-schemaflag support toprocess-runner.tsso brain and evaluate turns receive constrained JSON output without markdown fences--fallback-modeland--max-budget-usdpass-through flags for cost controlPLAN_SCHEMAandEVAL_SCHEMAJSON Schema constants intobrain.tsso plan/evaluate calls produce valid, parseable output even from fast modelsrolelabel: was incorrectly"brain", now correctly"body"insubagent-manager.tsfallbackModelandmaxBudgetUsdfromSpawnSubagentConfigthrough torunTurnDepends on
This branch stacks on top of #8 (configurable model selection). The diff against
mainincludes commits from that PR. Merge after #8.Test plan
🤖 Generated with Claude Code