Skip to content

feat(harness): resume permission-suspended subagent tasks#2177

Open
richuV wants to merge 10 commits into
agentscope-ai:mainfrom
richuV:codex/subagent-permission-hitl-2137
Open

feat(harness): resume permission-suspended subagent tasks#2177
richuV wants to merge 10 commits into
agentscope-ai:mainfrom
richuV:codex/subagent-permission-hitl-2137

Conversation

@richuV

@richuV richuV commented Jul 13, 2026

Copy link
Copy Markdown

Summary

  • inherit the complete parent permission context when materializing or reusing a subagent
  • persist permission-suspended background tasks with child-session lineage and resumable state
  • resume approve/deny through Harness and transition the same task to a typed terminal state
  • preserve cancellation, restart, delivery, and user/session isolation semantics

Closes #2137.

Why

An async agent_spawn child that returned PERMISSION_ASKING could be collapsed into an empty completed result or remain RUNNING after approval. The task repository had no typed waiting state or durable resume identity, and reused children did not receive the complete current parent permission context.

This made child HITL impossible to resume reliably without consumer-side polling, private registry access, or a second task/permission owner.

Design

  • PermissionContextState gains an atomic replacement operation with inherited-rule provenance.
  • TaskStatus.WAITING and TaskSuspension represent a non-terminal permission pause.
  • WorkspaceTaskRepository owns suspension persistence, lookup, resume, cancellation races, terminal transition, and delivery.
  • child session lineage is persisted in the subagent registry and exposed through public Harness APIs.
  • AgentSpawnTool returns typed task outcomes and delegates resume execution to the repository/Harness lifecycle.

No consumer-specific code or polling store is introduced.

Verification

Focused Core/Harness contracts:

  • 65 tests, 0 failures, 0 errors

Full Core/Harness suite:

  • 2866 tests
  • 0 failures
  • 0 errors
  • 11 skipped

git diff --check passes.

@richuV richuV requested a review from a team July 13, 2026 12:51
@CLAassistant

CLAassistant commented Jul 13, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@richuV richuV force-pushed the codex/subagent-permission-hitl-2137 branch from 5e81e3d to a8fb5fb Compare July 13, 2026 12:56
@AgentScopeJavaBot AgentScopeJavaBot added enhancement New feature or request area/harness agentscope-harness (test/runtime support) area/core/agent Agent runtime, pipeline, hooks, plan labels Jul 14, 2026

@AgentScopeJavaBot AgentScopeJavaBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

@AgentScopeJavaBot AgentScopeJavaBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

@oss-maintainer

Copy link
Copy Markdown
Collaborator

⚠️ CLA Not Signed

The Contributor License Agreement (CLA) check is currently pending on this PR. This PR cannot be merged until the CLA is signed.

Please sign the CLA at: https://cla-assistant.io/agentscope-ai/agentscope-java?pullRequest=2177


Code Review (pending CLA)

Summary: Comprehensive feature — adds typed HITL suspend/resume for permission-suspended subagent tasks, including durable persistence and resume execution.

Findings:

  • [Info] PermissionContextState atomic replacement with inherited-rule provenance. Good design.
  • [Info] TaskStatus.WAITING and TaskSuspension represent non-terminal permission pause. Clean state machine.
  • [Info] 65 tests, 2866 total suite green. Excellent coverage.

Verdict: Well-designed feature with thorough testing. Ready to merge once CLA is signed.


Automated review by github-manager

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

Labels

area/core/agent Agent runtime, pipeline, hooks, plan area/harness agentscope-harness (test/runtime support) enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Harness: native full subagent permission inheritance and typed async HITL suspension

4 participants