Skip to content

fix(hub): keep ambiguous queued-message cancels indeterminate - #1750

Merged
tiann merged 1 commit into
tiann:mainfrom
welfvh:fix/cancel-ambiguous-87
Sep 6, 2026
Merged

fix(hub): keep ambiguous queued-message cancels indeterminate#1750
tiann merged 1 commit into
tiann:mainfrom
welfvh:fix/cancel-ambiguous-87

Conversation

@welfvh

@welfvh welfvh commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • stop treating a cancel ACK timeout or not-found as proof that the CLI consumed the queued prompt
  • persist the row as indeterminate, publish messages-indeterminate, and return the existing busy response
  • retain the invoked path only for an explicit consumed: true ACK
  • update the mature-scheduled race contract and regression tests

Why

A client pressing Cancel could cause the hub to stamp invoked_at and emit messages-consumed solely because the CLI did not answer or could not find the queue entry. The client then correctly rendered the server-authoritative row as sent, making Cancel appear to deliver the prompt. Timeout/not-found is ambiguous; it is not evidence of model consumption.

Verification

  • bun test hub/src/sync/messageService.test.ts — 52 passed
  • bun run test:hub — 1,209 passed, 3 skipped, 0 failed
  • bun run typecheck:hub — passed

This pull request was generated with AI assistance (OpenAI Codex) and manually reviewed/tested before submission.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Findings

  • None.

Summary

Review mode: initial

No issues found in the added or modified lines. Residual risk: repository code was not executed under this review’s security constraints; static review covered the cancel ACK state machine, concurrent consumed/cancel transitions, SSE propagation, and explicit retry/discard handling.

Testing

Not run (automation). GitHub integration check passed; the main test check was pending at review time.

HAPI Bot

@heavygee heavygee added area:hub Hub server (API, sync, store) bug Something isn't working community-pr PR from non-collaborator contributor labels Sep 4, 2026
@tiann
tiann merged commit 6bad076 into tiann:main Sep 6, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:hub Hub server (API, sync, store) bug Something isn't working community-pr PR from non-collaborator contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants