mirror of
https://github.com/shareAI-lab/analysis_claude_code.git
synced 2026-05-07 00:36:18 +08:00
- s03: inject reminder into tool_result instead of mutating history (#37) - s05: SkillLoader uses rglob("SKILL.md") + frontmatter name priority, matching Agent Skills standard (#30, PR #34) - CI: upgrade actions/checkout and actions/setup-node to v6 (#36) - docs: update s05 skill directory structure in all 3 languages
This commit is contained in:
@@ -163,11 +163,7 @@ TOOLS = [
|
||||
def agent_loop(messages: list):
|
||||
rounds_since_todo = 0
|
||||
while True:
|
||||
# Nag reminder: if 3+ rounds without a todo update, inject reminder
|
||||
if rounds_since_todo >= 3 and messages:
|
||||
last = messages[-1]
|
||||
if last["role"] == "user" and isinstance(last.get("content"), list):
|
||||
last["content"].insert(0, {"type": "text", "text": "<reminder>Update your todos.</reminder>"})
|
||||
# Nag reminder is injected below, alongside tool results
|
||||
response = client.messages.create(
|
||||
model=MODEL, system=SYSTEM, messages=messages,
|
||||
tools=TOOLS, max_tokens=8000,
|
||||
@@ -189,6 +185,8 @@ def agent_loop(messages: list):
|
||||
if block.name == "todo":
|
||||
used_todo = True
|
||||
rounds_since_todo = 0 if used_todo else rounds_since_todo + 1
|
||||
if rounds_since_todo >= 3:
|
||||
results.insert(0, {"type": "text", "text": "<reminder>Update your todos.</reminder>"})
|
||||
messages.append({"role": "user", "content": results})
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user