Sub-Agent β Vision Sub-Call Over Cached Frames
sub_agent hands the frames captured by
screenshot_sequence to a separate,
stateless vision call and returns only its text answer. The images never
enter the main agentβs context β you get βwhat happened in that animation?β
answered without paying for the frames in your main conversation.
// 1. capture 2. askscreenshot_sequence({"duration_seconds": 6, "fps": 2})sub_agent({"task": "Did the video start playing? Describe the first 3 seconds."})It reads the cached frames for the device (up to a hard ceiling of 60 frames, uniformly downsampled), runs one vision call, and returns the text.
Needs an API key
Section titled βNeeds an API keyβThe sub-call is a one-shot Anthropic vision request, so it needs an
ANTHROPIC_API_KEY β it is not available under the claude-code
subscription provider. It degrades gracefully: with no key set, sub_agent
returns an explanatory message rather than raising, and the agent carries on.
export ANTHROPIC_API_KEY=sk-ant-... # enables sub_agentexport SUB_AGENT_MODEL=claude-sonnet-5 # optional model override (default)Not chainable
Section titled βNot chainableβBecause it spawns a paid LLM call, sub_agent is EXEC_CAPABLE, not SAFE β
it canβt be smuggled into a run_flow or
chain batch, so an untrusted flow canβt fan out arbitrary
billed vision calls.
Related
Section titled βRelatedβ- Screenshot Sequence β produces the frames
- LLM Providers β how Ghost reaches models