feat(api): enhance statistics storage management with scope options

- Introduced a new type `StatisticsStorageScope` to specify the scope for clearing statistics.
- Updated the `clearStatisticsStorage` API method to accept a scope parameter, allowing for selective clearing of detailed records or all statistics.
- Modified the demo API to handle the new scope parameter appropriately.
- Updated the SettingsPage component to include a selection for clearing scope, enhancing user control over statistics management.
- Added new translations for the updated messages related to statistics clearing in both English and Chinese.
This commit is contained in:
leookun committed 2026-08-28 10:18:11 +08:00
1 parent 217f984112
commit 71ddf71ec1
15 files changed
+514 -111

No files matched your search

+25 -2
View File
@@ -64,6 +64,7 @@ impl CursorActor {
};
match command {
CursorCommand::Abort => {
handle.mark_conversation_cancelled();
handle.cancel();
}
CursorCommand::Finished => {
@@ -76,6 +77,24 @@ impl CursorActor {
Some(pb::agent_client_message::Message::RunRequest(
request,
)) => {
if let Some(conversation_id) =
request.conversation_id.as_deref()
{
if let Err(error) =
handle.set_conversation_id(conversation_id)
{
tracing::error!(
request_id = handle.request_id(),
%error,
"invalid Cursor conversation id"
);
let _ =
crate::cursor::lifecycle::fail(&handle, &error);
let _ =
handle.command(CursorCommand::Finished).await;
return;
}
}
if let Some((results, runtime_actions, dependencies)) =
run_resources.take()
{
@@ -357,8 +376,12 @@ impl CursorActor {
) => match action.action {
Some(
pb::conversation_action::Action::UserMessageAction(_),
)
| Some(pb::conversation_action::Action::CancelAction(_)) => {
) => {
handle.mark_conversation_cancelled();
handle.cancel();
}
Some(pb::conversation_action::Action::CancelAction(_)) => {
handle.mark_conversation_cancelled();
handle.cancel();
}
Some(