Skip to content

fix(chat): settle image-only prompts by message ID - #488

Open
andrebrait wants to merge 1 commit into
mainfrom
fix/image-outbox-settlement
Open

andrebrait wants to merge 1 commit into
mainfrom
fix/image-outbox-settlement

Conversation

@andrebrait

@andrebrait andrebrait commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Advertise the bundled runner's existing client-message correlation support in get_state, so outbox dispatch uses exact message IDs instead of legacy text matching.
  • Preserve correlated queue IDs in state snapshots for reconnecting consumers.
  • Add real runner-channel regressions for an image-only prompt negotiated through get_state and queue snapshot identity.

Root cause

The runner implemented correlation but never advertised supportsClientMessageIds. The outbox therefore sent image-only prompts without IDs and waited for the queue label [Image] to match an echoed message whose text is empty. The screenshot reached omp while its held thumbnail remained Delivering….

Verification

  • Both new regression cases failed before the fix (missing message ID and missing queue IDs).
  • bun test --parallel runner/test/channel.test.ts runner/test/correlation.test.ts lib/message-outbox-review.test.mjs lib/message-outbox.test.mjs: 114 passed, 0 failed.
  • ./node_modules/.bin/tsc --noEmit -p runner/test/tsconfig.json: passed.
  • ./node_modules/.bin/eslint runner/src/commands/model.ts runner/test/channel.test.ts: passed.

No browser visual check or production deployment. Existing running runner processes need replacement to use the fix; this does not retrospectively identify previously uncorrelated messages.

Summary by CodeRabbit

  • Bug Fixes
    • Delivered screenshot prompts now settle against the correct message, and queued message IDs are retained in state snapshots after reconnects.

@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Explain Change →

Walkthrough

The runner state now reports client message ID support and includes queued client message IDs when available. Tests cover correlation for image-only prompts and queued messages during reconnect state.

Changes: Client message ID state reporting

Layer / File(s) Summary
Report and validate client message IDs
runner/src/commands/model.ts, runner/test/channel.test.ts, CHANGELOG.md
sessionState reports client message ID support and includes queued client message IDs when available. Tests cover image-only prompt correlation and queued message IDs in state snapshots. The changelog records these changes.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: gtanger

Security architecture risk: Minimal · up to 776de

This update improves confirmation of image-only messages without adding a new access path or permission. No material new security, failure-containment, or rollback risk was identified in the inspected change.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The inspected change affects identity reporting and delivery confirmation within an existing session. It does not introduce another command, destination selector, or privileged operation. The HTTP state route forwards the existing session response, so the added queue metadata can also reach existing state consumers.

Trust Boundaries and Controls

  • observed — Host commands continue to dispatch through an own-property command-table lookup against the channel's captured session. The correlated message command uses the same session ID, owner, and advisor inputs as before; the newly advertised ID changes confirmation evidence, not those authority inputs.

Resilience and Maintainability Implications

  • observed — The activated path retains ordered runner admission, conditional single-delivery claiming, and explicit cleanup. Cancelled or failed unbound claims are released; locally consumed claims are resolved. Lost confirmation and interrupted delivery are represented as potentially sent failures rather than silently establishing delivery or automatically replaying an uncertain write.
Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix(chat): settle image-only prompts by message ID" names the main change. The objectives say the runner did not advertise supportsClientMessageIds in get_state, so outbox dispatch fell bac…
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.
Full details: Title check

Explanation

The title "fix(chat): settle image-only prompts by message ID" names the main change. The objectives say the runner did not advertise supportsClientMessageIds in get_state, so outbox dispatch fell back to text matching for image-only prompts and left thumbnails at Delivering. The changeset adds supportsClientMessageIds: true and clientMessageIds to queuedMessages in runner/src/commands/model.ts, a CHANGELOG entry, and regression tests for image-only prompts and queue correlation. The title is specific, concise, and follows the conventional-commit style. It does not mention the queue-ID snapshot fix, which is secondary.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ast-grep (0.51.1)

graphify-out/graph.json

ast-grep skipped this file: it is too large to scan (9375345 bytes)

Checkov (3.3.30)

graphify-out/graph.json

Checkov skipped this file: it is too large to scan (9375345 bytes)

Review coverage is incomplete: 1 file could not be fully reviewed. Findings from completed review steps are included; see review info for details.

Usage-based review receipt

  • Mode: Continue automatically
  • Reviewed files: 4
  • Waived: $1.00 (charged $0.00)
  • View usage details

Note

This review exceeded your plan’s limits and used usage-based reviews—free during trial, billed after paid activation unless disabled. Manage usage-based reviews.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5f7bca86-d02b-4d45-9645-1f956763e480
Commits

Reviewing files that changed from the base of the PR and between cd88954 and 776de4c.

Files selected for processing: 4

  • CHANGELOG.md
  • graphify-out/graph.json
  • runner/src/commands/model.ts
  • runner/test/channel.test.ts
Files not reviewed because the changes were too large to process: 1

  • graphify-out/graph.json

Limit details: You’ve used all 10 included reviews currently available.

This branch has not been deployed

No deployments
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.

1 participant