Skip to content

fix(client): preserve live permission updates during list refresh - #52074

Closed
LeoParkerOu wants to merge 3 commits into
anomalyco:devfrom
LeoParkerOu:codex/mcp-permission
Closed

LeoParkerOu wants to merge 3 commits into
anomalyco:devfrom
LeoParkerOu:codex/mcp-permission

Conversation

@LeoParkerOu

Copy link
Copy Markdown

Issue for this PR

Related to #51223

Type of change

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

What does this PR do?

A delayed permission-list response can overwrite a newer permission.asked event, hiding the prompt, or restore a request already resolved by permission.replied. Merge events received during each list request into its snapshot before publishing it. This fixes the demonstrated client race; it does not establish that the race explains every case in #51223.

How did you verify your code works?

Client: 35 tests passed; core permission/MCP: 109 passed; TUI permission/transport: 83 passed. Real Code Mode → stdio MCP → server/SSE → TUI → HTTP approval tests cover live, pre-existing, delayed-list and parallel asks. With the client fix removed, the delayed-list case fails and the other three pass; with the fix all four pass. Root bun run check passed. The integration test imports an outer tool transcript and starts at Tool.execute; it does not use an LLM or exercise the full SessionRunner. The reporter’s Linux/plugin/legacy-session environment is not fully reproduced.

Tested locally on macOS with Bun 1.3.14 (the repository declares 1.4.2); remote CI has not run. The three independent patches also passed combined checks on v2 b30c4d0.

Screenshots / recordings

No new UI is introduced. The regression asserts the actual rendered permission prompt and successful completion after keyboard approval.

Checklist

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

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant