release: task tool + ask_user_question + model inheritance (#589)
Merged
SW
5mo ago+644+644+012345678901234567890123456789-29-29-01234567890123456789
Summary
- Port the
task(subagent) andask_user_questioncomposite tools from open-agents - Subagent now inherits the parent's model via
getSubagentModel(ctx) โ ctx.subagentModel ?? ctx.model, mirroring open-agents' AgentContext shape AgentContextgainsmodel: LanguageModel(required) /subagentModel?: LanguageModel;DurableAgentContext = Omit<AgentContext, "model" | "subagentModel">is the JSON-serializable shape passed through Vercel Workflow durable inputsrunAgentStepconstructscallModel = gateway(input.modelId)per-step and attaches it toexperimental_contextโ matches open-agents'prepareCallpattern- New
getMainModel/getSubagentModelhelpers (SRP, one per file) mirror open-agents'tools/utils.ts - Bug fix: subagent's
streamTextwas previously called withmessages: []and a system-only prompt, causingNoOutputGeneratedError. Now passes an explicit user-side triggerprompt, matching open-agents
Test plan
- Unit tests: 3077/3077 pass; lint clean
- E2E on preview:
tasktool delegated to subagent, subagent ran bash internally, parent relayed summary,finishReason: "stop" - Cross-checked against open-agents production (
sandbox.recoupable.com) โ same behavior shape, same model-inheritance semantics
๐ค Generated with Claude Code
Summary by cubic
Adds task subagent delegation and ask_user_question tools, and aligns model handling with open-agents so subagents inherit the parent model. This completes the 11-tool surface and fixes a subagent prompt bug that could throw NoOutputGeneratedError.
-
New Features
- Added
tasktool that runs a capped sub-streamTextwith a curated set of executor tools only (bash,read,write,edit,grep,glob); no recursion or client-side tools. - Added
ask_user_questiontool for UI-driven questions; no serverexecute, answers are returned on the next turn and summarized viatoModelOutput. - Subagent model inheritance:
AgentContextnow includesmodel: LanguageModeland optionalsubagentModel;runAgentStepbuilds the per-step model and attaches it toexperimental_context. NewgetMainModel/getSubagentModelhelpers mirror open-agents. - Introduced
DurableAgentContextfor workflow inputs;runAgentStepwidens it into fullAgentContext.buildAgentToolsnow registerstaskandask_user_questionby default;skillremains conditional on discovered skills.
- Added
-
Bug Fixes
- Subagent calls now include an explicit user-side
prompt, preventing NoOutputGeneratedError when only a system prompt was provided.
- Subagent calls now include an explicit user-side