fix(cron): add delivery guidance to cron prompt — stop send_message thrashing (#5444)
Cron agents were burning iterations trying to use send_message (which is
disabled via messaging toolset) because their prompts said things like
'send the report to Telegram'. The scheduler handles delivery
automatically via the deliver setting, but nothing told the agent that.
Add a delivery guidance hint to _build_job_prompt alongside the existing
[SILENT] hint: tells agents their final response is auto-delivered and
they should NOT use send_message.
Before: only [SILENT] suppression hint
After: delivery guidance ('do NOT use send_message') + [SILENT] hint
This commit is contained in:
@@ -730,6 +730,21 @@ class TestBuildJobPromptSilentHint:
|
||||
result = _build_job_prompt(job)
|
||||
assert "[SILENT]" in result
|
||||
|
||||
def test_delivery_guidance_present(self):
|
||||
"""Cron hint tells agents their final response is auto-delivered."""
|
||||
job = {"prompt": "Generate a report"}
|
||||
result = _build_job_prompt(job)
|
||||
assert "do NOT use send_message" in result
|
||||
assert "automatically delivered" in result
|
||||
|
||||
def test_delivery_guidance_precedes_user_prompt(self):
|
||||
"""System guidance appears before the user's prompt text."""
|
||||
job = {"prompt": "My custom prompt"}
|
||||
result = _build_job_prompt(job)
|
||||
system_pos = result.index("do NOT use send_message")
|
||||
prompt_pos = result.index("My custom prompt")
|
||||
assert system_pos < prompt_pos
|
||||
|
||||
|
||||
class TestBuildJobPromptMissingSkill:
|
||||
"""Verify that a missing skill logs a warning and does not crash the job."""
|
||||
|
||||
Reference in New Issue
Block a user