Synced from monorepo
Synced from monorepo Changes: - Temporarily disable session share link creation in the TUI - Do not approve plan on empty Enter from the revise prompt - Expose chat product Skills via ACP available_commands_update - Return immediately from a blocking wait on an already-completed ACP task - Split headless pager module for clearer structure - Stop git worktree prune from removing user registrations on resume - Use compaction sampler tokenizer for item token counts - Opt-in extra root CAs via GROK_EXTRA_CA_BUNDLE - Cancel all session subagents when the user stops - Let the session persistence actor exit when its session ends - Make fullscreen terminal resize much cheaper on long sessions - Report honestly from kill_task when an ACP task does not exist - Hide /usage for external-auth deployments - Forward the history-load trailer’s computer_reason to the client - Remove ineffective no-op tool reminder - Declare slash-command screen-mode support in one place - Keep settings enum picker on the committed value until Enter - Reap a PTY’s full process tree - Stream tool calls from headless mode over ACP - Bridge gateway task lifecycle to ACP for chat session background tasks - Don’t warn about truncated history on a suppressed replay - Fit full-replace summarizer input and recover on context-length errors - Stop dropping agents over an unrecognized frontmatter color - Add /undo as a slash alias for /rewind - Harden sleep/wake token-refresh paths against forced re-login - Add session/list ACP method - Give each sampling backend its own conversion module - Treat an unenrolled child process as a lint error - Suppress the cancelled marker on send-now wake turns - Stop tearing down Roslyn on every edit, and read C# diagnostics Source-Revision: 2a28b4a86cfc4a4c133c35b7fc2a6a9964387c39
This commit is contained in:
parent
500129c714
commit
dd04f397b1
367 changed files with 29489 additions and 10051 deletions
|
|
@ -468,6 +468,7 @@ async fn record_last_turn_usage_round_trip() {
|
|||
total_tokens: 1290,
|
||||
reasoning_tokens: 0,
|
||||
cached_prompt_tokens: 800,
|
||||
cache_creation_prompt_tokens: 0,
|
||||
};
|
||||
h.handle.record_last_turn_usage(usage.clone());
|
||||
|
||||
|
|
@ -483,6 +484,7 @@ async fn record_last_turn_usage_round_trip() {
|
|||
total_tokens: 10000,
|
||||
reasoning_tokens: 0,
|
||||
cached_prompt_tokens: 0,
|
||||
cache_creation_prompt_tokens: 0,
|
||||
};
|
||||
h.handle.record_last_turn_usage(next);
|
||||
let got2 = h
|
||||
|
|
@ -504,6 +506,7 @@ async fn prompt_usage_ledger_via_handle_resets_and_clears() {
|
|||
total_tokens: 12,
|
||||
reasoning_tokens: 0,
|
||||
cached_prompt_tokens: 0,
|
||||
cache_creation_prompt_tokens: 0,
|
||||
};
|
||||
|
||||
let h = TestHarness::new();
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ pub struct UsageTotals {
|
|||
pub input_tokens: u64,
|
||||
pub output_tokens: u64,
|
||||
pub cached_read_tokens: u64,
|
||||
pub cache_creation_tokens: u64,
|
||||
pub reasoning_tokens: u64,
|
||||
pub model_calls: u64,
|
||||
pub api_duration_ms: u64,
|
||||
|
|
@ -52,6 +53,7 @@ impl UsageTotals {
|
|||
input_tokens: u64::from(usage.prompt_tokens),
|
||||
output_tokens: u64::from(usage.completion_tokens),
|
||||
cached_read_tokens: u64::from(usage.cached_prompt_tokens),
|
||||
cache_creation_tokens: u64::from(usage.cache_creation_prompt_tokens),
|
||||
reasoning_tokens: u64::from(usage.reasoning_tokens),
|
||||
model_calls: 1,
|
||||
api_duration_ms: api_duration_ms.unwrap_or(0),
|
||||
|
|
@ -73,6 +75,7 @@ impl UsageTotals {
|
|||
input_tokens,
|
||||
output_tokens,
|
||||
cached_read_tokens,
|
||||
cache_creation_tokens,
|
||||
reasoning_tokens,
|
||||
model_calls,
|
||||
api_duration_ms,
|
||||
|
|
@ -82,6 +85,9 @@ impl UsageTotals {
|
|||
self.input_tokens = self.input_tokens.saturating_add(*input_tokens);
|
||||
self.output_tokens = self.output_tokens.saturating_add(*output_tokens);
|
||||
self.cached_read_tokens = self.cached_read_tokens.saturating_add(*cached_read_tokens);
|
||||
self.cache_creation_tokens = self
|
||||
.cache_creation_tokens
|
||||
.saturating_add(*cache_creation_tokens);
|
||||
self.reasoning_tokens = self.reasoning_tokens.saturating_add(*reasoning_tokens);
|
||||
self.model_calls = self.model_calls.saturating_add(*model_calls);
|
||||
self.api_duration_ms = self.api_duration_ms.saturating_add(*api_duration_ms);
|
||||
|
|
@ -157,6 +163,7 @@ mod tests {
|
|||
total_tokens: 999_999,
|
||||
reasoning_tokens: 0,
|
||||
cached_prompt_tokens: 0,
|
||||
cache_creation_prompt_tokens: 0,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue