fix(agents): a Luke tool's pictures stay out of its stored answer
A follow-up to P09 (#4244), from the "Bringing Codex or Claude Code Max plans into Luke" plan.
What and why
A tool on Luke's MCP server can answer with text plus image content, as look_at_picture does. The Claude Code projection used to turn each image block into an [image] stand-in before it parsed a Luke tool's answer as JSON. That made {"status":"looked"}\n[image], which doesn't parse, so the stored answer stayed a string and its status word went uncounted.
In packages/service/src/agents/native-events/claude-code-moments.ts:
answerText(content, pictures)uses stand-ins only whenpicturesis true, and drops non-text blocks otherwise.settlementOfnow takes the raw content. It keeps pictures as stand-ins for a CLI tool and leaves them out for a Luke tool, the way eve's relay leaves out a look's picture.
Stored shape for a mcp__luke__look_at_picture answer of [text '{"status":"looked"}', image]:
- before:
"{\"status\":\"looked\"}\n[image]" - after:
{status: "looked"}
A CLI tool (Read with text plus an image) still stores "shot.png\n[image]".
Tests
runner-events-app.test.ts gets a new case that posts a Read result and a look_at_picture result, each with an image. It fails on main and passes with this change. pnpm check:affected passed: typecheck, tests and lint. The discarded-effect step was OOM-killed in the sandbox when it ran in parallel, so I re-ran it on its own.
The developer waived Preview runs for this rollout.
Made with Luke