Skip to content

#796 Retire optimistic sends by client message id - #802

Merged
ivanfenenko merged 2 commits into
mainfrom
fix/796-retire-optimistic-sends-by-client-id
Oct 23, 2026
Merged

ivanfenenko merged 2 commits into
mainfrom
fix/796-retire-optimistic-sends-by-client-id

Conversation

@ivanfenenko

@ivanfenenko ivanfenenko commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Every send that can carry an id sends a client msg_ id in the server's own format: v2 prompt id, v1 prompt_async and command messageID. That id is also the optimistic row id, so the echo retires the row whatever the server does to its text or filenames (skill bodies, expanded templates, renamed files).
  • v2 POST …/command takes no id and its catalog has no template, so its row retires on the first new user message after the send: a user row whose id was not loaded when the send began.
  • Text-and-filename matching is removed on both platforms; the send-time baseline is now the loaded row ids.
  • A waiting steer echo still does not retire a shown row, and a failed send removes only a row that is still pending, so an echo already shown under the same id stays.

Checks

  • Android: full testDebugUnitTest passes; no ktlint findings on changed lines.
  • iOS: full OpenCode MobileTests passes (2,609 tests).
  • Real servers through the scenario harness (v1 1.19.1, v2 dev), both apps: skill prompt, expanded slash command, attachment renamed in transit (throwaway proxy), and send while busy / v2 steer each show one row; request bodies and stored message ids checked for each.

Issue

Risks / Follow-ups

  • A v2 command row gives way to another client's user message if one lands in the same session before the command's echo.
  • Not part of this change, seen while testing: iOS v2 skill prompts show "check ids" without the [/invoice-style] token (Android shows it); v1 slash commands show the expanded template instead of [/name] args on both apps.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith with what you need.

Every send that can carry an id now sends a client msg_ id (v2 prompt `id`,
v1 prompt_async and command `messageID`) and uses it as the optimistic row id,
so the echo retires the row whatever the server does to its text or filenames.
v2 commands take no id: their row retires on the first new user message after
the send. Text-and-filename matching is gone on both platforms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ivanfenenko
ivanfenenko marked this pull request as ready for review October 23, 2026 13:34
Resolve conflicts with #797 inline skill mentions by keeping both the
skill fields and the client message id on prompt and command options.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ivanfenenko
ivanfenenko merged commit e282fe3 into main Oct 23, 2026
2 checks passed
@ivanfenenko
ivanfenenko deleted the fix/796-retire-optimistic-sends-by-client-id branch October 23, 2026 14:05
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.

Retire optimistic sends by client message id

1 participant