Skip to content

fix(agents): show spawned ACP tasks only once - #153071

Merged
obviyus merged 1 commit into
mainfrom
omp-bug-150402
Sep 19, 2026
Merged

obviyus merged 1 commit into
mainfrom
omp-bug-150402

Conversation

@obviyus

@obviyus obviyus commented Sep 19, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #150402
Related: #122849

What Problem This Solves

Fixes one spawned ACP task appearing twice in Tasks, once as Subagent and once as ACP, even though only one backend execution exists.

User Impact

New ACP child runs have one task card and one canonical task identity to inspect or stop. Existing records are not rewritten. This does not change task retention, restart recovery, stale-task classification, cleanup policy, or session-key adoption.

Why This Change Was Made

The ACP manager already creates the task for the accepted run. ACP spawn now uses the existing Gateway-owned task selector so subagent registration retains the child relationship and controls without creating a second task projection. Ordinary subagent registration is unchanged.

Thanks to @saariuslystoned for the report and @markGenhealth for identifying the overlapping ownership problem in #122849. This narrow duplicate-production fix does not replace or close that broader lifecycle proposal.

Evidence

  • Reproduced on main 0b753f1e15b2: the actual Control UI invoked sessions_spawn(runtime=acp) through an isolated Gateway and normally registered synthetic ACP backend. One held HTTP work request produced two public task IDs and two visible cards.
  • On 32a00c1d4d30, the same flow produced one ACP task ID and one visible card for one backend request. Normal completion succeeded; the remaining card's Stop action cancelled the physical HTTP request and the canonical task.
  • The public subagents tool retained the active ACP child and later listed completed ACP, cancelled ACP, and ordinary subagent children. The ordinary subagent still produced exactly one succeeded subagent task.
  • The real-registration regression failed on the original producer with the extra task IDs; all 101 tests in the two affected spawn suites pass after the fix. Targeted typed lint, formatting, structural ratchets, and the runtime build pass.

The provider and ACP backend are controlled local fixtures. This is actual Gateway/UI and HTTP-boundary proof, not a native Cursor/Codex, live-channel, badge/liveness, or restart-recovery claim.

Inspected before/after screenshots show the same Tasks panel with two cards before and one canonical ACP card after.

@clawsweeper

clawsweeper Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@obviyus

obviyus commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator Author

One ACP execution, one task card

Before — main 0b753f1e15b2: one physical HTTP work request appears as two cards with distinct task IDs: Subagent and ACP.

After — 32a00c1d4d30: the same supported UI → Gateway → sessions_spawn → registered ACP backend flow produces only the canonical ACP card. The public task list agrees with the UI.

These inspected captures contain only a synthetic task label and controlled fixture output. They demonstrate task identity/cardinality, not a badge or liveness change. The two images were taken at different moments in the held request; the progress text and elapsed times are not part of the comparison. No native Cursor/Codex or live-channel behavior is claimed.

Before: one ACP execution appears as both Subagent and ACP

After: one ACP execution has one canonical ACP task card

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS maintainer Maintainer-authored PR labels Sep 19, 2026
@obviyus
obviyus marked this pull request as ready for review September 19, 2026 17:48
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 19, 2026
@clawsweeper

clawsweeper Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 19, 2026, 1:54 PM ET / 17:54 UTC.

ClawSweeper review

What this changes

The PR makes newly spawned ACP child runs use the Gateway’s existing task record, preventing a second task card while preserving subagent registration and controls.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused fix: current main still creates the duplicate projection, and the inspected before/after evidence supports the repair. No blocking correctness findings were found; the broader lifecycle proposal remains separate.

Priority: P2
Reviewed head: 32a00c1d4d30c03034fdb6a6440deea1e38b9427

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow repair reuses the existing owner contract, adds meaningful regression coverage, and includes convincing visual proof.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after screenshots directly show two task cards becoming one through the documented real Control UI and Gateway spawn flow at the reviewed head; the accompanying account reports completion, Stop cancellation, and preserved child listing using a controlled HTTP-backed ACP fixture.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected before/after screenshots directly show two task cards becoming one through the documented real Control UI and Gateway spawn flow at the reviewed head; the accompanying account reports completion, Stop cancellation, and preserved child listing using a controlled HTTP-backed ACP fixture.
Evidence reviewed 9 items Narrow introduced change: The pinned merge-base-to-head patch adds the existing gateway_best_effort selector to ACP registration. The full production module retains initialization, dispatch, admission checks, cleanup, and child registration.
Existing task ownership contract: The registry persists and activates child registration independently of the conditional task creation block. gateway_best_effort skips only that second projection; the ACP manager already creates runtime=acp records. The selector is not persisted as new authority or a new storage format.
Regression protects observable identity: The extended existing authority test uses the real subagent registry and ACP task producer, then checks that accepted work retains one child registration and exactly the canonical ACP task ID. Gateway dispatch is substituted, so this is supplemental regression coverage, not standalone live proof. Tests were not executed during this read-only review.
Findings None None.
Security None None.

How this fits together

ACP spawning starts a child agent through the Gateway. The ACP manager records its execution for the Tasks panel, while the subagent registry tracks the parent-child relationship and controls.

flowchart TD
  A[Child spawn request] --> B[Gateway ACP execution]
  B --> C[Canonical ACP task]
  C --> D[Tasks panel]
  A --> E[Subagent registration]
  E --> F[Child relationship and controls]
  E --> G[Skip duplicate task projection]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +2, Tests +18. Total +20 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 2 0 +2
Tests 2 29 11 +18
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 31 11 +20

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #150402
Summary: This PR is the focused candidate for the duplicate-card report; the broader ACP lifecycle proposal overlaps only part of its scope.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep the ACP manager as the sole producer of new ACP task records while retaining subagent topology and controls, with lifecycle recovery changes handled separately.

Do we have a high-confidence way to reproduce the issue?

Yes: current source shows both task producers reached by ACP spawning, and the supplied before capture demonstrates the duplicate cards. This review inspected source and contributor evidence without executing a current-main reproduction.

Is this the best way to solve the issue?

Yes: selecting the existing Gateway-owned task path removes the duplicate at its producer and preserves registration, avoiding UI filtering or a parallel lifecycle implementation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against e1880e0a6edf.

Labels

Label changes:

  • add P2: Duplicate task cards confuse operators about the number of active workers, but the report establishes one underlying execution rather than duplicate execution or a blocked workflow.
  • add proof: sufficient: Contributor real behavior proof is sufficient. Inspected before/after screenshots directly show two task cards becoming one through the documented real Control UI and Gateway spawn flow at the reviewed head; the accompanying account reports completion, Stop cancellation, and preserved child listing using a controlled HTTP-backed ACP fixture.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before/after screenshots directly show two task cards becoming one through the documented real Control UI and Gateway spawn flow at the reviewed head; the accompanying account reports completion, Stop cancellation, and preserved child listing using a controlled HTTP-backed ACP fixture.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected before/after screenshots directly show two task cards becoming one through the documented real Control UI and Gateway spawn flow at the reviewed head; the accompanying account reports completion, Stop cancellation, and preserved child listing using a controlled HTTP-backed ACP fixture.

Label justifications:

  • P2: Duplicate task cards confuse operators about the number of active workers, but the report establishes one underlying execution rather than duplicate execution or a blocked workflow.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected before/after screenshots directly show two task cards becoming one through the documented real Control UI and Gateway spawn flow at the reviewed head; the accompanying account reports completion, Stop cancellation, and preserved child listing using a controlled HTTP-backed ACP fixture.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected before/after screenshots directly show two task cards becoming one through the documented real Control UI and Gateway spawn flow at the reviewed head; the accompanying account reports completion, Stop cancellation, and preserved child listing using a controlled HTTP-backed ACP fixture.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before/after screenshots directly show two task cards becoming one through the documented real Control UI and Gateway spawn flow at the reviewed head; the accompanying account reports completion, Stop cancellation, and preserved child listing using a controlled HTTP-backed ACP fixture.

Evidence

What I checked:

  • Narrow introduced change: The pinned merge-base-to-head patch adds the existing gateway_best_effort selector to ACP registration. The full production module retains initialization, dispatch, admission checks, cleanup, and child registration. (src/agents/subagents/spawn/acp-spawn.ts:646, 32a00c1d4d30)
  • Existing task ownership contract: The registry persists and activates child registration independently of the conditional task creation block. gateway_best_effort skips only that second projection; the ACP manager already creates runtime=acp records. The selector is not persisted as new authority or a new storage format. (src/agents/subagents/registry/subagent-registry-run-launch.ts:158, 32a00c1d4d30)
  • Regression protects observable identity: The extended existing authority test uses the real subagent registry and ACP task producer, then checks that accepted work retains one child registration and exactly the canonical ACP task ID. Gateway dispatch is substituted, so this is supplemental regression coverage, not standalone live proof. Tests were not executed during this read-only review. (src/agents/subagents/spawn/acp-spawn.authority.test.ts:473, 32a00c1d4d30)
  • Inspected visual and production-path evidence: Both downloaded screenshots were inspected: the before capture displays two cards, Subagent and ACP, and the after capture displays one ACP card. The captured PR body maps these to an actual Control UI → Gateway → sessions_spawn flow with a registered synthetic ACP backend and one HTTP work request, and reports successful completion, physical-request cancellation, and retained child listing. The body-linked evidence is fix(agents): show spawned ACP tasks only once #153071 (comment). This proves task cardinality; differing badges and elapsed times are not treated as evidence of other fixes. (32a00c1d4d30)
  • Still necessary on main and release: The fetched main's ACP registration still omits the selector; its relevant production owners otherwise match the reviewed implementation. The v2026.9.5 tree and ACP spawn blob were also inspected through GitHub REST and omit the selector. No already-merged fixing PR is established. (src/agents/subagents/spawn/acp-spawn.ts:644, e1880e0a6edf)
  • Related work has distinct scope: The open report at Control UI shows one ACP task twice as Subagent and ACP #150402 describes precisely the duplicate-card defect. The acknowledged proposal at fix(agents): preserve ACP lifecycle ownership #122849 remains open and draft, and also covers persisted observer ownership, liveness, recovery, and cleanup. Its supplied evidence lists tests rather than positive runtime proof, so it is not a safe superseding landing candidate.

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@obviyus
obviyus merged commit 3f718b8 into main Sep 19, 2026
283 of 284 checks passed
@obviyus
obviyus deleted the omp-bug-150402 branch September 19, 2026 18:13
@obviyus

obviyus commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator Author

Merged as 3f718b8930a372a2e589eff99e4d0a2ffbf0f635.

New ACP child runs now keep one canonical task instead of creating separate Subagent and ACP cards. The actual UI/Gateway/HTTP reproduction changed from two task IDs for one execution to one; normal completion, physical cancellation through Stop, child topology, and ordinary subagent behavior remained intact. The before/after screenshots are linked from the PR body.

Thanks @saariuslystoned for the report and @markGenhealth for the related ownership analysis. This closes #150402; #122849 remains open for its distinct broader lifecycle work. Existing stored tasks and lifecycle/cleanup policy are unchanged.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 20, 2026
Closes openclaw#150402
Related: openclaw#122849

## What Problem This Solves

Fixes one spawned ACP task appearing twice in Tasks, once as Subagent and once as ACP, even though only one backend execution exists.

## User Impact

New ACP child runs have one task card and one canonical task identity to inspect or stop. Existing records are not rewritten. This does not change task retention, restart recovery, stale-task classification, cleanup policy, or session-key adoption.

## Why This Change Was Made

The ACP manager already creates the task for the accepted run. ACP spawn now uses the existing Gateway-owned task selector so subagent registration retains the child relationship and controls without creating a second task projection. Ordinary subagent registration is unchanged.

Thanks to @saariuslystoned for the report and @markGenhealth for identifying the overlapping ownership problem in openclaw#122849. This narrow duplicate-production fix does not replace or close that broader lifecycle proposal.

## Evidence

- Reproduced on main `b16cb8c0cbe3`: the actual Control UI invoked `sessions_spawn(runtime=acp)` through an isolated Gateway and normally registered synthetic ACP backend. One held HTTP work request produced two public task IDs and two visible cards.
- On `32a00c1d4d30`, the same flow produced one ACP task ID and one visible card for one backend request. Normal completion succeeded; the remaining card's Stop action cancelled the physical HTTP request and the canonical task.
- The public `subagents` tool retained the active ACP child and later listed completed ACP, cancelled ACP, and ordinary subagent children. The ordinary subagent still produced exactly one succeeded subagent task.
- The real-registration regression failed on the original producer with the extra task IDs; all 101 tests in the two affected spawn suites pass after the fix. Targeted typed lint, formatting, structural ratchets, and the runtime build pass.

The provider and ACP backend are controlled local fixtures. This is actual Gateway/UI and HTTP-boundary proof, not a native Cursor/Codex, live-channel, badge/liveness, or restart-recovery claim.

[Inspected before/after screenshots](openclaw#153071 (comment)) show the same Tasks panel with two cards before and one canonical ACP card after.

Co-authored-by: Ayaan Zaidi <[email protected]>
ss-bot-rnd pushed a commit to bodyshopbidsdotcom/openclaw that referenced this pull request Sep 28, 2026
…it settle

An ACP child launched by sessions_spawn(runtime: "acp") woke its requester
twice: once through the subagent completion path and again through the
background-task notification of the task row that mirrors the ACP run.
The mirrored task now uses a silent notify policy for this launch path
only, so the requester gets the single subagent_settle wake. Other ACP
launch paths, native subagents, and the default notify policy keep their
behavior.

Since openclaw#153071 an ACP spawn also keeps only the ACP manager's task row and
no runtime "subagent" projection. The requester settle commit still
required that projection, so each yielded ACP child threw "subagent
completion owner changed before settlement", retried the commit forever,
and replayed its settle turn after a Gateway restart. When the run's only
task row is ACP-owned, settle the subagent delivery state without a task
projection and leave the ACP row to its manager. A child with no task
owner at all still refuses settlement.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Control UI shows one ACP task twice as Subagent and ACP

1 participant