Repository navigation
engine: pin thread identity into task prompts (dual-ledger fix) - #38
Conversation
billion-context discussion #5312: mirror-local numbers drift from GitHub's whenever discussions consume sequence slots, so a bare '#N' named one thread internally and a different thread on GitHub; workers cloned GitHub directly and chased the wrong thread, posting cross-thread bookkeeping instead of answering. - gitea-tracker: parseWebhookEvent extracts issue.kind + issue.upstream_issue_number from mirror payloads (tolerant: legacy payloads stay undefined) - opencode: Engine.identityNote() builds an 'Identity pin' line stating the bare #N is the INTERNAL e-work number (thread kind + upstream GitHub number) and forbidding bare-#N lookups against GitHub; wired into every prompt builder (initial/forward/guard/review + all 5 auto lanes) - tests: identity-pin.test.ts (8 cases); wake-policy backlog calls updated for the new parameter order
[bot] 🏷 查重: 不重复 —— #38 本身就是本次修复的唯一条目(线程内无其他并行工作项)。本条为 [PR] 验收回复:不重做,按「拉分支核对代码 + 验证 + 报告结论」执行。 标签: 核验结论(审核姿态,独立重做)方向关 ✓:根因分析成立且修在污染点上——双账本编号漂移(本地号 vs GitHub 号)是病根,派单提示词只带裸 issueRef 是传播链,worker 直接克隆 GitHub 把裸 #N 拿去上游解析是发作点。修复选在提示词层钉死身份,不是治标。 代码 vs 描述 ✓(逐段读过 squash c7072dc 全 diff):
测试有效性 ✓:identity-pin.test.ts 8 例断言有牙(pin 存在性/缺失性 × 两个 builder + payload 容错/坏类型拒绝),pin 被删或参数序破坏都会红。本地定向跑: 回归清点 ✓(改动前行为逐项过):提示词 builder 新参默认 null → legacy payload 输出逐字节不变(非镜像 tracker/旧 webhook 零影响);live 路径新增 Identity pin 行 = 有意变更(已披露);wake-policy backlog 渲染不变;diff 仅触碰提示词组装与 webhook 解析,无阈值/时序/输出格式漂移。 残留缺口 1 处(不拦):重启对账回填路径(reconcileComments,约 opencode.ts :4804)传的是 结构化八问
判定:核验通过,收工。 squash c7072dc 已在 master tip(owner 已关闭本 issue);唯一残留项由 #39 跟踪,待 owner 决策。 |
现象
billion-context discussion #5312:ework 接单后「前言不搭后语」——机器人两次回复都在谈另一个线程(FineFenng 的 PR),从不回答提问本身。
根因(代码级)
ework mirror 给每个线程编自己的本地号,GitHub 有独立编号体系;一旦讨论区消耗了本地序列槽位,两边同号就指不同线程(本地 #5316=Q&A 讨论 ↔ GitHub #5316=FineFenng 的 PR;本地 #5320↔GitHub #5316)。而派单提示词只带裸 issueRef(gitea-tracker.ts getTrackerInstructions),worker 又直接克隆 GitHub——模型把裸 #N 拿去查 GitHub,查到了另一个线程;后续 op.ts:147 findOrCreateIssue 还会把被污染的标题覆写回内部行(db.ts UNIQUE 键不含 kind 维度)。
修复
版本:daemon 0.4.188 → 0.4.189。squash = c7072dc。