Repository navigation
fix(sandbox): a sandbox agent's own replies reach the chat on every client - #72
Merged
t3-code-sandboxes[bot] merged 1 commit intoNov 15, 2026
Conversation
When the sandbox's thread woke itself between host turns (a background task or subagent finishing, a monitor line, a scheduled task), the reply stayed on the sandbox: the bridge only sent the host its background roster, so the phone and any client not paired with the sandbox saw the chat go idle without the answer. The bridge now keeps following the sandbox's thread between turns and, for each run the thread starts on a message no user typed, asks the host for a run of its own (SANDBOX_BRIDGE_WAKE_METHOD). The host's ACP adapter offers that as a provider continuation carrying the sandbox's message id, text and notification, so the mirror gets a wake run like any T3 thread. That run's prompt names the sandbox's message, which the bridge follows with the relay normal turns use; a provider continuation's text is never sent to the sandbox. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 tasks done
Base automatically changed from
fix/sandbox-keepalive-background
to
feat/sandbox-environments
November 15, 2026 21:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #71.
Problem. In a normal T3 chat, when the agent wakes on its own (a background task or subagent finishing, a Monitor line, a scheduled task), the reply appears in the chat on every client. In a sandbox chat seen through the host (the phone, or a desktop not paired with the sandbox), it didn't. The bridge only relayed the sandbox run carrying the host's forwarded message, and after #68 it only reported the background roster. The agent woke on the sandbox, but its reply never reached the host's mirror, not even on the next turn.
Fix (bridge and host ACP adapter; orchestration unchanged).
createdBy !== "user", or ascheduledTaskId) as a wake. It only considers runs that started after the newest run a host turn followed, so no history is replayed. For each wake it sends a new ACP notification (SANDBOX_BRIDGE_WAKE_METHOD) with the sandbox's message id, text and notice, without sandbox-only ids.offerContinuationRun, which keeps one request pending and ignores notices during a running turn. The host message reuses the sandbox's message id, text and notice.turnTargetOfattaches and relays it with the sameTurnTrackeras normal turns, starting at that message. A continuation whose message the sandbox doesn't have does nothing, and its text never reaches the sandbox.Test plan
bridge.test.ts: shows a run the sandbox starts itself as a run of the host's, once. It asks the host once with the cleaned notice, streams the reply, and dispatches nothing to the sandbox (fails on the base).AcpRegistryAdapterV2.test.ts: starts a run when the bridge reports one the sandbox began itself. A repeated notice gives one continuation, and the prompt carries the sandbox's message id (fails on the base).bridge.test.ts,AcpRegistryAdapterV2.test.tsandAcpAdapterV2.test.ts(206 tests), and typecheck of contracts, provider-acp, provider-acp-registry, sandbox-bridge and server pass. Incheck:changed, only the known base failures fail (remote-parentfixture, the tailscale host leak), both fixed in test: fix the tests that fail on the sandbox branch itself #69.Claude Opus 5.5 via Claude Code.
🤖 Generated with Claude Code