<command-name>/clear</command-name> <command-message>clear</command-message>…
- User
/clear clear
- User
chart_spec extraction failed for sql-analyst shown in backend log in subprocess mode
Assistant
Using systematic debugging to investigate the
chart_specextraction failure.Phase 1: Root Cause Investigation - Let me gather evidence first.
Assistant
You're right, sorry for the detour. The issue is straightforward - let me look at the actual code.
Assistant
The issue is clear. The
sql-analystsubagent typically returns plain text SQL results, not chart JSON. But the code on line 846 treats bothsql-analystandchart-builderthe same - always trying to extract achart_spec. Whensql-analystreturns normal query results, extraction naturally fails, producing a spurious warning.The fix: only attempt
chart_specextraction forchart-builder, and forsql-analystjust pass through the result text. Let me also check the container mode equivalent.Assistant
Same pattern in both modes. The fix is to only attempt
chart_specextraction forchart-builderand just pass through the result forsql-analyst. Both code paths need updating.Assistant
Now the subprocess mode equivalent:
Assistant
Root cause: The code treated both
sql-analystandchart-builderidentically — always attemptingchart_specextraction. Sincesql-analystreturns plain text query results (not chart JSON), extraction always fails, producing a spurious warning.Fix: Only attempt
chart_specextraction forchart-builder. Forsql-analyst, directly pass the result text through to thesubagent_endevent. Applied to both container mode and subprocess mode.Let me verify the tests still pass.
Assistant
All 8 tests pass. The fix is simple and correct:
sql-analystresults now skipchart_specextraction entirely and pass through as plain textresultchart-builderstill goes through the full extraction pipeline- No more spurious
chart_spec extraction failed for sql-analystwarnings in the logs
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.