story-kit: create 90_story_fetch_real_context_window_size_from_anthropic_models_api

This commit is contained in:
Dave
2026-02-23 18:32:56 +00:00
parent f67f720ec3
commit cde607f455

View File

@@ -0,0 +1,22 @@
---
name: "Fetch real context window size from Anthropic models API"
test_plan: pending
---
# Story 90: Fetch real context window size from Anthropic models API
## User Story
As a user chatting with a Claude model, I want the context remaining indicator to show the actual context window size for the selected model (fetched from the Anthropic API) instead of a hardcoded value, so that the indicator is accurate across all current and future models.
## Acceptance Criteria
- [ ] Backend AnthropicModelInfo struct deserializes the context_window field from the Anthropic /v1/models response
- [ ] Backend /anthropic/models endpoint returns both model ID and context window size to the frontend
- [ ] Frontend uses the real context window size from the API response instead of the hardcoded getContextWindowSize map for Anthropic models
- [ ] Context indicator in ChatHeader displays the correct percentage based on the real context window size
- [ ] Hardcoded fallback remains for Ollama/local models that don't provide context window metadata
## Out of Scope
- TBD