Skip to content

fix(app): reply to subagent permission prompts#28651

Open
MingyooLee wants to merge 7 commits into
anomalyco:devfrom
MingyooLee:fix/app-subagent-permission-reply
Open

fix(app): reply to subagent permission prompts#28651
MingyooLee wants to merge 7 commits into
anomalyco:devfrom
MingyooLee:fix/app-subagent-permission-reply

Conversation

@MingyooLee
Copy link
Copy Markdown

@MingyooLee MingyooLee commented May 21, 2026

Issue for this PR

Fixes #26907
Related to #27436
Supersedes/complements #26905

This PR intentionally does not address TUI-specific Enter/mouse interaction issues such as #27302, #27875, or #7966. Those use the TUI prompt code path and should be handled separately.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Web/Desktop app permission prompts for nested subagent sessions could get stuck or reply through the deprecated session-scoped permission response path. This is especially visible when a child session asks for permission but the parent session composer renders the prompt.

User-visible impact: the prompt can appear normally and the user can click Allow once or Allow always, but the pending tool call may not unblock. From the user perspective, the approval button was clicked but the assistant remains stuck waiting for permission, so the Web/Desktop session cannot continue. This makes the Web/Desktop flow difficult to recover from: the user has already approved the prompt, but the assistant remains blocked with no clear next action.

This PR updates the app permission flow to use the request-scoped reply endpoint consistently:

  • manual composer actions now call permission.reply({ requestID, reply })
  • auto-responded permissions now call the same request-scoped reply endpoint
  • confirmed replies remove the matching permission from the local sync cache immediately
  • nested subagent permission prompt E2E coverage asserts the deprecated session-scoped endpoint is not called

Relationship to #26905

#26905 fixes the stale UI portion by clearing the local permission cache after a successful response, but it still uses the deprecated permission.respond / session-scoped response path.

This PR builds on that fix by also switching both manual and auto-responded app permissions to the canonical request-scoped permission.reply endpoint, and by adding regression coverage for a nested child-session permission rendered in the parent composer.

How did you verify your code works?

  • bun typecheck from packages/app
  • PLAYWRIGHT_SERVER_PORT=4097 PLAYWRIGHT_PORT=4445 bun run test:e2e:local -- e2e/smoke/session-permission.spec.ts from packages/app
  • bun test --preload ./happydom.ts ./src/context/global-sync/event-reducer.test.ts from packages/app
  • bunx oxlint packages/app/src/context/permission.tsx packages/app/src/pages/session/composer/session-composer-state.ts packages/app/e2e/utils/mock-server.ts packages/app/e2e/smoke/session-permission.spec.ts
    • Result: 0 errors; 4 existing warnings in unchanged nearby code
  • pre-push hook: bun turbo typecheck

Screenshots / recordings

No visual change. The E2E test verifies that clicking Allow once on a nested subagent permission prompt sends POST /permission/{requestID}/reply, does not call the deprecated /session/{sessionID}/permissions/{permissionID} endpoint, and removes the prompt from the composer.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

MingyooLee and others added 2 commits May 21, 2026 22:01
Use the request-scoped permission reply endpoint for manual and auto-responded app permission prompts, and clear confirmed prompts from local sync state.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add Playwright coverage for a parent composer replying to a child session permission prompt through the request-scoped endpoint, and assert the deprecated session-scoped endpoint is not used.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@MingyooLee MingyooLee requested a review from adamdotdevin as a code owner May 21, 2026 13:05
@github-actions
Copy link
Copy Markdown
Contributor

ghost commented May 21, 2026

The following comment was made by an LLM, it may be inaccurate:

Found related PR:

The current PR explicitly states it "Supersedes/complements #26905", so this is an intended follow-up rather than a duplicate.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(app): permission prompt remains stuck after approving child session request

1 participant