Skip to content

[Drive-by] per-model render-tag / tag-echo option (from #7440 suggested fix #2) #7442

Open

Description

@ranxianglei

🤖 Powered by ework · qwen3.8-27b

found-in: #7440 (opencode tag-echo degenerate loop) + PR #7441 (the nudge fix)

symptom/trigger: a user who wants to change render-tag mode (or tag-echo behavior) for ONE model has no per-model knob — diagnostics.renderNone is global, and the only per-model escape is x-bili-passthrough: 1, which bypasses billion-context entirely for that model (no compression). So the user must choose between (a) disabling render tags for every model or (b) disabling compression for the one model that misbehaves.

This is a config-surface change (owner-design territory per AGENTS.md), so it is filed for a decision rather than built.

decision options:

  • Option A — per-model render-tags override. A config mapping model → renderTags ("text-only" | "none"), resolved per-request in the prepare-* lanes (where renderStrategy is already computed from the global knobRenderNone()). Cost: one new config field (a model→mode map) + per-request lookup; the existing global diagnostics.renderNone stays as the default. Maps directly onto the existing renderTags concept, so no new mechanism — just a per-model key.
  • Option B — per-route render-tags override. Same idea keyed by upstream route instead of model. Cost: similar, but route keys are less stable than model names and the user's mental model is "this model", not "this route".
  • Option C — do nothing. The [PR] fix(plugin): tag-echo degenerate retry now forbids the render tags (#7440) #7441 nudge fix breaks the degenerate loop, so the workaround is less necessary; a heavily-conditioned model may still occasionally echo tags but the retry now recovers. Cost: the user still cannot prevent the conditioning at the source (the model keeps seeing tags in history) and may still see occasional tag-echo retries.

recommendation: Option A (per-model render-tags override). It is the narrowest change, maps onto the existing renderTags concept, and lets the user set renderTags: "none" for the one model that gets conditioned on the tags — preventing the echo at the source instead of only recovering from it. Blocks on: owner sign-off on the new config field (name, shape, default) before implementation.

查重: 无 (no existing issue/PR proposes a per-model render-tags or tag-echo knob; the closest are the global diagnostics.renderNone and the per-model x-bili-passthrough bypass, neither of which is a render-tag knob).


Mirrored from ework issue #7443

Activity

  1. ranxianglei commented on Nov 21, 2026

    @ranxianglei
    OwnerAuthor

    🤖 Powered by ework · qwen3.8-27b

    🔶 需要决策

    Background (one line): #7440's degenerate tag-echo loop is broken by PR #7441's nudge fix, but a user who wants to change render-tag mode for ONE model still has no per-model knob — diagnostics.renderNone is global, and the only per-model escape (x-bili-passthrough: 1) bypasses compression entirely.

    Verified (live code check — the analysis holds):

    • renderNone() (src/knobs.ts:877) reads the global diagnostics.renderNone (or ACP_RENDER_NONE env) — a single boolean, no per-model key.
    • renderStrategy is computed per-lane from that global knob in all four prepare lanes: prepare-openai.ts:106, prepare-google.ts:119, prepare-responses.ts:177, prepare-anthropic.ts:185 — all knobRenderNone() ? "none" : "text-only".
    • x-bili-passthrough: 1 (src/server/handle.ts:399) is a per-request passthrough that skips compression entirely — a bypass, not a render-tag knob.

    So the issue's analysis is correct: there is no per-model render-tag knob today.

    Open question: Should we add a per-model render-tags override?

    Options (each with cost):

    • A — per-model render-tags override. A config mapping model → renderTags ("text-only" | "none"), resolved per-request in the prepare-* lanes. Cost: one new config field (model→mode map) + per-request lookup; the global diagnostics.renderNone stays as the default. Maps onto the existing renderTags concept — no new mechanism.
    • B — per-route render-tags override. Same idea keyed by upstream route. Cost: similar, but route keys are less stable than model names; the user's mental model is "this model", not "this route".
    • C — do nothing. The [PR] fix(plugin): tag-echo degenerate retry now forbids the render tags (#7440) #7441 nudge fix breaks the degenerate loop, so the workaround is less necessary. Cost: the user still cannot prevent the conditioning at the source (the model keeps seeing tags in history) and may still see occasional tag-echo retries.

    My recommendation: Option A. It is the narrowest change, maps onto the existing renderTags concept, and prevents the echo at the source instead of only recovering from it.

    Default if no decision: Option C (do nothing) — the #7441 nudge fix already breaks the degenerate loop, so the status quo is safe; this is a convenience/robustness improvement, not a blocker.

    Label: I attempted to apply the needs-decision label, but the mirror's labels API is not implemented ("endpoint not implemented in ework shim") and tools/add-label.sh does not exist in this workdir — so the label could not be applied. Flagging this so it is not mistaken for an oversight.


    结构化八问(决策请求):

    1. 是什么问题: 用户想对单个模型改 render-tag 模式(或 tag-echo 行为)时没有 per-model 开关——diagnostics.renderNone 是全局的,唯一 per-model 出口 x-bili-passthrough: 1 会绕过整个压缩。
    2. 什么原因导致的: renderNone() (src/knobs.ts:877) 读全局 diagnostics.renderNone,四条 prepare-* 车道用这个全局布尔算 renderStrategy,没有 per-model key;配置面设计时只做了全局开关,没留 per-model 维度。
    3. 影响范围与严重程度(按选项):
      • A: 影响显式配置了 per-model renderTags 的用户;新增字段默认空 = 用全局,不改变现有行为。严重程度:可控性/健壮性提升,非可用性缺陷。
      • B: 同 A,但 key 是 route,稳定性更差。
      • C: 不改变任何行为;用户仍无法从源头阻止 conditioning。
    4. 怎么修复的(推荐 A 的修法思路): 新增配置字段(如 diagnostics.renderTagsByModel: Record<string, "text-only" | "none">),prepare-* 车道算 renderStrategy 时先查 per-model map,miss 回退全局 knobRenderNone()。复用现有 renderTags 概念,无新机制。
    5. 是否有回归问题(按选项):
      • A: 无新字段时行为不变(回退全局);新增字段只影响显式配置的 model。
      • B: 同 A,但 route key 漂移可能意外命中/miss。
      • C: 无回归(不改任何东西)。
    6. 是否破坏缓存: A/B 会改变对应 model/route 的出站字节(renderTags text-only → none),该 model 的 prefix cache 失效一次——但这是用户显式配置的,非静默漂移;C 不影响缓存。
    7. 是否改了设计方向: A/B 在现有 renderTags 概念上加 per-model 维度,不改架构/边界/数据流;C 不改。
    8. 是否引入了新的配置: A 引入 diagnostics.renderTagsByModel(model→mode map,默认空);B 引入 diagnostics.renderTagsByRoute;C 不引入。

    选项对比表:

    选项 改动面 key 稳定性 用户心智 能否从源头阻止 echo 回归风险
    A (per-model) 1 新字段 + per-request lookup 高(model 名稳定) "这个模型" 是 低(无新字段时行为不变)
    B (per-route) 1 新字段 + per-request lookup 低(route 易变) "这个路由" 是 中(route 漂移)
    C (不动) 无 — — 否(只能恢复) 无

    判定: 等 owner 拍板(A/B/C)。不决定的默认行为 = C(不动)。

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