Files
Agent-System/.doc/ops/short-term/2026-09-28-attachment-only-turn.md
T
weichen 8f72b6a97c docs(test): 记录附件回合在重载后的 dev 上复验通过
:8080 已换成含本修复的二进制。仅附件得到梳理或解析引导,无关文字先回答再追问。
2026-09-28 02:32:31 +00:00

3.1 KiB
Raw Blame History

title, task_id, status, created, updated, owner, task_type, policy_revision, branch, worktree, base_dev_sha, write_scope, mutex, review_state, integration_state, deployment, cleanup, remote_sync
title task_id status created updated owner task_type policy_revision branch worktree base_dev_sha write_scope mutex review_state integration_state deployment cleanup remote_sync
只上传文档时不再返回裸 HTTP 400 attachment-only-turn-2026-09-28 done 2026-09-28 2026-09-28 Cursor fix AGENTS.md + agent-worktree-workflow @ 2026-09-21 fix/attachment-only-turn-2026-09-28 .worktrees/attachment-only-turn-2026-09-28 3e534bbb39
internal
web
.doc
attachment-only-turn accepted merged_local_dev loaded_dev pending not_requested

只上传文档时不再返回裸 HTTP 400

用户目标与授权

用户只上传文档、不输入文字时,界面显示 请求失败(HTTP_400),助手没有任何回复。授权按已确认方案修复:turn 协议携带附件引用;无文字时做结构化梳理或解析引导,并给出下一步选项;有文字但未要求处理文档时,先回答原文再追问是否总结或更新。

检索

  • 检索词:message cannot be empty、chat/stream、HTTP_400、@latest_upload。
  • catalog overlap 语句探测 hard/soft 均为空。注册时若绑定 intent,会与仍为 active、但运行已结束的 integrate-activation-preview-precheck-2026-09-28(scope .)以及 activation-preview-precheck-2026-09-28(scope .doc+web)发生 same_scope。本次因此不绑 intent/mutex 到目录库,mutex 只写在 CURRENT 认领行。
  • 采纳现有 DocumentSummaryReader、UploadParseStateGuidance 和 PendingExpectation,不新开一条上传通道。

根因

前端允许仅附件发送。POST /api/v1/chat/stream 在 message == "" 时直接 400,且前端不读响应体,信封里的 message cannot be empty 被丢弃。附件从未进入 turn。

修复

  • 空文字且带附件时合成落库句「已上传文档:《文件名》」,并把附件引用放进当轮上下文。
  • 无文字:解析未完成则说明状态并询问;正文可读则梳理、审阅并挂 1/2/3 选项(总结、说明如何修订、先不处理)。
  • 有文字但意图没有消费文档:正常回复后追加一次追问。
  • 聊天 SSE 的 4xx 读取信封;VALIDATION 展示具体原因,而不是 HTTP_400。

验证

见 测试报告。代码候选 cb4d2af8 已在 local dev。./scripts/launch.sh --no-docker 于 2026-09-28 10:22(+0800)重建 bin/agent-server 并重启 :8080(pid 1002830,schema 78)。同一 Vite(:3100)上仅附件发送得到梳理与审阅,无关文字先回答再追问。

范围外

历史任务气泡重放 tasks/runs/.../events 的 HTTP/2 错误和 502 与这次 400 无因果关系,见 ISSUE-20260928-task-run-replay-502。

五态

  • review_state: accepted(dev 浏览器三条路径已复验)
  • integration_state: merged_local_dev(代码 cb4d2af8,第一父 63144067)
  • deployment: loaded_dev(bin/agent-server 10:22 +0800,pid 1002830,/health schema 78)
  • cleanup: pending
  • remote_sync: not_requested