Skip to content

desktop: "Message not found" 404 toast after revert + resubmit #51502

Closed as not planned

Description

@eltPlay

Summary

After reverting a session to an earlier user message and immediately resubmitting, the desktop client shows a "请求失败 / Message not found: msg_..." error toast. The server returns 404 for a message ID that was discarded during the revert + resubmit race. No data loss, but the error toast is confusing and looks like a failed request.

Environment

  • opencode version: 2.0.18
  • OS: Windows_NT 10.0.26200 (win32 x64), OpenCode Desktop app
  • Terminal: n/a (desktop app)
  • Shell: PowerShell 7 (portable)
  • Install/channel: latest (release)
  • Active plugins: @prevalentware/opencode-goal-plugin, local handoff-on-compact plugin

Reproduction

  1. In OpenCode Desktop, have a session where a turn is running (assistant with tool calls).
  2. Revert the session to an earlier user message (server logs session.revert.stage).
  3. Resubmit the message right away.
  4. Within a few seconds, an error toast appears: 请求失败 — Message not found: msg_0de12f5dc001K7Lx40bwXb7nV3.

Expected Behavior

The client should not fetch a message ID that no longer exists after a revert; no error toast should be surfaced for internal state that was already discarded.

Actual Behavior

The server returns 404 and the desktop app surfaces it as a failed-request toast. Session state remains consistent afterwards (all messages intact, subsequent turns run normally), so this appears to be a transient client/server race, not corruption.

Additional Context

Server log excerpt (~/.local/share/opencode/log/opencode.log, UTC):

timestamp=2026-09-26T14:16:15.850Z message=session.revert.stage sessionID=ses_f222edb3cffdw26p7dWwdKsPze messageID=msg_0de122002001CUFk1zuFlWhkuX
timestamp=2026-09-26T14:16:19.752Z message="Sent HTTP response" http.method=GET http.url=/api/session/ses_f222edb3cffdw26p7dWwdKsPze/message/msg_0de12f5dc001K7Lx40bwXb7nV3 http.status=404

The missing message ID (msg_0de12f5dc001...) was created ~12 ms after the resubmitted user message (msg_0de12f5d0001...) and is absent from the final message list, which suggests the client kept a reference to an assistant message that was replaced or discarded during the revert + resubmit sequence.

Frequency: observed once so far (revert followed by immediate resubmit).

Activity

  1. github-actions commented on Sep 26, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • The bug report template requires a Description field. This report uses Summary instead; please edit it to include the required Description field. The report already contains useful details.

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


    This issue might be a duplicate of existing issues. Please check:

    • #38864: Message not found after revert cleanup leaves orphaned messages and breaks loading a session.
    • #39736: Undo during an admitted-but-unpromoted message fails with Message not found during session revert.

    If you believe this was flagged incorrectly, please let a maintainer know.

  2. github-actions commented on Sep 26, 2026

    @github-actions
    Contributor

    This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

    Feel free to open a new issue that follows our issue templates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions