Keep artifact-producing prompts aligned with the app-managed tool-loop envelope when the runner expects `{ type, ... }` JSON turns.
Use this pattern when a surface wants a model to produce a rich artifact (markdown, plan, brief, idea, etc.) and the runtime is driving an app-managed tool loop that requires structured control messages such as { "type": "tool_call" } and { "type": "final" }.
AgentRunner or an equivalent loop is calling chatStructured() / chatStructuredWithResponse() with a strict control schema.tool_call, final, required keys).return {"type":"final","content":"..."} and put the completed artifact in content.src\dashboard\server.ts POST /api/ideas enables read-only tool calling for idea generation.src\agents\runner.ts validates structured turns with TOOL_LOOP_RESPONSE_SCHEMA.src\dashboard\views\new-idea.ts describes the markdown body, so the route task must also say that the markdown belongs inside {"type":"final","content":"..."}.Do not relax the runner schema to accept raw artifact payloads when the runtime is intentionally app-managing tool decisions. That hides the contract drift and makes multi-turn tool execution less reliable.