fix: 岗位会商本轮只允许 present_files 一次,避免重复产物卡

弱模型写完报告后仍会再调用一次 present_files,前端会画出两张相同卡片。上限同时覆盖呈现,已呈现则只催收尾。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
董宏凯andCursor committed 2026-08-23 21:26:57 +08:00
1 parent b81d200eca
commit 541bc3280f
5 files changed
+443 -75

No files matched your search

+7 -6
View File
@@ -534,12 +534,13 @@ that exact answer as the required Markdown artifact in the owning thread's
**Per-turn outputs write cap (弱模型防重复产物)**: ordinary position-node chats
and the summary builtin send run-context `position_artifact_cap: 1` (whitelisted
in `services.merge_run_context_overrides`). `PositionArtifactCapMiddleware`
then keeps at most one successful `/mnt/user-data/outputs/` `write_file` per
user turn — truncates excess tool calls in the same model response (and syncs
raw provider `additional_kwargs.tool_calls`), rejects further writes after an
`OK` or an earlier sibling in the same batch, ends the turn when only excess
writes remain, and reminds the model to `present_files` / wrap up. **Action-plan
does not send the flag** (it must write report `.md` +
then keeps at most one successful `/mnt/user-data/outputs/` `write_file` **and**
one `present_files` per user turn — truncates excess tool calls in the same
model response (and syncs raw provider `additional_kwargs.tool_calls`), rejects
further writes/presents after an `OK` / `Successfully presented files` or an
earlier sibling in the same batch, ends the turn when only excess calls remain,
and reminds the model to present once (or wrap up if already presented).
**Action-plan does not send the flag** (it must write report `.md` +
`action-plan-subtasks.json`). Tests: `tests/test_position_artifact_cap.py`.
### 岗位 (Position) Subscription System