fix(agents): instruct orchestrator to output tip in English

Small models (qwen2.5:1.5b) mirror the language of task title content
in the prompt. Adding an explicit English note to snippets that embed
raw task titles (focus-area, overdue-task) prevents language bleed.
Also added the instruction to the orchestrator system prompt and user
message as belt-and-suspenders.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-06 11:53:21 +00:00
parent c124ff4d24
commit afacc34969
3 changed files with 8 additions and 6 deletions

View File

@@ -128,15 +128,15 @@ class OverdueTaskAgent(BaseAgent):
top = sorted(overdue, key=lambda t: -t.get("task_age_days", 0))[:3]
if not overdue:
prompt = "The user has no overdue tasks at this time."
prompt = "The user has no overdue tasks at this time. (Always write the tip in English.)"
elif len(overdue) == 1:
t = top[0]
r = _realness(t.get("project_id"), project_realness)
item = _format_task(t, project_realness)
if r < 0.4:
prompt = f"The user has 1 task past its target date: {item}."
prompt = f"The user has 1 task past its target date: {item}. (Task titles may be in any language — always write the tip in English.)"
else:
prompt = f"The user has 1 overdue task: {item}."
prompt = f"The user has 1 overdue task: {item}. (Task titles may be in any language — always write the tip in English.)"
else:
items = ", ".join(_format_task(t, project_realness) for t in top)
avg_realness = (
@@ -146,7 +146,7 @@ class OverdueTaskAgent(BaseAgent):
label = "tasks past their target dates" if avg_realness < 0.4 else "overdue tasks"
prompt = (
f"The user has {len(overdue)} {label}. "
f"Top {len(top)}: {items}."
f"Top {len(top)}: {items}. (Task titles may be in any language — always write the tip in English.)"
)
snapshot = {