Local (in-process) agent_spawn drops child PERMISSION_ASKING — no confirm round-trip for local subagents
Summary
When a local subagent finishes its turn with GenerateReason.PERMISSION_ASKING (a tool held for confirmation by the permission system), agent_spawn's result assembly discards everything except Msg.getTextContent() — which is empty for an ASKING result. The parent cannot see that the child is waiting for a confirm, the ASKING ToolUseBlock (with the intercepted call's full arguments) is lost, and there is no local equivalent of the remote pendingConfirms / RemoteConfirmDecision round-trip.
Environment
- AgentScope Java 2.0.4 (
io.agentscope:agentscope-harness:2.0.4, verified against the 2.0.4 sources jar)
Analysis (2.0.4 sources)
- Sync spawn results are stringified from the text content only, in every assembly site:
// AgentSpawnTool.java:1121 (also 481, 658, 1658)
return msg != null ? msg.getTextContent() : "";
For a suspended/ASKING message the text content is empty; the ASKING ToolUseBlock (tool name, call id, full input) is not part of the string.
- The remote path does have a confirm protocol — this is exactly the gap for the local path:
// AgentSpawnTool.java:1398-1407
if (st.isAwaitingConfirm()) {
List<RemotePendingConfirm> pending = st.pendingConfirms() ...
for (RemotePendingConfirm p : pending) {
decisions.add(new RemoteConfirmDecision(p.getToolCallId(), false));
}
}
SubagentsMiddleware(SubagentsMiddleware.java:140) documents timeout-promotion plus automatic<system-reminder>push-back for finished background tasks — but an ASKING child is not "finished"; its promoted background result is likewise reduced to an empty string.
Impact
Applications that gate sensitive tools via the permission context (ASK) and delegate through the official spawn system silently lose the confirmation step for local subagents: no card reaches the user, no decision can come back, and the parent sees an empty task result.
Workaround we currently ship
A two-phase protocol at the prompt level (same shape as the remote pendingConfirms/decisions flow): the child outputs a [awaiting-execution] command checklist as plain text and ends its turn; the parent surfaces its own confirm UI; on approval the parent spawns again with the checklist embedded. Stateless, but it would be much better supported natively.
Expected behavior (suggestions)
- Surface ASKING in the sync/async spawn result, e.g.
status: awaiting_confirm+ the ASKINGToolUseBlockencoded in the tool result so the parent (or the parent's app) can render it; and/or - a local confirm channel mirroring
RemoteConfirmDecision(parent decision → child resumes from the ASKING state).
Related doc/code inconsistency (same area)
The subagent guide states that under force-sync, CTX_FORCE_SYNC_TIMEOUT_SECONDS "positive application values have no 600s ceiling" — but in 2.0.4 resolveEffectiveTimeoutMs clamps the app override through the same MAX_TIMEOUT_SECONDS = 600 as the LLM-supplied value (AgentSpawnTool.java:109-110, ~1543). Either the clamp should not apply to app overrides or the docs should be corrected.