claw-code/rust/crates/api
Yeachan-Heo 4cb1db9faa Implement US-022: Enhanced error context for API failures
Add structured error context to API failures:
- Request ID tracking across retries with full context in error messages
- Provider-specific error code mapping with actionable suggestions
- Suggested user actions for common error types (401, 403, 413, 429, 500, 502-504)
- Added suggested_action field to ApiError::Api variant
- Updated enrich_bearer_auth_error to preserve suggested_action

Files changed:
- rust/crates/api/src/error.rs: Add suggested_action field, update Display
- rust/crates/api/src/providers/openai_compat.rs: Add suggested_action_for_status()
- rust/crates/api/src/providers/anthropic.rs: Update error handling

All tests pass, clippy clean.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 19:15:00 +00:00
..
benches US-011: Performance optimization for API request serialization 2026-04-16 11:11:45 +00:00
src Implement US-022: Enhanced error context for API failures 2026-04-16 19:15:00 +00:00
tests fix(api): auth-provider error copy — prefix-routing hints + sk-ant-* bearer detection — closes ROADMAP #28 2026-04-08 16:29:03 +09:00
Cargo.toml US-011: Performance optimization for API request serialization 2026-04-16 11:11:45 +00:00