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:
@@ -88,7 +88,8 @@ class FocusAreaAgent(BaseAgent):
|
||||
parts = [
|
||||
f'The user\'s most active focus area is "{top.label}" '
|
||||
f"({top.task_count} task{'s' if top.task_count != 1 else ''}, "
|
||||
f"{top.overdue_count} overdue)."
|
||||
f"{top.overdue_count} overdue). "
|
||||
f"(Note: task titles may be in any language — always write the tip in English.)"
|
||||
]
|
||||
if boosted:
|
||||
parts.append("This area matches the user's stated focus preferences.")
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user