ZIm/crates/agent/src
Agus Zubiaga 0286b8ab3e
agent: Fix conversation token usage and estimate unsent message (#28878)
The UI was mistakenly using the cumulative token usage for the token
counter. It will now display the last request token count, plus an
estimation of the tokens in the message editor and context entries that
haven't been sent yet.


https://github.com/user-attachments/assets/0438c501-b850-4397-9135-57214ca3c07a

Additionally, when the user edits a message, we'll display the actual
token count up to it and estimate the tokens in the new message.

Note: We don't currently estimate the delta when switching profiles. In
the future, we want to use the count tokens API to measure every part of
the request and display a breakdown.

Release Notes:

- agent: Made the token count more accurate and added back estimation of
used tokens as you type and add context.

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2025-04-16 16:27:36 -03:00
..
assistant_configuration agent: Make ToolWorkingSet an Entity (#28757) 2025-04-15 14:42:31 +02:00
context_picker agent: Improve fuzzy matching for @mentions (#28883) 2025-04-16 17:44:07 +00:00
ui agent: Add small design tweaks (#28874) 2025-04-16 13:03:36 -03:00
active_thread.rs agent: Fix conversation token usage and estimate unsent message (#28878) 2025-04-16 16:27:36 -03:00
agent_diff.rs Fix rejecting multiple hunks in AgentDiff (#28806) 2025-04-15 20:15:58 +00:00
assistant.rs agent: Show a warning when some tools are incompatible with the selected model (#28755) 2025-04-15 16:58:11 +00:00
assistant_configuration.rs agent: Add scrollbar to the settings view (#28814) 2025-04-15 18:25:19 -03:00
assistant_model_selector.rs agent: Refine language model selector (#28597) 2025-04-11 23:02:50 +00:00
assistant_panel.rs agent: Fix conversation token usage and estimate unsent message (#28878) 2025-04-16 16:27:36 -03:00
buffer_codegen.rs telemetry_events: Rename AssistantEvent to AssistantEventData (#28133) 2025-04-04 19:28:32 -04:00
context.rs Fix directory context paths (#28459) 2025-04-09 21:40:46 +00:00
context_picker.rs agent: Remove unused code (#28552) 2025-04-11 23:45:51 +00:00
context_store.rs Fix directory context paths (#28459) 2025-04-09 21:40:46 +00:00
context_strip.rs agent: Remove unused code (#28552) 2025-04-11 23:45:51 +00:00
history_store.rs agent: Add search to Thread History (#28085) 2025-04-04 10:09:21 -03:00
inline_assistant.rs Reapply "Use Project instead of Workspace in ContextStore (#28402)" (#28441) 2025-04-09 16:56:14 +00:00
inline_prompt_editor.rs ai: Separate model settings for each feature (#28088) 2025-04-04 11:40:55 -03:00
message_editor.rs agent: Fix conversation token usage and estimate unsent message (#28878) 2025-04-16 16:27:36 -03:00
profile_selector.rs agent: Make ToolWorkingSet an Entity (#28757) 2025-04-15 14:42:31 +02:00
terminal_codegen.rs telemetry_events: Rename AssistantEvent to AssistantEventData (#28133) 2025-04-04 19:28:32 -04:00
terminal_inline_assistant.rs Reapply "Use Project instead of Workspace in ContextStore (#28402)" (#28441) 2025-04-09 16:56:14 +00:00
thread.rs agent: Fix conversation token usage and estimate unsent message (#28878) 2025-04-16 16:27:36 -03:00
thread_history.rs agent: Add scrollbar to the history view (#28690) 2025-04-14 12:36:58 -03:00
thread_store.rs agent: Fix conversation token usage and estimate unsent message (#28878) 2025-04-16 16:27:36 -03:00
tool_compatibility.rs agent: Show a warning when some tools are incompatible with the selected model (#28755) 2025-04-15 16:58:11 +00:00
tool_use.rs agent: Add websearch tool (#28621) 2025-04-16 19:25:00 +02:00
ui.rs Add progress bar component (#28518) 2025-04-10 12:11:58 -06:00