agent: Show the usage limits returned from the API (#29236)

This PR updates the usage banners in the Agent panel to use the limits
returned from the API instead of basing it off the plan.

This will allow limits to be updated from the server rather than being
embedded in the client.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-04-22 17:01:23 -04:00 committed by GitHub
parent 338a6a3b7e
commit fcc6a86c90
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 79 additions and 23 deletions

View file

@ -1550,7 +1550,7 @@ impl AssistantPanel {
fn render_usage_banner(&self, cx: &mut Context<Self>) -> Option<AnyElement> {
let usage = self.thread.read(cx).last_usage()?;
Some(UsageBanner::new(zed_llm_client::Plan::ZedProTrial, usage.amount).into_any_element())
Some(UsageBanner::new(zed_llm_client::Plan::ZedProTrial, usage).into_any_element())
}
fn render_last_error(&self, cx: &mut Context<Self>) -> Option<AnyElement> {