Skip to content

fix(core): serialize prompt settlement around publication - #52550

Closed
535628443 wants to merge 2 commits into
anomalyco:devfrom
535628443:prompt-settlement
Closed

535628443 wants to merge 2 commits into
anomalyco:devfrom
535628443:prompt-settlement

Conversation

@535628443

@535628443 535628443 commented Oct 1, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #34853

V2 issue linking: This PR targets v2 per its contribution guide. GitHub closing links only apply to the default branch (dev), so the standards workflow flags this existing reference. A maintainer needs to link #34853 manually in Development.

Type of change

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

What does this PR do?

When a live listener delays a form or permission settlement event, another reply can still see the request as pending. Both replies then publish conflicting events and return success.

Claim each request before publishing and release the claim after settlement or publication failure. Form replies and cancellation share the same guard; permissions use it for direct replies, reject/always cascades, and shutdown. Pending state remains available if publication fails, so the caller can retry. Cascade snapshots also recheck ownership after asynchronous permission evaluation.

This covers the current V2 Form and Permission services. The older #44340 targeted the previous QuestionV2/PermissionV2 implementation and was closed unmerged by automated cleanup.

How did you verify your code works?

Refreshed against v2 (a67cf4c3fd) while retaining the upstream permission tests. On macOS, Form/Permission regressions passed all 131 tests, Core typecheck passed, and canonical root bun run check passed (36/36 tasks). Blocked-listener cases cover settlement races, failed publication recovery, cascades, and shutdown.

The same affected tests also passed on Linux arm64 (131 pass); owner package typechecks passed, with build-mode checks forced to avoid stale artifacts.

Screenshots / recordings

N/A — core concurrency behavior.

Checklist

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

@github-actions

github-actions Bot commented Oct 1, 2026

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

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

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

@thdxr
thdxr changed the base branch from v2 to dev October 10, 2026 19:26
@github-actions

github-actions Bot commented Nov 1, 2026

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.

fix(core): serialize V2 prompt settlement around event publication

1 participant