fix(acp-registry): show Droid's reply after a background Task finishes #33207
main fromrefs/pull/33207/head·opened View on GitHubProblem#
With the Factory Droid agent (factory-droid in the ACP Registry), when Droid delegates to a background Task and ends its turn, the Task result and Droid's follow-up reply never show up in the thread. Droid wakes itself when the Task finishes (a task-completion: continuation run) and sends the reply as late session/update frames on the root session. The session/prompt response has already returned, so there is no active turn. The adapter only writes these frames into its in-memory loaded-history snapshot and never opens a new run. The thread looks finished while the real answer exists only in Droid's own session file.
Wire capture and details are in #33186. Droid reports protocolVersion: 1, so followAgentWorkState (needs v2) does not apply.
Change#
In packages/provider-acp-registry/src/server/adapter.ts, set two existing flavor options for factory-droid:
enablePostSettleContinuation: truebuffers the late root-session updates and opens a continuation run.deferFinalizeForBackgroundWork: trueis required with it. The deferred finalize is only scheduled when this flag is on, so without it the continuation run never finishes.
No new mechanism. Grok already uses the same options.
Scope and approval#
Fixes #33186, one defect, a two-line flavor configuration for Droid only. I have not yet got maintainer triage on the issue, so I am opening this for review of the direction. Happy to close it if you prefer a different approach (for example also tracking the Task tool as background work so the UI shows the subagent as running).
Verification#
- New regression test in
AcpRegistryAdapterV2.test.ts("shows Droid's reply after a background Task finishes behind a settled turn"): replays Droid's wire shape (protocol v1, Taskin_progress,end_turn, latecompletedplus follow-up message) and asserts a continuation run opens and contains the follow-up. It fails without the change and passes with it. The whole file passes (34/34). vp run check:changed(format, lint, knip, typecheck, tests) passes.- Manual end to end: ran the dev server from this branch in an isolated home against real Droid 1.6.0 with a prompt that starts a background Task. The thread shows the full follow-up assistant message after "waiting", and the run ends
completed. The dev log showsorchestration-v2.acp-wake-turn-detected. - Not checked: Windows. The issue's Windows report is unconfirmed to share this cause.
Written by Droid (claude-sonnet-5-5) in the Factory Droid harness.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
No actionable comments were generated in the recent review.
Walkthrough
-
The Factory Droid flavor now enables post-settle continuation and deferred finalization for background work. A replay test checks that a late assistant reply appears in a continuation turn.
Changes: Factory Droid continuation
Layer / File(s) Summary Enable and verify late-reply continuation
packages/provider-acp-registry/src/server/adapter.ts,apps/server/src/orchestration-v2/Adapters/AcpRegistryAdapterV2.test.tsThe Factory Droid flavor enables post-settle continuation and defers finalization for background work. The replay test verifies that a late assistant reply is offered as a continuation and then appears as an assistant-message turn item. Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix · Severity of issue fixed: High
Possibly related issues
- Issue 28415 describes the same missing post-settle continuation behavior for the Antigravity ACP flavor. This PR applies the continuation flag to Factory Droid, but does not address the other causes described in that issue.
- Issue 29211 describes dropped Copilot CLI follow-up output when its ACP Registry flavor does not enable post-settle continuation. This PR changes the same gating behavior for Factory Droid, not Copilot CLI.
Possibly related PRs
- pingdotgg/t3code#33194: This PR changes the same Factory Droid flags and adds a late background-Task replay test.
Suggested labels:
bugfixSuggested reviewers:
juliusmarminge,travelvector,macroscopeapp
Merge Risk:
Minimal · up tof1291-
No actionable merge-blocking issue remains in the reviewed continuation change.
Pre-merge checks:
4-
Check name Status Explanation Title check The title names the fix and the affected area: Droid's reply after a background Task finishes. The PR enables two existing flavor options for factory-droid, so the title matches the main change. It is… Description check The description follows the repository template. It has Problem, Change, Scope and approval, and Verification sections. The Problem section gives the expected behavior, the environment (factory-droid,… Linked Issues check Directly linked issue #33186expects the background Task result and the main agent's follow-up to appear in the thread as a continuation run, as the Grok post-settle path does. The diff at adapter.ts …Out of Scope Changes check The non-test change in packages/provider-acp-registry/src/server/adapter.ts adds two flavor options, both limited to the factory-droid branch. Other flavors are unchanged. The test file changes are su… Full details: Title check
-
Explanation
The title names the fix and the affected area: Droid's reply after a background Task finishes. The PR enables two existing flavor options for factory-droid, so the title matches the main change. It is 70 characters and nine words, which fits the single-sentence guideline. It follows the conventional commit form used in the repository template.
Full details: Description check
-
Explanation
The description follows the repository template. It has Problem, Change, Scope and approval, and Verification sections. The Problem section gives the expected behavior, the environment (factory-droid, Droid 1.6.0, protocol v1), and a link to issue
#33186. The Change section names the two flavor options and explains why both are needed. The Scope section links the issue and states that maintainer triage is pending. The Verification section lists the regression test, the passing check run, and a manual end-to-end run, and it names what was not checked (Windows). It also includes the agent model and harness attribution the template asks for. The description is mostly complete.
Full details: Linked Issues check
-
Explanation
Directly linked issue
#33186expects the background Task result and the main agent's follow-up to appear in the thread as a continuation run, as the Grok post-settle path does. The diff at adapter.ts sets enablePostSettleContinuation: true and deferFinalizeForBackgroundWork: true only when registryAgentId === "factory-droid". This matches the issue's suggested fix. The new test 'shows Droid's reply after a background Task finishes behind a settled turn' replays Droid's wire shape (protocolVersion 1, Task in_progress, end_turn, late completed update, follow-up agent_message_chunk). It asserts that one continuation offer opens and that the continuation emits the follow-up assistant_message. The test is the only coding evidence for the fix. I did not run it, and I did not read the flag handling in the provider-acp adapter (the file view was truncated), so runtime behavior rests on the author's reported test result and the test code. Two points are outside the required scope: the issue's 'Actual behavior' notes that the thread gives no sign of ongoing work, but the expected behavior does not require it, and the issue calls tracking the Task as background work a fuller fix. The test asserts only the follow-up text, not the completed Task output. The Windows report is unconfirmed and is not a requirement.
Full details: Out of Scope Changes check
-
Explanation
The non-test change in packages/provider-acp-registry/src/server/adapter.ts adds two flavor options, both limited to the factory-droid branch. Other flavors are unchanged. The test file changes are support for the new regression test: a TestClock import, and a message that uses the configured agentId in an existing assertion. No change touches unrelated behavior, and none expands into the optional background-work tracking described in the issue. The raw summary's mention of Droid elicitation extraction refers to code already present at the base (extractElicitationForm: extractDroidElicitationForm is unchanged in the diff).
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: c4ce7b0
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
df41154f-8134-4851-b06e-b6402a521998
Commits-
Reviewing files that changed from the base of the PR and between c4ce7b0fd74f6beb37ed6034f5c8416e5aa7e165 and f1291c1db5ba04014e46d8210b0b75420e031cd6.
Files selected for processing: 2-
apps/server/src/orchestration-v2/Adapters/AcpRegistryAdapterV2.test.tspackages/provider-acp-registry/src/server/adapter.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
-
zhitiao(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Approvability#
Verdict: Needs Human Approval
Macroscope's review found this PR requires human approval — Droid sessions will automatically wait for background work and surface replies arriving after the initial prompt settles. This changes the default turn lifecycle and requires human confirmation.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).