feat(FN-3302): restore Claude usage tracking with Fusion Anthropic auth sto

Restores Claude usage tracking across the dashboard by integrating with Fusion Anthropic auth storage, and adds detection and testing for the `model_context_window_exceeded` stop reason to handle context limit errors gracefully. The work spans planning logic, usage tracking, mission management UI, a

Fusion-Task-Id: FN-3302
This commit is contained in:
Fusion
2026-05-03 11:06:27 -07:00
committed by gsxdsm
parent ca8787d112
commit 33a272aad8
2 changed files with 25 additions and 0 deletions

View File

@@ -42,6 +42,9 @@ const CONTEXT_OVERFLOW_PATTERNS: RegExp[] = [
// Provider JSON error envelope variant: "context window exceeds limit (2013)"
// Matches when "context window" and "exceeds" appear together (order-flexible)
/context\s+window\s+exceeds/i,
// Anthropic API stop_reason: model_context_window_exceeded
// Surfaces as "Unhandled stop reason: model_context_window_exceeded" from pi-ai's mapStopReason()
/model_context_window_exceeded/i,
];
/**