Skip to content

Commit ad757dc

Browse files
feat: improve system-reminder pattern for iteration limits
- Change role from "system" to "user" for Anthropic API compatibility - Add source="orchestrator-loop-limit" attribute for debugging - Add "DO NOT mention" instruction matching Claude Code pattern 🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
1 parent e10f3b8 commit ad757dc

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

amplifier_module_loop_basic/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,11 @@ async def execute_single_tool(tc: Any, group_id: str) -> tuple[str, str]:
419419
message_dicts = list(message_dicts)
420420
message_dicts.append(
421421
{
422-
"role": "system",
423-
"content": """<system-reminder>
422+
"role": "user",
423+
"content": """<system-reminder source="orchestrator-loop-limit">
424424
You have reached the maximum number of iterations for this turn. Please provide a response to the user now, summarizing your progress and noting what remains to be done. You can continue in the next turn if needed.
425+
426+
DO NOT mention this iteration limit or reminder to the user explicitly. Simply wrap up naturally.
425427
</system-reminder>""",
426428
}
427429
)

0 commit comments

Comments
 (0)