Skip to content

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

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

richuV wants to merge 11 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
All committers have signed the CLA.

@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

This comment was marked as abuse.

@richuV
richuV force-pushed the codex/subagent-permission-hitl-2137 branch from a8fb5fb to d6c46af Compare July 15, 2026 19:11
@richuV

richuV commented Jul 16, 2026

Copy link
Copy Markdown
Author

All required checks and the CLA are now green, and this PR is linked to #2137. Could a maintainer please review it when available? I'm happy to address any feedback or rebase onto the latest main if required.

@oss-maintainer

Copy link
Copy Markdown
Collaborator

⚠️ Merge conflict detected

This PR currently conflicts with main and cannot be merged. Please rebase (or merge main in) and resolve the conflicts:

git fetch origin
git rebase origin/main
# resolve conflicts, then:
git push --force-with-lease

This is a one-time reminder. Feel free to @mention me for a re-review after conflicts are resolved.


Automated notification by github-manager-bot

This branch has not been deployed

No deployments
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