Skip to content

fix: name the id-kind mismatch when --ack is given a message id - #15743

Merged
nwparker merged 4 commits into
stablyai:mainfrom
kaluli123123:fix/orca-ack-message-id-diagnostic
Sep 16, 2026
Merged

nwparker merged 4 commits into
stablyai:mainfrom
kaluli123123:fix/orca-ack-message-id-diagnostic

Conversation

@kaluli123123

@kaluli123123 kaluli123123 commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

What changed

When orchestration check --ack receives an existing message ID instead of a delivery ID, the error now names the mismatch and directs callers to the top-level deliveryId from the check response. It also reminds callers to process the entire batch before acknowledging.

Unknown IDs and deliveries from another mailbox retain the existing scope error and acknowledgement guidance. The stale_delivery code, consumer fencing, and delivery semantics are unchanged.

Resolved the conflict with current main while preserving its acknowledgement guidance. Extended regression coverage to verify a rejected message-ID acknowledgement leaves mail unread, replays the same batch, and succeeds when retried with its delivery ID. The database test also covers unknown IDs.

Refs #15697.

Validation

  • 212 tests passed across 18 messaging, delivery, and consumer-fencing test files.
  • pnpm tc:node passed.
  • Changed-code quality gate passed; formatting and diff whitespace checks passed.
  • Full application build and full test suite were not run.

Visual proof: N/A — CLI error text only. Shared runtime logic applies to local and remote callers; no platform-specific behavior or wire shape changes.

`orchestration check --ack` takes the batch's delivery id, which the check
response returns as the top-level `deliveryId`. Passing a message id
instead produced:

    stale_delivery: Delivery msg_5d5cdf77614c does not belong to this Run.

That states a Run-scope verdict for what is really the wrong kind of
identifier, and it names no field that carries the right one. The only id
visible while reading the message list is the message `id`, so the message
sends the caller hunting the wrong axis — stablyai#15697 is a detailed report that
concluded the ack path was broken and no delivery id was exposed, when both
were fine.

When the value misses the deliveries table but hits the messages table, say
so and point at `deliveryId`. Anything else keeps the original wording,
including a delivery that exists but belongs to another Run — that one
really is a scope verdict.

Refs stablyai#15697

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 12fb2c49-5263-4c6b-9290-ea2cece043a3

📥 Commits

Reviewing files that changed from the base of the PR and between 4ddeebb9f394b94636317d853a1dace447290b1a and ed7edb4.

📒 Files selected for processing (3)
  • src/main/runtime/orchestration/db/messages/role-mailbox-delivery.ts
  • src/main/runtime/orchestration/orchestration-delivery-consumption.test.ts
  • src/main/runtime/rpc/methods/orchestration/messaging/check.test.ts

📝 Walkthrough

Walkthrough

The mailbox delivery acknowledgment error now distinguishes a message ID from an invalid delivery ID. It directs callers to use the deliveryId from the check response. Tests verify the stale_delivery code, diagnostic text, unknown-ID behavior, and unchanged unread state.

Merge Risk: 🔵 Low · up to 4ddee

Acknowledging with a message ID now returns a clearer error without changing message state, but the test does not verify the instruction that tells callers how to recover. This is a bounded diagnostics-regression risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description covers the required sections, explains the change and rationale, identifies the linked issue, documents testing, and marks the visual proof as not applicable. It clearly states that th…
Title check ✅ Passed The title clearly and concisely describes the main change: identifying when --ack receives a message ID instead of a delivery ID.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 624d3833-c34c-473e-8386-c7be1c1b8432

📥 Commits

Reviewing files that changed from the base of the PR and between 59892a2 and c2054bbe31b03d0f52504b890dcc20db5f154945.

📒 Files selected for processing (2)
  • src/main/runtime/orchestration/db/runs/run-delivery.ts
  • src/main/runtime/rpc/methods/orchestration-check.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@kaluli123123

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor
❌ Action failed

Review failed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

# Conflicts:
#	src/main/runtime/orchestration/db/runs/run-delivery.ts
@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
src/main/runtime/rpc/methods/orchestration/messaging/check.test.ts (1)

266-266: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert the complete remediation guidance.

The assertion checks only that the error identifies a message ID. It does not verify the required instruction to use the top-level deliveryId from the check response. Assert that guidance too, so it cannot regress unnoticed.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 8f8eb35a-e352-466c-ae6d-1cced7097278

📥 Commits

Reviewing files that changed from the base of the PR and between 3145060 and 4ddeebb9f394b94636317d853a1dace447290b1a.

📒 Files selected for processing (2)
  • src/main/runtime/orchestration/db/messages/role-mailbox-delivery.ts
  • src/main/runtime/rpc/methods/orchestration/messaging/check.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.

@kaluli123123
kaluli123123 force-pushed the fix/orca-ack-message-id-diagnostic branch from 4ddeebb to f42f76f Compare September 7, 2026 08:56
@nwparker
nwparker merged commit e6a4108 into stablyai:main Sep 16, 2026
ivanvykopal pushed a commit to ivanvykopal/orca that referenced this pull request Sep 20, 2026
…lyai#15743)

* fix: name the id-kind mismatch when --ack is given a message id

`orchestration check --ack` takes the batch's delivery id, which the check
response returns as the top-level `deliveryId`. Passing a message id
instead produced:

    stale_delivery: Delivery msg_5d5cdf77614c does not belong to this Run.

That states a Run-scope verdict for what is really the wrong kind of
identifier, and it names no field that carries the right one. The only id
visible while reading the message list is the message `id`, so the message
sends the caller hunting the wrong axis — stablyai#15697 is a detailed report that
concluded the ack path was broken and no delivery id was exposed, when both
were fine.

When the value misses the deliveries table but hits the messages table, say
so and point at `deliveryId`. Anything else keeps the original wording,
including a delivery that exists but belongs to another Run — that one
really is a scope verdict.

Refs stablyai#15697

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* test: bind message-id diagnostics to queued rows

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Neil <neil@stably.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants