1/16
Looks like no tags are added yet.
400 error after first tool call
Layer: Harness
Likely causes: tool_result sent with wrong role; tool_use_id mismatch; a tool_use with no matching result; results split across several user messages
Fix: One user message holding every result, ids matched
Infinite loop / hits max turns
Layer: Harness
Likely causes: Errors swallowed so the model retries forever; the same tool output each turn; loop exits only on end_turn
Fix: Return errors as is_error; dedupe or limit retries; handle every stop_reason
Answer cut off or malformed JSON
Layer: Harness
Likely causes: max_tokens too low; stop_reason == "max_tokens" treated as done; truncated tool_use input
Fix: Raise the limit; handle max_tokens explicitly; continue or retry
Breaks after enabling extended thinking
Layer: Harness
Likely causes: Thinking blocks dropped or edited when re-sending the assistant turn
Fix: Pass assistant content back unchanged
Works in sync, fails in async
Layer: Harness
Likely causes: Missing await; blocking calls in the event loop; shared mutable state across tasks
Fix: AsyncAnthropic, a semaphore, no shared state
Model picks the wrong tool
Layer: Tools
Likely causes: Overlapping or vague descriptions; tool names that mislead; too many tools
Fix: Sharper descriptions with when-to-use and when-not-to-use; merge or remove tools
Wrong arguments
Layer: Tools
Likely causes: Ambiguous schema (rsID vs HGVS, gene symbol vs Ensembl ID); no examples; no enums
Fix: Tighter schema, enums, examples in the description, validation errors the model can act on
Model misreads tool output
Layer: Tools
Likely causes: Huge raw JSON; errors returned as success; units or IDs missing
Fix: Shape output: concise fields, explicit errors, IDs kept for citations
Quality decays over long sessions
Layer: Context
Likely causes: Context bloat from full tool outputs; instructions lost far back; truncation dropping the system prompt
Fix: Truncate or summarize old results, sub-agents, retrieval instead of stuffing, caching the stable prefix
Ignores instructions or format
Layer: Prompt
Likely causes: Conflicting instructions; key rules buried; examples contradict rules
Fix: Restructure with XML sections; resolve conflicts; align the examples
Hallucinated citations or facts
Layer: Prompt Likely causes: No grounding requirement; tool returned no IDs; model asked to answer even when unsure
Fix: Require quotes or IDs from tool results; allow "not found"; add a verification step
Breaks after a model upgrade
Layer: Prompt
Likely causes: Reliance on prefill, quirks, or overly forceful prompting; parsing that assumed exact wording
Fix: Structured outputs or tool-based extraction; soften all-caps instructions; update parsing
Server won't connect or crashes
Layer: MCP
Likely causes: Logging to stdout breaks stdio JSON-RPC; wrong command or path in config; missing env vars
Fix: Log to stderr; fix config; validate env at startup
Tool called but returns junk
Layer: MCP
Likely causes: Schema mismatch; unhandled exceptions; the upstream API changed
Fix: Validate inputs; return structured errors
429s or 529s at volume
Layer: Scale
Likely causes: No concurrency limit; retries without backoff; retrying 400s
Fix: Semaphore, exponential backoff with jitter, retry only retryable errors, Batches API for offline work
Too slow or expensive
Layer: Cost / latency
Likely causes: Re-sending a large static context every turn; biggest model for every step; serial calls
Fix: Prompt caching, smaller models for routing and extraction, parallel calls
Agent acts on instructions found in data
Layer: Safety
Likely causes: Prompt injection via retrieved docs or tool output
Fix: Treat tool output as data; least-privilege tools; human approval for writ