found this eror when using sidecar to generate chart: <tooluseerror>Unknown skill:…
- User
found this eror when using sidecar to generate chart: <tool_use_error>Unknown skill: chart-builder</tool_use_error>
Assistant
Let me investigate where the
chart-builderskill is being referenced in the codebase.Assistant
Let me look at the agent code to understand how the chart-builder subagent is being invoked.
Assistant
Let me look at the sidecar code to understand how it handles the agents configuration.
Assistant
Found the issue. The sidecar (
server.ts) receivesagentsfrom the backend payload but never passes it to the SDKquery()call. TheQueryRequesttype also doesn't include theagentsfield. This means Claude in the container doesn't know about thechart-buildersubagent, so it tries to invoke it as a "Skill" instead, which fails.Let me also check what the SDK's
queryoptions type looks like.Assistant
Good, the SDK does support
agentsin the options. Let me see theAgentDefinitiontype.Assistant
Now I have a clear picture. Here's the fix needed in the sidecar:
types.ts: Addagentsfield toQueryRequestserver.ts: Passbody.agentsto the SDKquery()options, add"Task"toallowedTools, and remove the outdated"mcp__duckdb__generate_chart"
Assistant
Now update
server.tsto pass the agents and fix theallowedTools.Assistant
Now update the
query()call to pass agents and fix allowedTools.Assistant
Now let me verify the changes compile correctly.
Assistant
No type errors. Let me also verify the worktree copy is in sync — the same changes should be applied there since that's what gets built into the Docker image.
Assistant
Good — the Dockerfile copies from the
sidecar/directory (not the worktree), so the changes I made will be picked up when the image is rebuilt. The worktree copy is from an older branch and is irrelevant.Let me verify the final state of both changed files.
Assistant
Let me also verify the query section.
Assistant
The fix looks correct. Here's a summary of the three issues and the changes:
Root cause: The sidecar's
server.tswasn't passing theagentsconfiguration to the SDK'squery()call. The backend correctly sendsagentsin the payload (withsql-analystandchart-builderdefinitions), but the sidecar ignored them. Without knowing about thechart-buildersubagent, Claude tried to invoke it as a "Skill" — which doesn't exist, hence theUnknown skill: chart-buildererror.Changes made:
-
sidecar/src/types.ts— AddedAgentDefinitionPayloadinterface andagentsfield toQueryRequest -
sidecar/src/server.ts— Three fixes:- Import
AgentDefinitionfrom the SDK andAgentDefinitionPayloadfrom types - Convert
body.agentsinto SDKAgentDefinitionobjects and pass them toquery()options
- Import
-
- User
<tool_use_error>Unknown skill: chart-builder</tool_use_error>
still found this error
Assistant
Let me investigate further. The sidecar container might not have been rebuilt, or the issue could be elsewhere. Let me check which Dockerfile path the container manager uses and whether there's a running container with the old image.
Assistant
Let me check what model values the backend sends for the agents, and also check if you're running in container mode or local mode.
Assistant
Since you're in container mode, did you rebuild the Docker image after the code changes? Let me also check for another potential issue — the sidecar might have an old running container being reused.
Assistant
Found the issue. The Docker image was built at 00:51 (before the code changes), and there are 2 running containers using the old image. The fix needs to be baked into a new image.
Let me rebuild the image and stop the stale containers.
Assistant
Image rebuilt successfully (you can see steps 11-12 re-ran with the new source code). The old containers have been stopped and removed.
Now when you send a chart request, the backend will spin up a new container from the updated image, which will:
- Pass the
agentsconfig (includingchart-builder) to the Claude SDK - Include
TaskinallowedToolsso Claude can invoke subagents - No longer reference the obsolete
mcp__duckdb__generate_charttool
Try your chart request again — it should now invoke
chart-builderas a subagent via the Task tool instead of failing as a Skill.- Pass the