feat(agents)!: plain-object agents entries; createAgent and limits removed
Merged
OK
2mo ago+1117+1117+0123456789012345678901234567890123456789-1030-1030-0123456789012345678901234567890123456789
Stacked on #645; #648 (the app on the target and services) is stacked on this. Each agents entry is now one plain object; createAgent() and the top-level limits are gone.
agents: {
default: { model, judge, system: 'Prefer the keyboard.', context: 'Plans are called tiers.', tools: { lookupOrder }, maxSteps: 25, maxModelCalls: 25, judgmentTimeout: 30_000, maxInputTokens: 64_000 },
thorough: { model: sonnet, system: 'Verify every total before finishing.', maxSteps: 50, maxModelCalls: 60 },
custom: { executor: myBrain, model, maxModelCalls: 10 },
},
- One place for every agent option. Budgets used to be split between the entry and
limits, andsystem/toolsbetween the entry andcreateAgent(). Each entry starts from the built-in defaults, never fromdefault's values. executoris for a custom brain.model,judge,contextand the budgets still apply;systemortoolsnext to it areINVALID_CONFIG.AgentConfigis a union, so this is a type error too.- Removed keys fail naming their replacement:
timeoutbecomesjudgmentTimeout.maxTurnsbecomesmaxModelCalls, also increateToolLoopExecutor.limits.maxModelTokensPerCallbecomes the entry'smaxInputTokens.limitsitself is removed.- A bare
StepExecutorentry points at{ executor }. - Unknown keys get a did-you-mean.
- Fixed internal limits:
maxAgentContextBytes,maxLedgerBytesandmaxEventsPerStepare fixed at 16384, 8192 and 1000. The report'srun.limitskeeps its wire shape, filled from the largest per-agent values and the fixed ones. No schema bump. - Tools are validated at config load:
defineToolonly, a realexecute, and no built-in tool names. e2e mcpserves the entry'stools.exploreextends the entry instead of building an executor.createAgent()is deleted, not stubbed. A config that imports it fails to load with an ESM missing-export error. That's acceptable pre-1.0, and the changeset,config.mdxand the skill name the new shape.- Built-in agent identity is unchanged (
e2e-default-agent/2), so committed recordings keep replaying.
Verified
Ran it locally: yes
- Built CLI in the testbed:
- Configs using
limits, agenttimeoutand a bare executor each exit 2 with the new message. - A new-shape config with
system,tools,judgmentTimeoutandmaxInputTokenspassestests/forms.e2e.ts. run.limitsin the report reads the max across agents.
- Configs using