Skip to content

fix(core): make inbox reordering durable and atomic - #44858

Closed
Hona wants to merge 1 commit into
v2from
inbox-reorder
Closed

Hona wants to merge 1 commit into
v2from
inbox-reorder

Conversation

@Hona

@Hona Hona commented Aug 25, 2026 •

Copy link
Copy Markdown
Member

Correctness follow-up to #44683: replaces its existing enqueue/cancel queue-rewrite workaround with one durable, atomic inbox reorder operation. No new desktop UI is introduced.

Durable inbox reorder

Adds POST /api/session/{sessionID}/inbox/reorder with { inboxIDs: string[] }.

  • Publishes one durable reorder event only when queue order actually changes.
  • Preserves stable inbox IDs, payloads, timestamps, and immutable admission sequences.
  • Adds indexed nullable execution-order storage without backfilling existing rows.
  • Preserves original admission order for steers and movement controls.
  • Keeps queued synthetic inputs stationary and rejects invalid permutations or compaction/movement barriers.
  • Never wakes a stopped session.

Correctness improvements

  • Existing drag reordering becomes one atomic request instead of cloning and cancelling queued prompts.
  • Existing position-preserving edits replace only the edited prompt, leaving unrelated prompt IDs unchanged.
  • Reorder events propagate to the existing web client, full TUI, and mini TUI without adding new controls.
  • Public clients, protocol OpenAPI, and API documentation are regenerated.

Verification

  • Focused core coverage validates stable identities, admission sequences, indexed query plans, actual promotion order, steer/control ordering, stationary synthetic input, no-op suppression, and transactional rejection.
  • Client tests validate the HTTP contract and live queue propagation.
  • Existing browser tests verify the same desktop interactions now avoid cloned admissions and unnecessary cancellations.
  • 96 focused core tests, 102 full/mini TUI tests, and all repository typechecks pass.

Depends on #44683.

@Hona
Hona requested review from Brendonovich and a lite review from Copilot August 25, 2026 02:34

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Hona
Hona force-pushed the queue-steer-prompts branch from b872fd1 to a1a9511 Compare August 25, 2026 02:47
@Hona Hona changed the title feat(core): add durable inbox reordering fix(core): make inbox reordering durable and atomic Aug 25, 2026
@Hona
Hona changed the base branch from queue-steer-prompts to v2 August 25, 2026 03:03
@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.

2 participants