mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-10-05 20:44:07 +08:00
feat: track interaction events during automatic compaction
- Added tracking for interaction events in the `Output` struct, including `summary_started` and `token_delta`. - Updated the `run` function to push relevant interaction events to the `interaction_events` vector. - Enhanced the automatic compaction test to verify the immediate reset of cursor usage and the correct logging of interaction events.
This commit is contained in:
@@ -703,6 +703,20 @@ impl RunEngine {
|
||||
emit(client, RunEvent::AutoCompactionStarted)
|
||||
.await
|
||||
.map_err(|_| client_failure())?;
|
||||
emit(
|
||||
client,
|
||||
RunEvent::Usage(Usage {
|
||||
input_tokens: Some(0),
|
||||
context_input_tokens: Some(0),
|
||||
output_tokens: Some(0),
|
||||
total_tokens: Some(0),
|
||||
cache_read_tokens: Some(0),
|
||||
cache_write_tokens: Some(0),
|
||||
reasoning_tokens: Some(0),
|
||||
}),
|
||||
)
|
||||
.await
|
||||
.map_err(|_| client_failure())?;
|
||||
let provider_call_index = self
|
||||
.store
|
||||
.begin_provider_call(&prepared.run_id)
|
||||
|
||||
Reference in New Issue
Block a user