C.W.K.
Stream
Lesson 06 of 10 · published

Tool error — 모델이 recover하게

~14 min · tools, error-handling

Level 0수련생
0 XP0/100 lessons0/14 achievements
0/120 XP to next level120 XP to go0% complete

Tool 실패해. 모델이 어떻게 할지 알아야 해.

Tool이 error return하면 모델이 tool_result로 받고 뭘 할지 결정. Guidance 없으면 모델이 같은 call retry (특히 transient error에), 너무 일찍 포기, 또는 failed result 대신 데이터 invent. 각 행동이 버그; 각각 prompt에서 fix 가능.

error-shape convention

모델이 read 가능한 structured JSON으로 error return: {"error": "", "message": "", "retry": true|false, "hint": ""}. parseable signal과 human-readable hint 둘 다 줘.

error recovery용 prompt instruction

  • Tool이 retry: true return하면 같은 argument로 한 번 retry.
  • Tool이 retry: false return하면 다른 접근 또는 escalate.
  • Tool이 'not found' return하면 데이터 invent X; user한테 lookup 실패 알려.
  • Tool이 두 번 error하면 멈추고 failure surface.

Code

Structured tool error·json
{
  "error": "customer_not_found",
  "message": "No customer matches CUST-9999.",
  "retry": false,
  "hint": "Check the customer ID format. Ask the user to confirm."
}

External links

Exercise

Agent loop의 5개 다른 tool에 의도적 tool error inject. 모델 행동 관찰. Explicit error-recovery instruction 추가. 다시 돌려.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.