Skip to content

fix(app): fix permission and question alerts - #56044

Closed
YuriNek0 wants to merge 1 commit into
anomalyco:devfrom
YuriNek0:dev
Closed

YuriNek0 wants to merge 1 commit into
anomalyco:devfrom
YuriNek0:dev

Conversation

@YuriNek0

@YuriNek0 YuriNek0 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #51507
Related: #37120, #48801

Type of change

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

What does this PR do?

The OpenCode V2 notification handler in WebUI only covered for Agent and Errors events. Permissions events never creates system notification or plays sound effects (this includes permission required and question asked by agents events).

Affected notification events in settings:

image

This PR adds handlers for permission.asked and question events. Both request types use the Permissions sound effect setting.

How did you verify your code works?

Tested manually via running bun dev serve --port 9001 in a nix develop shell. After the fix, the WebUI plays sound effects and delivers system notification on 2 affected events.

System notifications delivered:
image
image

Added regression tests in server-notification-state.test.ts.

All tests in packages/app were passed locally. bun run --cwd packages/app test.

Screenshots / recordings

No changes in UI itself.

Checklist

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

Added by the opencode bot (AI-generated).

Fixes #49371

Related: #47479, #45530, #48579

@github-actions

Copy link
Copy Markdown
Contributor

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

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The approach looks right: it adds permission.asked and question form.created handling next to the existing idle and error alerts, using the same open-tab rule (#52204), the same coordinator dedupe and the same auto-approve check the session dock uses. I couldn't check it end to end, since that needs a desktop or browser session with real notifications and sound. The new tests pass here, and 7 of them fail on the base. tsgo -b passes.

Public API: unchanged (only adds the English string notification.question.title).

Two points:

  • Questions use two different setting groups: the sound follows Permissions and the system notification follows Agent (see inline).
  • The new test is a 14-case table with about 150 lines of setup for one handler. packages/app/AGENTS.md asks each test to pay for its upkeep. Could you cut it down to the core contracts: a permission alert, a question alert, no alert when auto-approve is on, no alert once the request is resolved while queued, and the child-request/root-tab case? The per-channel on/off and "other form" rows can go.

Fixes #49371
Related: #47479, #45530, #48579

@usrnk1

usrnk1 commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Opened #60358 building on your request-alert handling, with credit here and a Co-authored-by trailer in the commit. It adds independent Questions notification/sound settings for agent questions and MCP elicitation; permission requests and web search setup stay under Permissions. Thanks for the original fix!

@YuriNek0 YuriNek0 closed this Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants