fix: address community issues #37 #30 #36

- 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:
CrazyBoyM
2026-02-28 00:09:57 +08:00
parent 4f39ee4512
commit dbffe7c8d0
10 changed files with 75 additions and 61 deletions

View File

@@ -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})