Skip to content

fix(service): an inbox post with a picture marks the sandbox opened - #3484

Merged
luke-agent[bot] merged 1 commit into
mainfrom
luke/inbox-post-opens-sandbox
Oct 17, 2026
Merged

luke-agent[bot] merged 1 commit into
mainfrom
luke/inbox-post-opens-sandbox

Conversation

@dastratakos

@dastratakos dastratakos commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • The ask: when post_to_inbox carries an image block, count that call as opening the sandbox, so the turn's end records the branch and stops the sandbox.
  • Why it was missed: the service reads an image block's picture from the agent's sandbox, which opens the sandbox, but opensSandbox (coder-host/tool-set.ts) never counted post_to_inbox.
  • Effect of the gap: a turn whose only sandbox use was posting a picture to the inbox never set openedAt. The turn-end hook (apps/dev/hooks/store.ts) then skipped recording the branch and stopping the sandbox, so the sandbox kept running until it timed out.
  • The fix: opensSandbox now counts a post_to_inbox call whose blocks include an image block, using the same block-type check a chat post with a picture already gets. A post with words alone, or with no blocks, still opens nothing.
  • Found while reviewing the reply_inbox tool in feat(features,service,dev): the agent reads and replies on its Inbox threads #3482, which had the same gap and fixes it there; this PR is the post_to_inbox half, on its own as the orchestrator asked.

Evidence

  • Platform-independent checks:
    • vitest run packages/service/src/agents/coder-host/chat-sandbox.test.ts: 2 passed. With tool-set.ts reverted, the new test fails (1 failed, 1 passed).
    • biome check on packages/service/src/agents/coder-host: clean.
    • tsc -p packages/service: clean.

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") The new test in chat-sandbox.test.ts covers a post with an image block, one with words alone, and one with no blocks.
  • 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. (manual: vitest run --reporter=json) +1.
  • 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. Nothing is replaced.
  • Every CLAUDE.md/AGENTS.md sentence naming a changed part is edited; root pair stays byte-identical. None names this part.
  • 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) @luke/features is already a dependency of @luke/service.
  • 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

Made with Luke


Devin Review


Summary by cubic

opensSandbox now counts a post_to_inbox call that carries an image block, so a turn whose only sandbox use is posting a picture to the inbox records its branch and stops its sandbox at turn end, instead of leaving it running until timeout.

Written for commit 345e928. Summary will update on new commits.

View guided diff Turn on auto-fix

post_to_inbox reads an image block's picture from the sandbox, so
opensSandbox now counts a post whose blocks include an image, with the
same check a chat post with a picture gets. A turn whose only sandbox
use is such a post now records its branch and stops its sandbox at its
end, instead of leaving the sandbox running until it times out.

Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
@vercel

vercel Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
luke-web Ready Ready Preview Oct 17, 2026 1:42pm UTC

Request Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Devin Review

Comment thread packages/service/src/agents/coder-host/tool-set.ts
@luke-agent
luke-agent Bot added this pull request to the merge queue Oct 17, 2026
Merged via the queue into main with commit c1df69d Oct 17, 2026
11 checks passed
@luke-agent
luke-agent Bot deleted the luke/inbox-post-opens-sandbox branch October 17, 2026 13:53

This branch was successfully deployed

1 active deployment
Preview — 345e928f Deployed Oct 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant