mirror of
https://github.com/shareAI-lab/analysis_claude_code.git
synced 2026-06-20 20:23:36 +08:00
fix(s04): use early-continue idiom in problem code block
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.
This commit is contained in:
@@ -21,7 +21,8 @@ def agent_loop(messages):
|
||||
while True:
|
||||
# ... LLM call ...
|
||||
for block in response.content:
|
||||
if block.type == "tool_use":
|
||||
if block.type != "tool_use":
|
||||
continue
|
||||
log_to_file(block) # added a line
|
||||
check_permission(block) # added a line
|
||||
notify_slack(block) # added another line
|
||||
|
||||
@@ -21,7 +21,8 @@ def agent_loop(messages):
|
||||
while True:
|
||||
# ... LLM call ...
|
||||
for block in response.content:
|
||||
if block.type == "tool_use":
|
||||
if block.type != "tool_use":
|
||||
continue
|
||||
log_to_file(block) # 一行追加
|
||||
check_permission(block) # 一行追加
|
||||
notify_slack(block) # さらに一行追加
|
||||
|
||||
@@ -21,7 +21,8 @@ def agent_loop(messages):
|
||||
while True:
|
||||
# ... LLM call ...
|
||||
for block in response.content:
|
||||
if block.type == "tool_use":
|
||||
if block.type != "tool_use":
|
||||
continue
|
||||
log_to_file(block) # 加一行
|
||||
check_permission(block) # 加一行
|
||||
notify_slack(block) # 又加一行
|
||||
|
||||
Reference in New Issue
Block a user