Skip to content

feat: add conversation batch deletion for webchat#6160

Open
Flartiny wants to merge 2 commits intoAstrBotDevs:masterfrom
Flartiny:feat/batch-delete-conversation
Open

feat: add conversation batch deletion for webchat#6160
Flartiny wants to merge 2 commits intoAstrBotDevs:masterfrom
Flartiny:feat/batch-delete-conversation

Conversation

@Flartiny
Copy link
Contributor

@Flartiny Flartiny commented Mar 13, 2026

issue #6142
为webchat添加批量删除对话功能。

Modifications / 改动点

删除处理与前端实现:
astrbot/dashboard/routes/chat.py
dashboard/src/components/chat/Chat.vue
dashboard/src/composables/useSessions.ts
dashboard/src/components/chat/ConversationSidebar.vue
i18n:
dashboard/src/i18n/locales/en-US/features/chat.json
dashboard/src/i18n/locales/zh-CN/features/chat.json

  • This is NOT a breaking change. / 这不是一个破坏性变更。

Screenshots or Test Results / 运行截图或测试结果

image image

Checklist / 检查清单

  • 😊 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。/ If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
  • 👀 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”。/ My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
  • 🤓 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到了 requirements.txtpyproject.toml 文件相应位置。/ I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in requirements.txt and pyproject.toml.
  • 😮 我的更改没有引入恶意代码。/ My changes do not introduce malicious code.

Summary by Sourcery

在整个仪表盘 UI 和后端 API 中,为网页聊天会话添加批量删除支持。

新功能:

  • 在会话侧边栏中启用网页聊天会话的多选和批量删除功能,包括选择控件和批量操作栏。
  • 新增 /api/chat/batch_delete_sessions 接口,用于一次性删除多个会话,并向客户端报告每个会话的删除失败情况。

增强内容:

  • 将网页聊天会话删除逻辑重构为可复用的内部辅助方法,以同时支持单次删除和批量删除流程。
  • 新增数据库方法,可在单次查询中按 ID 获取多个平台会话,以优化批量删除的性能。
  • 改进聊天 UI,通过提示(toast)展示部分批量删除失败的情况,并在删除后保持当前会话状态的一致性。

测试:

  • 新增针对 batch_delete_sessions 接口的测试,包括请求负载校验、内部错误屏蔽以及批量会话查询的使用。
Original summary in English

Summary by Sourcery

Add batch deletion support for webchat conversations across the dashboard UI and backend APIs.

New Features:

  • Enable multi-select and batch deletion of webchat sessions from the conversation sidebar, including selection controls and batch action bar.
  • Expose a new /api/chat/batch_delete_sessions endpoint to delete multiple sessions at once and report per-session failures to the client.

Enhancements:

  • Refactor webchat session deletion into a reusable internal helper to support both single and batch deletion paths.
  • Add a database method for fetching multiple platform sessions by ID in a single query to optimize batch deletion.
  • Improve the chat UI to surface partial batch deletion failures via toasts and keep the current session state consistent after deletions.

Tests:

  • Add tests covering the batch_delete_sessions endpoint, including payload validation, internal error masking, and use of batched session lookup.

新功能:

  • 在侧边栏中启用对多个网页聊天会话的批量选择和删除。
  • 暴露一个新的后端端点以执行批量删除聊天会话,并向客户端报告部分失败的情况。

增强改进:

  • 将会话删除逻辑重构为可复用的内部辅助方法,以支持单个删除和批量删除流程。
Original summary in English

Summary by Sourcery

在整个仪表盘 UI 和后端 API 中,为网页聊天会话添加批量删除支持。

新功能:

  • 在会话侧边栏中启用网页聊天会话的多选和批量删除功能,包括选择控件和批量操作栏。
  • 新增 /api/chat/batch_delete_sessions 接口,用于一次性删除多个会话,并向客户端报告每个会话的删除失败情况。

增强内容:

  • 将网页聊天会话删除逻辑重构为可复用的内部辅助方法,以同时支持单次删除和批量删除流程。
  • 新增数据库方法,可在单次查询中按 ID 获取多个平台会话,以优化批量删除的性能。
  • 改进聊天 UI,通过提示(toast)展示部分批量删除失败的情况,并在删除后保持当前会话状态的一致性。

测试:

  • 新增针对 batch_delete_sessions 接口的测试,包括请求负载校验、内部错误屏蔽以及批量会话查询的使用。
Original summary in English

Summary by Sourcery

Add batch deletion support for webchat conversations across the dashboard UI and backend APIs.

New Features:

  • Enable multi-select and batch deletion of webchat sessions from the conversation sidebar, including selection controls and batch action bar.
  • Expose a new /api/chat/batch_delete_sessions endpoint to delete multiple sessions at once and report per-session failures to the client.

Enhancements:

  • Refactor webchat session deletion into a reusable internal helper to support both single and batch deletion paths.
  • Add a database method for fetching multiple platform sessions by ID in a single query to optimize batch deletion.
  • Improve the chat UI to surface partial batch deletion failures via toasts and keep the current session state consistent after deletions.

Tests:

  • Add tests covering the batch_delete_sessions endpoint, including payload validation, internal error masking, and use of batched session lookup.

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Mar 13, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a highly requested feature: batch deletion of webchat conversations. This enhancement significantly improves user experience by allowing users to efficiently manage their chat history, moving beyond single-item deletion to a more streamlined bulk operation. The changes span both backend API development and frontend UI implementation, along with necessary internationalization updates.

Highlights

  • Batch Conversation Deletion API: A new backend API endpoint (/chat/batch_delete_sessions) has been implemented to support the deletion of multiple chat sessions simultaneously, including robust error handling for individual session failures.
  • Refactored Session Deletion Logic: The core logic for deleting a single chat session has been extracted into a reusable internal function (_delete_session_internal), improving code modularity and maintainability for both single and batch deletion operations.
  • Frontend Batch Selection UI: A new batch selection mode has been added to the webchat sidebar, allowing users to select multiple conversations using checkboxes. This mode includes 'Select All/Deselect All' functionality and a dedicated 'Delete' button.
  • Integrated Batch Deletion Workflow: Frontend components and composables have been updated to integrate the batch deletion functionality, including handling user confirmation, displaying toast notifications for partial failures, and refreshing the conversation list.
  • Internationalization Updates: New localization strings have been added to both English and Chinese language files to support the new batch deletion features, ensuring a consistent user experience across languages.
Changelog
  • astrbot/dashboard/routes/chat.py
    • Added a new POST route /chat/batch_delete_sessions to handle multiple session deletions.
    • Refactored the core session deletion logic into a new internal asynchronous method _delete_session_internal for reuse.
    • Updated delete_webchat_session to use the new internal deletion method.
    • Implemented batch_delete_sessions to process a list of session IDs, including error handling for not found or permission denied sessions, and returning a summary of deleted and failed items.
  • dashboard/src/components/chat/Chat.vue
    • Added an event listener @batchDeleteConversations to the ConversationSidebar component.
    • Imported useToast for displaying notifications.
    • Integrated the batchDeleteSessions function from useSessions composable.
    • Implemented handleBatchDeleteConversations to call the batch deletion API, clear messages if the current session was deleted, refresh project sessions, and display toast notifications for partial failures.
  • dashboard/src/components/chat/ConversationSidebar.vue
    • Introduced a 'batch mode' toggle button next to the 'New Chat' button.
    • Added a batch action bar that appears in batch mode, featuring 'Select All/Deselect All' and 'Delete' buttons, along with a count of selected items.
    • Modified the conversation list to display checkboxes for batch selection when in batch mode.
    • Implemented toggleBatchMode, toggleBatchItem, toggleSelectAll, handleBatchDelete, and handleListSelect functions to manage batch selection state and trigger batch deletion.
    • Added new CSS styles for the batch mode UI elements.
  • dashboard/src/composables/useSessions.ts
    • Defined BatchDeleteFailedItem and BatchDeleteResult interfaces for type safety.
    • Added a type guard isBatchDeleteResponseData for validating batch delete API responses.
    • Implemented batchDeleteSessions asynchronous function to send batch delete requests to the backend, handle API responses, update the current session state if the active session is deleted, and refresh the session list.
  • dashboard/src/i18n/locales/en-US/features/chat.json
    • Added new translation keys under a 'batch' object for English, including 'selected', 'confirmDelete', 'selectAll', 'deselectAll', 'delete', 'exit', 'partialFailure', and 'requestFailed'.
  • dashboard/src/i18n/locales/zh-CN/features/chat.json
    • Added new translation keys under a 'batch' object for Chinese, including 'selected', 'confirmDelete', 'selectAll', 'deselectAll', 'delete', 'exit', 'partialFailure', and 'requestFailed'.
Activity
  • The pull request was created by Flartiny and includes a detailed description, screenshots, and a checklist, indicating a thorough preparation by the author. No other reviewer activity or comments are visible in the provided context.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@dosubot dosubot bot added area:webui The bug / feature is about webui(dashboard) of astrbot. feature:chatui The bug / feature is about astrbot's chatui, webchat labels Mar 13, 2026
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - 我发现了 1 个问题,并留下了一些高层次的反馈:

  • chat.py 中,辅助函数 _delete_session_internal 接收了一个从未使用的 username 参数;建议要么移除此参数,要么把权限检查移动到该辅助函数内部,这样参数才有实际意义,同时避免在各个调用方重复实现同样的逻辑。
  • batch_delete_sessions 循环按顺序逐个删除会话,并且对每个 ID 都执行一次完整的查询;如果这个端点预期要处理更大的批量请求,建议考虑使用批量查询或批量删除,以减少每个会话的数据库往返开销。
  • useSessions.batchDeleteSessionsChat.vue 中,你同时在 composable 和 handler 中记录错误日志(各自都调用了 console.error),这可能是多余的;将日志集中在某一层处理可以简化错误处理逻辑。
给 AI Agent 的提示词
Please address the comments from this code review:

## Overall Comments
-`chat.py` 中,辅助函数 `_delete_session_internal` 接收了一个从未使用的 `username` 参数;建议要么移除此参数,要么把权限检查移动到该辅助函数内部,这样参数才有实际意义,同时避免在各个调用方重复实现同样的逻辑。
- `batch_delete_sessions` 循环按顺序逐个删除会话,并且对每个 ID 都执行一次完整的查询;如果这个端点预期要处理更大的批量请求,建议考虑使用批量查询或批量删除,以减少每个会话的数据库往返开销。
-`useSessions.batchDeleteSessions``Chat.vue` 中,你同时在 composable 和 handler 中记录错误日志(各自都调用了 `console.error`),这可能是多余的;将日志集中在某一层处理可以简化错误处理逻辑。

## Individual Comments

### Comment 1
<location path="astrbot/dashboard/routes/chat.py" line_range="670-672" />
<code_context>
+                    continue
+                await self._delete_session_internal(session, username)
+                deleted_count += 1
+            except Exception as e:
+                logger.warning(f"Failed to delete session {sid}: {e}")
+                failed_items.append({"session_id": sid, "reason": str(e)})
+
+        return (
</code_context>
<issue_to_address>
**🚨 issue (security):** 避免在 `batch_delete_sessions` 中将原始异常消息返回给客户端。

使用 `str(e)` 作为 `reason` 会将内部细节暴露给客户端,可能泄露实现细节或敏感信息。应当改为将错误映射到一小组通用且对客户端安全的原因(例如 `internal_error`),并仅在服务器端记录完整异常信息。
</issue_to_address>

Sourcery 对开源项目是免费的——如果你觉得我们的代码审查有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据这些反馈改进后续的代码审查。
Original comment in English

Hey - I've found 1 issue, and left some high level feedback:

  • In chat.py, the helper _delete_session_internal takes a username parameter that is never used; consider either removing this argument or moving the permission check into this helper so the parameter is meaningful and the logic isn't duplicated across callers.
  • The batch_delete_sessions loop deletes sessions sequentially and performs a full fetch for each ID; if this endpoint is expected to handle larger batches, consider optimizing with bulk queries or batched deletes to reduce per-session DB round-trips.
  • In useSessions.batchDeleteSessions and Chat.vue you log errors in both the composable and the handler (console.error in each), which may be redundant; centralizing the logging in one layer would simplify error handling.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `chat.py`, the helper `_delete_session_internal` takes a `username` parameter that is never used; consider either removing this argument or moving the permission check into this helper so the parameter is meaningful and the logic isn't duplicated across callers.
- The `batch_delete_sessions` loop deletes sessions sequentially and performs a full fetch for each ID; if this endpoint is expected to handle larger batches, consider optimizing with bulk queries or batched deletes to reduce per-session DB round-trips.
- In `useSessions.batchDeleteSessions` and `Chat.vue` you log errors in both the composable and the handler (`console.error` in each), which may be redundant; centralizing the logging in one layer would simplify error handling.

## Individual Comments

### Comment 1
<location path="astrbot/dashboard/routes/chat.py" line_range="670-672" />
<code_context>
+                    continue
+                await self._delete_session_internal(session, username)
+                deleted_count += 1
+            except Exception as e:
+                logger.warning(f"Failed to delete session {sid}: {e}")
+                failed_items.append({"session_id": sid, "reason": str(e)})
+
+        return (
</code_context>
<issue_to_address>
**🚨 issue (security):** Avoid returning raw exception messages to the client in `batch_delete_sessions`.

Using `str(e)` for `reason` exposes internal details to clients, which can leak implementation or sensitive information. Instead, map errors to a small set of generic, client-safe reasons (e.g. `internal_error`) and log the full exception only on the server.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

此 PR 为 WebChat 添加了批量删除对话的功能,这是一个很棒的增强。后端 API 设计良好,能够处理部分失败的情况并返回详细信息。前端的实现也很可靠,包括批量选择的 UI、确认对话框以及处理 API 响应的逻辑。代码重构(将删除逻辑提取到 _delete_session_internal)也值得称赞,提高了代码的可重用性。

我只发现一个可以改进的地方:后端的批量删除操作存在性能优化的空间,具体请看我的评论。

Comment on lines +657 to +672
for sid in session_ids:
try:
session = await self.db.get_platform_session_by_id(sid)
if not session:
failed_items.append({"session_id": sid, "reason": "not found"})
continue
if session.creator != username:
failed_items.append(
{"session_id": sid, "reason": "permission denied"}
)
continue
await self._delete_session_internal(session, username)
deleted_count += 1
except Exception as e:
logger.warning(f"Failed to delete session {sid}: {e}")
failed_items.append({"session_id": sid, "reason": str(e)})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

当前实现中,您在循环内为每个 session_id 调用 self.db.get_platform_session_by_id(sid)。当批量删除大量会话时,这会导致 N+1 查询问题,对数据库造成不必要的压力并可能影响性能。

建议通过一次数据库查询批量获取所有会话,然后在内存中进行处理。这可以显著提高效率。

您可能需要在数据库访问层(db.py)中添加一个新方法,例如 get_platform_sessions_by_ids(session_ids)

        # 批量获取所有会话以提高效率。
        # 这可能需要在数据库访问层添加一个新方法,如 `get_platform_sessions_by_ids`。
        sessions_from_db = await self.db.get_platform_sessions_by_ids(session_ids)
        session_map = {s.session_id: s for s in sessions_from_db}

        for sid in session_ids:
            try:
                session = session_map.get(sid)
                if not session:
                    failed_items.append({"session_id": sid, "reason": "not found"})
                    continue
                if session.creator != username:
                    failed_items.append(
                        {"session_id": sid, "reason": "permission denied"}
                    )
                    continue
                await self._delete_session_internal(session, username)
                deleted_count += 1
            except Exception as e:
                logger.warning(f"Failed to delete session {sid}: {e}")
                failed_items.append({"session_id": sid, "reason": str(e)})

@Flartiny
Copy link
Contributor Author

@sourcery-ai review

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - 我发现了 1 个问题,并留了一些整体性的反馈:

  • batch_delete_sessions 中,你记录并返回了通用的 internal_error,但前端仍然会清空 batchSelected 并退出批量模式;建议在出错时保持批量模式继续激活,和/或将具体的 failed_items 暴露给 UI,让用户可以看到哪些会话失败并显式地重试它们。
  • 帮助函数 _delete_session_internal(self, session, username: str) 实际上并没有使用 username;你可以删掉这个参数,以简化函数签名并避免混淆。
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `batch_delete_sessions`, you're logging and returning a generic `internal_error` but still clearing `batchSelected` and exiting batch mode on the frontend; consider keeping batch mode active and/or surfacing the specific `failed_items` to the UI so users can see which sessions failed and retry them explicitly.
- The helper `_delete_session_internal(self, session, username: str)` doesn't actually use `username`; you can drop this parameter to simplify the signature and avoid confusion.

## Individual Comments

### Comment 1
<location path="astrbot/dashboard/routes/chat.py" line_range="670-673" />
<code_context>
+                await self._delete_session_internal(session, username)
+                deleted_count += 1
+                sessions_by_id.pop(sid, None)
+            except Exception:
+                logger.warning("Failed to delete session %s", sid)
+                failed_items.append({"session_id": sid, "reason": "internal_error"})
+
</code_context>
<issue_to_address>
**suggestion:** The broad exception in `batch_delete_sessions` loses error details; logging the exception would aid debugging.

The broad `except Exception:` keeps the batch resilient, but the warning currently drops exception details. Please switch to `logger.exception("Failed to delete session %s", sid)` (or `logger.warning(..., exc_info=True)`) so stack traces are preserved while keeping external behavior unchanged.

```suggestion
            try:
                await self._delete_session_internal(session, username)
                deleted_count += 1
                sessions_by_id.pop(sid, None)
            except Exception:
                logger.exception("Failed to delete session %s", sid)
                failed_items.append({"session_id": sid, "reason": "internal_error"})
```
</issue_to_address>

Sourcery 对开源项目免费使用——如果你觉得我们的评审有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进代码评审质量。
Original comment in English

Hey - I've found 1 issue, and left some high level feedback:

  • In batch_delete_sessions, you're logging and returning a generic internal_error but still clearing batchSelected and exiting batch mode on the frontend; consider keeping batch mode active and/or surfacing the specific failed_items to the UI so users can see which sessions failed and retry them explicitly.
  • The helper _delete_session_internal(self, session, username: str) doesn't actually use username; you can drop this parameter to simplify the signature and avoid confusion.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `batch_delete_sessions`, you're logging and returning a generic `internal_error` but still clearing `batchSelected` and exiting batch mode on the frontend; consider keeping batch mode active and/or surfacing the specific `failed_items` to the UI so users can see which sessions failed and retry them explicitly.
- The helper `_delete_session_internal(self, session, username: str)` doesn't actually use `username`; you can drop this parameter to simplify the signature and avoid confusion.

## Individual Comments

### Comment 1
<location path="astrbot/dashboard/routes/chat.py" line_range="670-673" />
<code_context>
+                await self._delete_session_internal(session, username)
+                deleted_count += 1
+                sessions_by_id.pop(sid, None)
+            except Exception:
+                logger.warning("Failed to delete session %s", sid)
+                failed_items.append({"session_id": sid, "reason": "internal_error"})
+
</code_context>
<issue_to_address>
**suggestion:** The broad exception in `batch_delete_sessions` loses error details; logging the exception would aid debugging.

The broad `except Exception:` keeps the batch resilient, but the warning currently drops exception details. Please switch to `logger.exception("Failed to delete session %s", sid)` (or `logger.warning(..., exc_info=True)`) so stack traces are preserved while keeping external behavior unchanged.

```suggestion
            try:
                await self._delete_session_internal(session, username)
                deleted_count += 1
                sessions_by_id.pop(sid, None)
            except Exception:
                logger.exception("Failed to delete session %s", sid)
                failed_items.append({"session_id": sid, "reason": "internal_error"})
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +670 to +673
try:
await self._delete_session_internal(session, username)
deleted_count += 1
sessions_by_id.pop(sid, None)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion:batch_delete_sessions 中过于宽泛的异常捕获会丢失错误细节;记录异常日志有助于调试。

宽泛的 except Exception: 能保证批量操作的鲁棒性,但当前的 warning 日志会丢掉异常细节。请切换为 logger.exception("Failed to delete session %s", sid)(或 logger.warning(..., exc_info=True)),这样可以保留堆栈信息,同时保持对外行为不变。

Suggested change
try:
await self._delete_session_internal(session, username)
deleted_count += 1
sessions_by_id.pop(sid, None)
try:
await self._delete_session_internal(session, username)
deleted_count += 1
sessions_by_id.pop(sid, None)
except Exception:
logger.exception("Failed to delete session %s", sid)
failed_items.append({"session_id": sid, "reason": "internal_error"})
Original comment in English

suggestion: The broad exception in batch_delete_sessions loses error details; logging the exception would aid debugging.

The broad except Exception: keeps the batch resilient, but the warning currently drops exception details. Please switch to logger.exception("Failed to delete session %s", sid) (or logger.warning(..., exc_info=True)) so stack traces are preserved while keeping external behavior unchanged.

Suggested change
try:
await self._delete_session_internal(session, username)
deleted_count += 1
sessions_by_id.pop(sid, None)
try:
await self._delete_session_internal(session, username)
deleted_count += 1
sessions_by_id.pop(sid, None)
except Exception:
logger.exception("Failed to delete session %s", sid)
failed_items.append({"session_id": sid, "reason": "internal_error"})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:webui The bug / feature is about webui(dashboard) of astrbot. feature:chatui The bug / feature is about astrbot's chatui, webchat size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant