Agent ingress HTML-escapes message bodies and silently truncates long bodies

已关闭
#53,224 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@rekram1-node 已经在做这个了。

开始于 2026年10月4日。

评估

这个 Issue 还没有评估数据。

描述

Description

Message bodies arriving at opencode agents via the Slack bridge are corrupted in two silent ways. Nothing errors; the text is just wrong when it lands in agent context, beads, PRs, and shell commands.

Defect 1 — HTML entity escaping (silent, length-preserving)

Message bodies are HTML-escaped on ingress: < → &lt;, > → &gt;, & → &amp;.

Evidence (2026-09-30):

  • An agent sent a raw <main> inside a plain-text sentence; the receiving agent quoted it back still escaped — confirms escaping affects Slack messages themselves, not just downstream tooling.
  • Inbound scope blocks reached agents with &lt;main&gt; and &amp; already escaped.
  • Ruled out: voltron slack-post delivery path, model output — this is a normalising transform on ingress in the harness/context-assembly layer.

Impact: any agent copying an HTML tag, shell metacharacter (>, |, &), or comparison operator out of a bridge message pastes corrupted text into code, beads, PRs, or shell commands. Silent wrong-state.

Defect 2 — long-body truncation (lossy)

Long message bodies are cut off, usually mid-block. Observed three times in one session:

  1. A task group (4 items) arrived entirely absent — heading survived, content did not.
  2. Groups C, D, E of a 138-line source file arrived absent (lines 85–138).
  3. A closing rationale cut mid-sentence.

System details

  • OpenCode version: 1.18.34
  • Operating system: macOS 27.0
  • Slack bridge/client setup: custom fleet bridge (voltron/scripts/slack-post) delivering agent messages into opencode agent sessions; corruption observed on ingress into the agent context layer, after bridge delivery (bridge itself verified clean — entity forms present in agent-received bodies, not in bridge output)

Steps to reproduce

  1. Send any message containing <, >, or & through the Slack bridge to an opencode agent; observe the entity form in the agent's received body.
  2. Send a body above some length threshold; observe truncation mid-block.

Expected behavior

Message bodies arrive byte-identical: raw <, >, & preserved; long multi-block bodies complete.

Ask

  1. Locate the ingress/context-assembly path where entities are escaped and where bodies are truncated.
  2. Preserve raw text on ingress (or provide an explicit escape contract agents can rely on).
  3. Fix or remove the truncation limit — silent mid-block loss destroys task scope.
  4. Regression test: body with <, >, &, and a >2k multi-block message arrives byte-identical.

Cross-reference

  • Linear: MG-1550 (metrograph-ai)
  • Folded bead: MG-1552 (closed, scope merged into MG-1550)
  • Original investigation ruled out: voltron delivery path, model output
主要语言
TypeScript
星标
224k
派生
30k
平均合并
6 小时 48 分钟
30 天内合并 PR
490

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

anomalyco/opencode 的其他 Issue

查看 anomalyco/opencode 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。