diff --git a/CLAUDE.md b/CLAUDE.md index 6df966f9..80830aa6 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -333,6 +333,12 @@ navigate(`/trees/${newTree.id}/edit`) **48. Three chat input components:** `ChatInput.tsx` (Flow Assist/AI Chat Builder), `CopilotPanel.tsx` (in-session copilot side panel), `AssistantChatPage.tsx` (standalone AI assistant). All use Shift+Enter for newlines, Enter to send. +**49. Full-stack features — verify both ends:** When adding a field to a backend API response (e.g., `working_tree` in `AIChatMessageResponse`), always verify the frontend consumer actually reads and uses it. Similarly, when a frontend hook/component expects data from an API, confirm the backend populates it. Check the full data flow: schema → endpoint → API client → hook → store → UI. + +**50. Anthropic SDK retry behavior:** Default `max_retries=2` with exponential backoff can cause requests to take 3× the timeout (e.g., 45s × 3 = 135s). Set `max_retries=1` in `AnthropicProvider` to fail fast. Current timeout is `AI_REQUEST_TIMEOUT_SECONDS=120`. + +**51. AI model tier routing:** `config.py` has `AI_MODEL_TIERS` (fast/standard) and `ACTION_MODEL_MAP` mapping action types to tiers. Use `settings.get_model_for_action(action_type)` to resolve concrete model names. Model IDs must be valid — use alias form (`claude-sonnet-4-6`) not invented dated forms. + --- ## RBAC & Permissions