fix(host): send an inbox answer's files to the service

Merged
DA
14d ago
+38-0

Summary

  • Files attached to an Inbox answer never reached the service. codingAgentInboxAnswer in packages/host/src/host-operator.ts sent the answer's reply, choices, values, note, and key to the gateway, but left out its attachments, so the composer dropped them before they reached HostedCodingAgentClient.answerInbox. It now sends them whenever the answer has any.
  • New test in host-operator.test.ts: an answer with a file reaches the gateway call with the file included. It fails without the fix.

Found while building the desktop half of Inbox thread messages (stacked on #3469). Split out off main so it lands right away.

Evidence

  • Platform-independent checks: pnpm check:affected passes except src/main/app-menu.test.ts, which fails only because the sandbox has no Electron binary.

Invariants

  • ./scripts/check.sh green. (CI)
  • JSON Schema goldens unchanged (LUKE_UPDATE_FIXTURES not run, or diff explained line by line). (CI)
  • Every behavior change has, in this PR, the test that fails without it; no change-detector test added. (manual; root AGENTS.md "Testing")
  • Gateway envelope goldens unchanged. (CI)
  • No new as type assertion outside the allowlisted files. (CI via anti-slop)
  • No Effect.runPromise/runSync/runFork outside the runtime edges and the shims tools/anti-slop/effect-edges.json records. (CI via anti-slop/no-run-promise-outside-edges)
  • No new setTimeout/setInterval/new Promise/AbortController/fs.watch outside the files tools/anti-slop/effect-edges.json records. (CI via anti-slop/no-raw-async-primitives)
  • No Effect, Stream, or Layer written as a statement and dropped; a description a caller walks past runs nothing. (CI via pnpm discarded-effect)
  • Test count equals the pre-PR count or the delta is listed. (+1 in host-operator.test.ts)
  • Each hand-rolled file the PR replaces is deleted, or the part that remains is a permanent adaptor named in root AGENTS.md's "The permanent adaptors" with the reason it stays.
  • Every CLAUDE.md/AGENTS.md sentence naming a changed part is edited; root pair stays byte-identical. (CI for pair existence; manual for wording)
  • PRIVACY.md unchanged, or the change is a product decision called out in the PR body.
  • Package package.json deps match what the sources import by bare specifier; effect via catalog:. (CI)
  • Barrel/door rule: no Node-reaching Effect module (@effect/platform-node, effect/sql) behind a barrel the renderer or a web function opens. (CI: existing renderer node: grep plus a new grep for those specifiers in renderer bundles)

Notes

  • Blockers or follow-up verification: None

Made with Luke


Devin Review


Summary by cubic

Fixes inbox answer attachments never reaching the service. The host operator now forwards an answer's attachments to the gateway, so files attached to an answer arrive with its reply, note, and choices.

  • Adds a test verifying an answer with a file includes the file in the gateway call.