Repository navigation
fix(subagents): send the schema on @cf/ structured coercion, give it room, say 'timed out' - #159
Conversation
…room, say 'timed out' The in-process task tool with resultSchemaName on @cf/zai-org/glm-5.3-flash failed with 'Coercion error: Request aborted'. Measured on jp-gw: - @ai-sdk/openai-compatible without supportsStructuredOutputs sends a bare json_object and drops the schema. GLM never saw it, invented its own fields, failed validation, and the retry ran past the 30s budget. Now @cf/ models on /compat get json_schema (what createAI's run path already sends). GLM passes on the first attempt; deepseek, kimi, gemma and llama-4 also pass, two of which timed out before. - One GLM pass takes 10-25s (reasoning), kimi 64s, gemma 81s. The coercion budget is 120s for @cf/, 30s for hosted models. - runWithLocalSignal relabels a timeout as 'Request aborted'. generateStructured now reads the signal: 'timed out after Ns' or 'aborted', and doesn't retry on a dead signal. A caller signal no longer drops timeoutMs (AbortSignal.any).
|
Preview deployed: https://dodo-preview.jonnyparris.club Serves The preview is shared: the next PR push replaces this build, and this PR gets a new comment when that happens. Add the Replaced |
|
beep-boop-🤖 Live check on preview (eaf26c9): 4 sessions, |
Fixes
Coercion error: Request abortedon the in-processtasktool withresultSchemaNameon@cf/zai-org/glm-5.3-flash(found in the #158 live check; pre-existing).Root cause (measured on jp-gw
/compat)@ai-sdk/openai-compatiblewithoutsupportsStructuredOutputssendsresponse_format: {type:"json_object"}and drops the schema. GLM never saw it, invented its own fields (files_modified,tests_passed…), failed validation, and the retry ran past the 30s coercion budget. ThenrunWithLocalSignalrelabelled the TimeoutError as "Request aborted".Change
/compatprovider:supportsStructuredOutputsfor@cf/models →json_schemastrict (what createAI's run path already sends). Onlyresponse_formatreads the flag; tool turns unchanged.@cf/, 30s for hosted (coercionTimeoutMs).generateStructured: on a fired signal, no retry;lastErroristimed out after Ns/timed out/aborted. A caller signal no longer dropstimeoutMs(AbortSignal.any).Evidence (real AI SDK +
generateStructured+ TaskSummary, before → after)Tests: new cases in
structured-output-generate,compat-binding-unit,subagent-model-unit; typecheck clean; full suite passes (7 facet/DO tests hit the 60s timeout under load ~85 and pass on rerun alone).beep-boop-🤖