ktx/packages/cli
Andrey Avtomonov 0cffb5b537 fix(llm): allow StructuredOutput tool and raise maxTurns for generateObject
The Claude Code agent SDK announces an internal pseudo-tool named
StructuredOutput in the system/init message whenever outputFormat is set
to { type: 'json_schema' }. The runtime's isolation check built its
allowedToolIds set only from MCP tool ids and treated StructuredOutput
as an unexpected host-injected tool, so every generateObject call threw
"Claude Code runtime isolation failed: tools=StructuredOutput ..." and
the table-descriptions and relationship-LLM-proposal enrichment stages
recorded null output across the board.

Whitelist StructuredOutput specifically in generateObject's
allowedToolIds — the check also enforces missing_tools symmetry, so
generateText and runAgentLoop, which do not see StructuredOutput, must
not require it.

generateObject also ran with maxTurns: 1, which the model intermittently
breached when it emitted thinking text before the structured response.
Raised to 5 to give the schema-bound call enough headroom without
allowing unbounded loops. The existing tests now exercise the path with
an init message that announces StructuredOutput so the regression cannot
slip back in.
2026-05-23 10:37:08 +02:00
..
assets/demo/orbit Polish documentation copy (#98) 2026-05-14 12:43:14 -04:00
scripts chore(workspace): gate dead-code with knip production mode (#196) 2026-05-21 15:28:58 +02:00
src fix(llm): allow StructuredOutput tool and raise maxTurns for generateObject 2026-05-23 10:37:08 +02:00
package.json feat(telemetry): anonymous posthog usage telemetry across node cli and python daemon (#205) 2026-05-22 18:18:47 +02:00
tsconfig.json chore(workspace): gate dead-code with knip production mode (#196) 2026-05-21 15:28:58 +02:00
vitest.config.ts Initial open-source release 2026-05-10 23:12:26 +02:00