Repository navigation
Pi subagents: permission prompts only appear in the child thread #17623
Closed
SpyrosPsarras
started this conversation in
Ideas
Replies: 1 comment
|
Note Grok responding on behalf of Julius. Thanks for the detailed trace. The core problem here, a delegated child blocking on an approval or question while the parent shows nothing, is already tracked in #15082, so I'm closing this as a duplicate to keep the discussion in one place.
If you want to push the Pi-specific env var, adding that detail (and the pi-permission-system docs link) as a comment on #15082 or #12286 is the best place for it. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
When a Pi thread delegates a task to a Pi subagent (
delegate_task) and the child hits a permission prompt, the prompt only appears in the child thread. The parent thread shows nothing, and the subagent sits waiting until someone opens the child thread and answers. If you mostly work in the main thread, a delegated task just looks stuck.This comes up with
@gotgenes/pi-permission-system, which raises anaskas an extensionselectdialog. T3 turns that into auser_input_requeston the thread that owns the Pi process, which is the child.Reproduction
@gotgenes/pi-permission-system40.1.2 as a Pi package, with its default config. That config already makes opaque wrappers such asbash -canask.delegate_taskwithproviderInstanceId: "pi"and a task that runsbash -c 'echo probe'.pendingRequestCount: 1, auser_input_request"Permission Required … rule: " with statuswaiting, and the run isrunning.pendingRequestCount: 0and no prompt, and the task staysworkingwith no sign that it needs input.Versions: T3
0.0.46-nightly.20261009.2873(server on Linux, web client), Pi 1.1.0, pi-permission-system 40.1.2. Onmainat b1ec4b3 the relevant code looks unchanged.Why it happens
pi-permission-system already supports forwarding a subagent's
askto its parent session's dialog. For a child that runs as its ownpiprocess, it needs one env var at spawn,PI_SUBAGENT_PARENT_SESSION=<parent Pi session id>(subagent integration docs). The parent session serves the forwarded requests and answers them in its own dialog.T3 builds each Pi child's environment in
buildPiRpcLaunchfrom the provider's own environment and never names a parent. The child therefore thinks it is a top-level interactive session and prompts locally.Possible directions
These are options for a maintainer to choose from, not an implementation I'm asking you to take:
PI_SUBAGENT_PARENT_SESSIONto the parent thread's Pi session id. Permission prompts then show up in the parent thread, where pi-permission-system already serves them, and the child resumes once the parent answers. It relies only on that package's documented convention, and nothing changes for users who don't install it.Is either direction something you'd accept? If you prefer option 1, I can open a focused PR with a test for the launch environment.
What I couldn't check: whether the parent's prompt shows up while the parent has no active turn (for example, when it ended its turn waiting for the task notification). The trace above shows the prompt is never forwarded in the first place.
Investigated and drafted by Claude Opus 5.5 in the Pi harness inside T3 Code, posted from @SpyrosPsarras's account at his request.
All reactions