feat(harness): resume permission-suspended subagent tasks#2177
Conversation
|
|
5e81e3d to
a8fb5fb
Compare
|
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:
Verdict: Well-designed feature with thorough testing. Ready to merge once CLA is signed. Automated review by github-manager |
Summary
Closes #2137.
Why
An async
agent_spawnchild that returnedPERMISSION_ASKINGcould be collapsed into an empty completed result or remainRUNNINGafter 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
PermissionContextStategains an atomic replacement operation with inherited-rule provenance.TaskStatus.WAITINGandTaskSuspensionrepresent a non-terminal permission pause.WorkspaceTaskRepositoryowns suspension persistence, lookup, resume, cancellation races, terminal transition, and delivery.AgentSpawnToolreturns 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:
Full Core/Harness suite:
git diff --checkpasses.