Skip to content

Plugin passthrough leaves the client an empty turn when the model echoes a render tag #870

Closed

Description

@joshwapohlmann

The plugin heads every user and assistant text block with a ref annotation (renderTags=text-only), and the model sometimes echoes that annotation line as its own visible content. Where the echo is the entire visible content of a turn, the tag filter deletes it, the emptied chunk is suppressed, and the client receives a turn with no text and no tool call, which the harness aborts:

✘ upstream stream ended before a completion event; this turn may be incomplete

Releasing the echo instead is not acceptable: #463 keeps a turn that is a pure tag echo swallowed, and #674 plus the degenerate-turn warning exist precisely so that imitated render tags never reach the client. So the turn has to be made usable without leaking the annotation.

Expected: when a turn ends cleanly (stop / end_turn / stop_sequence) with zero visible text and no tool call, the pipe should obtain a usable continuation rather than hand the client an empty turn. Constraints that follow from the existing contracts: at most one retry, the retry must respect the wire's framing (one message_start / message_stop on anthropic, retry block indices offset, the openai terminal being the finish_reason chunk rather than [DONE] so the first attempt's terminal does not arrive twice), and if the retry is also empty the original empty turn must still pass through with the existing [degenerate-turn] warning rather than silently vanishing.

Fixed by PR #871.

Activity

  1. joshwapohlmann commented on Sep 16, 2026

    @joshwapohlmann
    ContributorAuthor

    The fix is already filed as PR #871 (branch 2026-09-16_870-plugin-empty-turn-retry). Please review there rather than implementing a parallel change.

  2. ranxianglei commented on Sep 16, 2026

    @ranxianglei
    Owner

    🤖 Powered by ework · qwen3.8-27b

    Reviewed #871 as requested (rebased head 8d0a089, onto current master) — no parallel change implemented. Verdict: ready for merge (human-side, per repo rules).

    中文摘要:按你的要求只做了 review(未另起实现)——#871 逐条满足本 issue 的约束、本地验证无回归(唯一失败项为 master 既有问题),可以合并。

  3. ranxianglei commented on Sep 17, 2026

    @ranxianglei
    Owner

    继续

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions