演習 › 全問
問題 Q1-02
2 / 120分野1・エージェントループの設計
まだ解いていません。
出張手配のエージェントで、ループの上限を「最大8回の往復」にして、それを唯一の終了条件にしている。複雑な旅程では、予約の途中で打ち切られる事故が起きた。設計の見直しとして最も適切なものはどれか。
正解は A
- A正解です。通常の終わり方は、モデルがツールを求めなくなること。上限は、あくまで安全装置です。
- B上限の値を変えただけで、上限を主役にする設計は変わりません。簡単な案件では無駄に回り、難しい案件ではまた足りなくなります。
- C公式も、上限なしだと開かれた課題で長く走ると述べ、本番では予算を置くことを勧めています。
- D毎回の確認は、自律的に進めるという目的を損ないます。終了条件の設計の問題は解決しません。
考え方:上限は安全装置。本来の終了は、ツール呼び出しのない応答(end_turn)で判定する。
出典:How the agent loop works
Without limits, the loop runs until Claude finishes on its own, which is fine for well-scoped tasks but can run long on open-ended promptshttps://code.claude.com/docs/en/agent-sdk/agent-loop.md(取得 2026-11-20)
出典:How the agent loop works
Setting a budget is a good default for production agents.https://code.claude.com/docs/en/agent-sdk/agent-loop.md(取得 2026-11-20)
出典:Claude Certified Architect – Foundations Exam Guide v1.0(英語)
Avoiding anti-patterns such as parsing natural language signals to determine loop termination, setting arbitrary iteration caps as the primary stopping mechanism, or checking for assistant text content as a completion indicatorhttps://everpath-course-content.s3-accelerate.amazonaws.com/instructor…(取得 2026-11-20)