Wrap delegated tasks in explicit XML context tags.

This commit is contained in:
CREDO23 2026-04-30 12:06:33 +02:00
parent 5148f5dfef
commit cdb307361a

View file

@ -11,5 +11,12 @@ def compose_child_task(task: str, *, curated_context: str | None = None) -> str:
""" """
task = task.strip() task = task.strip()
if not curated_context or not curated_context.strip(): if not curated_context or not curated_context.strip():
return task return f"<delegated_task>\n{task}\n</delegated_task>"
return f"{curated_context.strip()}\n\n---\n\nTask:\n{task}" return (
"<delegated_context>\n"
f"{curated_context.strip()}\n"
"</delegated_context>\n\n"
"<delegated_task>\n"
f"{task}\n"
"</delegated_task>"
)