From 6d3161f3cbcc044a0c374350bf23f81cfa90e739 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Fri, 7 Aug 2026 07:01:03 +0800 Subject: [PATCH] fix(agent): align progress updates with Codex cadence --- app/agent/prompt/__init__.py | 12 ++++++++---- tests/test_agent_progress_updates.py | 4 ++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/agent/prompt/__init__.py b/app/agent/prompt/__init__.py index 718017c0..7499f8ce 100644 --- a/app/agent/prompt/__init__.py +++ b/app/agent/prompt/__init__.py @@ -145,12 +145,16 @@ class PromptManager: if not settings.AI_AGENT_VERBOSE: verbose_spec = ( "\n\n[Important Instruction] STRICTLY ENFORCED: " - "Keep tool-related narration concise and useful. " + "Use a concise Codex-style progress cadence. " "For a quick single-step tool call, call the tool directly without a filler acknowledgement. " "For multi-step work or any task that may take noticeable time, send one brief user-facing progress update " - "before the first tool call, then another short update after a meaningful milestone or several tool calls. " - "State what you are checking or what you learned, without exposing hidden reasoning, raw tool arguments, " - "or repetitive per-tool narration. Continue working after each update and finish with a concise final result." + "before the first tool call. While work continues, send another update after a meaningful milestone or " + "several tool calls, and approximately every 30 to 60 seconds whenever you regain control. " + "Keep each update to one or two short sentences that state what you are doing, what you have learned, " + "and what comes next when those details are useful. Vary the wording and do not repeat an unchanged status. " + "Do not expose hidden reasoning, raw tool arguments, or repetitive per-tool narration. " + "Continue working after each update. The final reply must be self-contained and summarize the outcome " + "without relying on the user having read the progress updates." ) # MoviePilot系统信息 diff --git a/tests/test_agent_progress_updates.py b/tests/test_agent_progress_updates.py index d1db3256..513c224a 100644 --- a/tests/test_agent_progress_updates.py +++ b/tests/test_agent_progress_updates.py @@ -14,6 +14,10 @@ def test_non_verbose_prompt_keeps_long_running_tasks_user_visible() -> None: assert "before the first tool call" in prompt assert "after a meaningful milestone or several tool calls" in prompt + assert "approximately every 30 to 60 seconds whenever you regain control" in prompt + assert "one or two short sentences" in prompt + assert "do not repeat an unchanged status" in prompt assert "Continue working after each update" in prompt + assert "The final reply must be self-contained" in prompt assert "remain completely silent" not in prompt assert "DO NOT output any intermediate content" not in prompt