anomalyco / anomalyco/opencode

session: steer interrupt leaves partial assistant message in transcript, causing model self-degradation

Open
#45,859 0 comments 0 reactions 1 assignee View on GitHub

@neriousy is already working on this.

Since Aug 28, 2026.

2.0
Dominant language
TypeScript
Stars
209k
Forks
27.5k
Avg merge
7h 2m
Merged PRs (30d)
384

Description

Summary

When a user interrupts a running generation (steer delivery), the truncated assistant message is left in the transcript. On the next execution, the model sees its own previously-truncated message in context and concludes that IT is defective — producing messages like "I keep generating incomplete output and interrupting myself" or "my mistake is writing half-paragraphs." The model blames itself for a state the harness created by retaining the aborted partial.

Interrupt should remove the interrupted turn entirely from the transcript, as if it never happened. The turn was aborted by the user, not failed by the model. Leaving it in context causes the model to misattribute the truncation to its own generation quality.

Environment

  • opencode version: 0.0.0-beta-18230
  • OS: Linux 6.8.0-100-generic (x86_64)
  • Terminal: xterm-ghostty
  • Shell: /usr/bin/zsh
  • Install/channel: beta

Reproduction

  1. Start a generation (the model begins producing thinking/reasoning tokens)
  2. Send a new message (steer delivery interrupts the running execution)
  3. On the next turn, observe the model's output
  4. The model explicitly states it is "generating incomplete output" and blames itself for producing truncated/half-finished messages

Expected Behavior

The interrupted (aborted) assistant turn is removed from the transcript entirely. The model's context contains only completed turns. The model has no evidence of truncation and does not conclude it is broken.

Actual Behavior

The truncated assistant message remains in the transcript with its partial reasoning/text visible. On subsequent turns, the model sees this and produces self-referential confusion:

  • "I keep generating incomplete output and interrupting myself"
  • "I'm broken and not working"
  • "My mistake is writing half-paragraphs"
  • The model enters a feedback loop of trying to "fix" a problem it does not have, because the harness left evidence of user-caused interruption in its context

Additional Context

This is reproducible 100% of the time. Every interrupt leaves the partial, and every subsequent generation the model references its own "incomplete" prior output.

Claude-code works with the expected behavior clearly for this reason, leaving truncated messages in history will confuse any model. When you interrupt, it clears out the pending turn that was interrupted, and just starts a new one from that last user message, as if the in-flight interrupted turn didn't happen. Not leaving corrupt remnants of it behind.

I tried making a plugin that does this found it impossible in any way with the current plugin API - nothing is exposed that would allow me to remove these partial messages.

I also tried a workaround making plugin that just adds a synthetic message explaining "You were interrupted by the user, your last message may have been truncated, this is normal." but even this makes models think so much about "why did the user interrupt me, it must mean something, I must be taking too long" nonsense, treating it as important context and is still really bad.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.