Skip to content

[codex] Queue subagent completion announces#76927

Draft
steipete wants to merge 1 commit into
mainfrom
fix/subagent-completion-announce-queue
Draft

[codex] Queue subagent completion announces#76927
steipete wants to merge 1 commit into
mainfrom
fix/subagent-completion-announce-queue

Conversation

@steipete

@steipete steipete commented May 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Route subagent completion announces through the requester session steer/announce queue before direct fallback.
  • Force completion handoffs onto an internal queue independent of channel queue mode, while preserving bound route delivery.
  • Keep direct expectFinal announce delivery only as fallback when queue routing is unavailable, and avoid retrying gateway timeout failures before direct message fallback.

Root Cause

Completion-mode announces were direct-first and used synchronous gateway agent calls with expectFinal, so a busy or stuck requester session could leave direct announce turns waiting behind active work and trigger repeated 120s timeout retries.

Validation

  • pnpm test src/agents/subagent-announce-dispatch.test.ts src/agents/subagent-announce-delivery.test.ts src/agents/subagent-announce.format.e2e.test.ts src/agents/subagent-announce.timeout.test.ts src/agents/subagent-registry-lifecycle.test.ts
  • pnpm exec oxfmt --check --threads=1 src/agents/subagent-announce-dispatch.ts src/agents/subagent-announce-dispatch.test.ts src/agents/subagent-announce-delivery.ts src/agents/subagent-announce-delivery.test.ts src/agents/subagent-announce.format.e2e.test.ts src/agents/subagent-announce.timeout.test.ts src/agents/subagent-registry-lifecycle.test.ts
  • git diff --check
  • Testbox pnpm check:changed: https://github.com/openclaw/openclaw/actions/runs/25289933276

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels May 3, 2026
@clawsweeper

clawsweeper Bot commented May 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

Summary
The branch routes subagent completion announces through the requester session queue/steer path before direct fallback, avoids retrying direct gateway timeouts, and updates focused tests, docs, and changelog.

Reproducibility: yes. Source inspection gives a high-confidence reproduction path: current main sends completion announces direct-first and retries gateway timeout as transient before queue fallback; I did not run a live busy-session reproduction in this read-only pass.

Next step before merge
The PR is draft, protected by the maintainer label, and needs current-head validation rather than a narrow automated repair.

Security
Cleared: The diff touches agent announce routing, tests, docs, and changelog without adding dependencies, CI permissions, secrets handling, or package-resolution changes.

Review details

Best possible solution:

Undraft after maintainer review, rerun current-head changed/targeted validation, then merge the queue-first completion announce path if checks remain green.

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

Yes. Source inspection gives a high-confidence reproduction path: current main sends completion announces direct-first and retries gateway timeout as transient before queue fallback; I did not run a live busy-session reproduction in this read-only pass.

Is this the best way to solve the issue?

Yes. The PR uses existing queue/steer and fallback machinery rather than adding a new routing system, but it still needs maintainer review and current-head validation before merge.

What I checked:

Likely related people:

  • steipete: Recent main-branch history on subagent announce delivery, dispatch, queue behavior, route helpers, and docs; also authored multiple current-main commits in this exact surface before this PR. (role: recent maintainer and adjacent owner; confidence: high; commits: 9e9df8f2c578, 33e527d1fcc2, 30a2b3049ae0; files: src/agents/subagent-announce-delivery.ts, src/agents/subagent-announce-dispatch.ts, src/agents/subagent-announce-queue.ts)
  • Udjin79: Introduced the busy-session announce queue deferral behavior that this PR builds on when forcing completion delivery through the queue path. (role: related queue behavior contributor; confidence: medium; commits: 1841dd9977cb; files: src/agents/subagent-announce-queue.ts, src/agents/subagent-announce-delivery.ts)
  • DolencLuka: Contributed thread-bound subagent completion fallback behavior in the same dispatch/delivery surface. (role: related completion fallback contributor; confidence: medium; commits: 325e5e921fd6; files: src/agents/subagent-announce-delivery.ts, src/agents/subagent-announce-dispatch.ts)
  • vincentkoc: Recent history includes fallback subagent completion delivery and subagent docs work in the reviewed area. (role: adjacent completion delivery and docs contributor; confidence: medium; commits: a1b656705992, bf2c992a8627, 1427c3a78d80; files: src/agents/subagent-announce-delivery.ts, docs/tools/subagents.md)

Remaining risk / open question:

  • Latest-head validation is not proven by the PR body: the linked Testbox run is cancelled and belongs to an older SHA, while current head check-runs are mostly skipped.
  • This read-only review did not execute the targeted tests or a live busy-requester reproduction.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 990f931a2efc.

Re-review progress:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant