extract_text() is new in s06 (listed in the docstring under "Changes
from s05") but was defined under the "FROM s02-s05 (unchanged)" banner.
Move it into the "NEW in s06: Subagent" section, directly above its only
caller spawn_subagent(). Pure move, no logic change.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The problem block used a nested `if block.type == "tool_use":` while the
solution block and code.py use `if block.type != "tool_use": continue`.
This made the problem->solution diff show two changes instead of the one
the section teaches (the README states only one place in the loop changed).
Align all three README variants (zh/en/ja) to the early-continue idiom.
The compact tool schema declares a "focus" parameter ("What to preserve
in the summary") but the handler ignored it entirely -- the parameter
was never passed to auto_compact(). Now the focus value is captured from
block.input and included in the summarization prompt so the LLM knows
what details to prioritize when compressing the conversation.
s09_agent_teams.py, s10_team_protocols.py, and s11_autonomous_agents.py
were missing the "> /dev/" entry in their dangerous command blocklist.
This is present in s01, s06, s12, and s_full but was dropped when s09-s11
were written, creating a security regression where commands like
`echo y > /dev/sda` could bypass the blocklist.
The previous implementation always appended a new user message for background
results regardless of the trailing message's role. After a tool round-trip
(or right after the user query), the messages list could end up with two
adjacent user messages, which is messy for prompt caching, token accounting
and stricter API gateways.
Now we merge the background-results block into the trailing user message
when its role is already user, and only append a fresh user message
otherwise. tool_result blocks still immediately follow their tool_use, so
the protocol contract is preserved.
- Add clear=True parameter to read_inbox for optional message clearing
- Update /inbox command to use clear=False for non-destructive reading
- Remove JSON formatting in agent_loop to save tokens
- Use walrus operator in s11 claim_task for cleaner code
Resolves the contradiction between "Agent is the model" and
"Model is the driver, Harness is the vehicle". All three language
versions now clearly distinguish: agency comes from training,
but a working agent product = model + harness.
Adjust the philosophical framing to resolve the contradiction between
"Agent is the model" and "Model is the driver, Harness is the vehicle".
Now clearly distinguishes: agency comes from training (not coded),
but a working agent product = model + harness.
- agents/s01_agent_loop.py: Add FileNotFoundError/OSError handling in run_bash()
- agents/s04_subagent.py: Same fix + use .get() for block.input['prompt']
(consistent with .get() already used for 'description' on line 157)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Two issues found during post-merge audit:
1. auto_compact used [:80000] (oldest) instead of [-80000:] (newest), inconsistent with s06
2. nag reminder used insert(0,...) instead of append(), inconsistent with s03
Skip compacting read_file tool outputs since they are reference material.
Compacting them into placeholders forces the agent to re-read the same
files, creating loops. Other tool results are still compacted normally.