## Fix incorrect context size limits for GitHub Copilot Chat models Fixes #44909 ### Problem The agent panel was displaying incorrect token limits for GitHub Copilot models. Users reported that: - The agent panel always showed a **128K token limit** for all GitHub Copilot models, regardless of their actual context window size - Claude models (e.g., Claude 3.7 Sonnet, Claude Opus 4.5) were showing ~90K instead of their actual 200K context window - GPT-4o was showing 110K instead of its actual 128K context window - Users could continue using models beyond the displayed limit, which worked but was confusing ### Root Cause The `max_token_count()` method in `copilot_chat.rs` was returning `max_prompt_tokens` instead of `max_context_window_tokens`: ```rust // Before (incorrect) pub fn max_token_count(&self) -> u64 { self.capabilities.limits.max_prompt_tokens } ``` GitHub's API returns three different token-related fields: - `max_context_window_tokens`: The **full context window size** (e.g., 200K for Claude 3.7) - `max_prompt_tokens`: GitHub's limit for prompt input (e.g., 90K for Claude 3.7) - `max_output_tokens`: Maximum output tokens (e.g., 16K) The `max_token_count()` method in the `LanguageModel` trait is expected to return the **full context window size** — this is consistent with all other providers (Anthropic returns 200K for Claude, OpenAI returns 128K for GPT-4o, etc.). ### Solution <img width="583" height="132" alt="Screenshot 2026-01-25 at 1 07 53 AM" src="https://github.com/user-attachments/assets/847e2fdb-635d-44bc-a630-2d4867ba8c32" /> Changed `max_token_count()` to return `max_context_window_tokens`: ```rust // After (correct) pub fn max_token_count(&self) -> u64 { self.capabilities.limits.max_context_window_tokens as u64 } ``` ### Impact | Model | Before | After | |-------|--------|-------| | Claude 3.7 Sonnet | 90,000 | **200,000** | | Claude Opus 4.5 | 90,000 | **200,000** | | GPT-4o | 110,000 | **128,000** | ### Testing Added a new test `test_max_token_count_returns_context_window_not_prompt_tokens` that: 1. Deserializes model JSON with distinct `max_context_window_tokens` and `max_prompt_tokens` values 2. Verifies Claude 3.7 Sonnet returns 200,000 (context window), not 90,000 (prompt tokens) 3. Verifies GPT-4o returns 128,000 (context window), not 110,000 (prompt tokens) All existing tests continue to pass: ``` running 4 tests test tests::test_unknown_vendor_resilience ... ok test tests::test_max_token_count_returns_context_window_not_prompt_tokens ... ok test tests::test_resilient_model_schema_deserialize ... ok test result: ok. 4 passed; 0 failed ``` Release Notes: - copilot: Fixed incorrect context window size displayed for GitHub Copilot Chat models in the agent panel.
Zed
Welcome to Zed, a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Installation
On macOS, Linux, and Windows you can download Zed directly or install Zed via your local package manager (macOS/Linux/Windows).
Other platforms are not yet available:
- Web (tracking issue)
Developing Zed
Contributing
See CONTRIBUTING.md for ways you can contribute to Zed.
Also... we're hiring! Check out our jobs page for open roles.
Licensing
License information for third party dependencies must be correctly provided for CI to pass.
We use cargo-about to automatically comply with open source licenses. If CI is failing, check the following:
- Is it showing a
no license specifiederror for a crate you've created? If so, addpublish = falseunder[package]in your crate's Cargo.toml. - Is the error
failed to satisfy license requirementsfor a dependency? If so, first determine what license the project has and whether this system is sufficient to comply with this license's requirements. If you're unsure, ask a lawyer. Once you've verified that this system is acceptable add the license's SPDX identifier to theacceptedarray inscript/licenses/zed-licenses.toml. - Is
cargo-aboutunable to find the license for a dependency? If so, add a clarification field at the end ofscript/licenses/zed-licenses.toml, as specified in the cargo-about book.
Sponsorship
Zed is developed by Zed Industries, Inc., a for-profit company.
If you’d like to financially support the project, you can do so via GitHub Sponsors. Sponsorships go directly to Zed Industries and are used as general company revenue. There are no perks or entitlements associated with sponsorship.