Skip to content

fix(harness): add global progress to subagent completion notifications - #2827

Open
guslegend0510 wants to merge 8 commits into
agentscope-ai:mainfrom
guslegend0510:codex/fix-2792-subagent-progress
Open

fix(harness): add global progress to subagent completion notifications#2827
guslegend0510 wants to merge 8 commits into
agentscope-ai:mainfrom
guslegend0510:codex/fix-2792-subagent-progress

Conversation

@guslegend0510

@guslegend0510 guslegend0510 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add session-scoped task progress to background subagent completion notifications, for example: [3/8 tasks terminal]
  • Count COMPLETED, FAILED, and CANCELLED tasks as terminal
  • Share the same MessageBus wiring logic between static and dynamic subagent middleware
  • Preserve the original notification and wakeup behavior when task progress cannot be queried
  • Remove the duplicated MessageBus wiring implementation from HarnessAgent.Builder

Behavior

Completion notifications now include a best-effort snapshot of the current session's task progress:

Background subagent task 'task-3' (agent=worker) has completed [3/8 tasks terminal].

Tasks from other sessions are not included.
If TaskRepository.listTasks(...) fails, the notification falls back to the original format and is still delivered to the inbox with a wakeup signal.
Testing
Added tests for [1/5 tasks terminal] and [5/5 tasks terminal]
Verified COMPLETED, FAILED, and CANCELLED are terminal, while RUNNING is not
Verified session isolation
Verified fallback behavior when task progress lookup fails
Verified static and dynamic middleware use the same notification format
Spotless passed
agentscope-core: 2294 tests passed
agentscope-harness: 838 tests passed
Closes #2792

@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.77778% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.../harness/agent/middleware/SubagentsMiddleware.java 80.00% 1 Missing and 2 partials ⚠️
...s/agent/middleware/DynamicSubagentsMiddleware.java 66.66% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

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.

[Bug]:Subagent completion notification lacks global progress; SubagentsMiddleware.wireMessageBus is unreachable code

2 participants