Skip to content

fix: 修复会话恢复、并发持久化与消息投递(v3.18.5) - #110

Merged
69gg merged 121 commits into
mainfrom
bugfix/review-findings
Oct 11, 2026
Merged

69gg merged 121 commits into
mainfrom
bugfix/review-findings

Conversation

@69gg

@69gg 69gg commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

变更说明

修复聊天、消息投递和后台任务在切换会话、断线、取消、重启及写入失败时的状态错乱,避免重复发送、旧响应覆盖新操作和未持久化的数据被提前确认。本 PR 汇总该分支全部修复,并按主题整理 v3.18.5 更新记录,同步后端、Console 与 Chat 的版本及锁文件。

影响范围

  • 聊天与客户端:任务完成等待历史提交和会话释放;续接快照保留正文、工具与嵌套 Agent 时间线;隔离旧轮询、历史、日志、登录及编辑请求,保留草稿与缓存,修复图片、下载和 Android 生命周期监听。
  • 消息与调度:按确认结果记录微信投递,历史或统计故障不触发重复发送;令牌失效及明确连接前失败保留原错误,部分送达或结果不确定时阻止业务整条补发;修复 OneBot 重连、批次取消、模型队列裁剪和停止收尾顺序,普通群聊 LLM 新请求支持排队准入上限。
  • 持久化与热更新:配置、记忆、会话和自动化按序提交,取消等待已开始的写入;串行重启配置监听器并补读停止窗口变更;修复并行循环输出覆盖、表情包编辑及删除竞争、知识与侧写索引重试。
  • 文件与部署:修正 CQ 参数、本地文件 URI、压缩下载长度和取消后的文件清理,限制侧写与文件分析操作路径;修复宿主 Docker 共享目录、IPv6 地址和 LxMusic 配置更新。
  • 具体用户影响及维护操作见 CHANGELOG.md 的 v3.18.5 条目。

关联 Issue

无。

自检

  • uv run ruff check . 与 uv run ruff format --check . 通过(提交钩子排除 code/ 子模块)
  • uv run mypy . 通过(提交钩子排除 code/ 子模块)
  • UNDEFINED_DEPLOY_WHEEL_CHECK=1 uv run pytest tests/ --cov --cov-report=term 一次完整运行通过(4559 passed、1 skipped,覆盖率 70.24%)
  • npm --prefix apps/undefined-console run check 通过
  • npm --prefix apps/undefined-chat run check 通过
  • 涉及配置项:已同步 config.toml.example 与 docs/configuration.md
  • 界面截图:本次为状态与异步行为修复,未附截图;已覆盖 jsdom/Vitest 交互回归,Android 未做实机验证

最终本地后端全量测试一次通过,包含真实 wheel 打包检查。Chat 完整检查包含 507 项单元测试、50 项 e2e、1 项生产构建回归和 76 项 Rust 测试;Console 完整检查通过。scripts/release_notes.py validate --tag v3.18.5 确认所有版本一致。回归覆盖真实 SDK→业务投递、旧自动化 JSON 加载、Memory 工具统一错误处理、队列满额与热更新,以及配置恢复失败、恢复快照/发送 ACK/迟到订阅交错。

备注

  • WebUI 为支持聊天中普通 Markdown 远程图片预览,有意将 CSP 的 img-src 放开到 http: / https:;图片来源由消息内容决定,因此未固定域名白名单,浏览器会直接请求图片站点。附件 UID 预览仍走同源 Management 代理,script-src 继续限制同源及 nonce,connect-src 继续仅允许同源。现有 Chromium 回归验证远程图片可加载、外域脚本与 fetch 仍被拦截。
  • arXiv 下载清理会等待已经开始的文件操作,并抵抗 asyncio 任务取消;这不承诺在清理期间再次出现进程级中断、事件循环强制停止或进程被强杀时仍能完成清理。
  • [webui].stop_timeout_seconds 默认 0 等待自然收尾;设置正整数才会在超时后强制终止,停止按钮、关闭 WebUI 和更新前停止共用此规则。
  • [core].group_llm_queue_max_pending 默认 128,支持热更新,仅限制每模型普通群聊新 LLM 排队准入;满时明确拒绝新请求并清理等待者,保留已接收请求及重试,不是总并发或内存上限,过载时普通自动回复可能结束而不发送消息。
  • restore_profile.py restore 会同步检索正文与向量;操作前停止机器人及其他写入进程,向量同步失败可用 sync 重试。
  • loop.times.count=0 跳过循环,负数、布尔值和字符串会被拒绝;损坏 TOML 不再因 strict=False 被当作空配置应用。
  • 已完成本地 GPG 签名提交与分支推送;此 PR 不合并分支或创建发布标签。

69gg added 30 commits October 6, 2026 11:24
Accept UTF-8 BOM configuration and preserve cancellation without side effects.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 259 files, which is 159 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

⚙️ Run configuration
  • Configuration used: Repository: 69gg/Undefined/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 53c2891c-418e-4c1f-a758-c788f03bc24f

📥 Commits

Reviewing files that changed from the base of the PR and between 3a94218 and b383897.


⛔ Files ignored due to path filters (5)
  • apps/undefined-chat/package-lock.json is excluded by !**/package-lock.json
  • apps/undefined-chat/src-tauri/Cargo.lock is excluded by !**/*.lock
  • apps/undefined-console/package-lock.json is excluded by !**/package-lock.json
  • apps/undefined-console/src-tauri/Cargo.lock is excluded by !**/*.lock
  • uv.lock is excluded by !**/*.lock

📒 Files selected for processing (259)
  • AGENTS.md
  • ARCHITECTURE.md
  • CHANGELOG.md
  • apps/undefined-chat/README.md
  • apps/undefined-chat/biome.json
  • apps/undefined-chat/package.json
  • apps/undefined-chat/src-tauri/Cargo.toml
  • apps/undefined-chat/src-tauri/src/download.rs
  • apps/undefined-chat/src-tauri/src/native_tests.rs
  • apps/undefined-chat/src-tauri/src/runtime_client.rs
  • apps/undefined-chat/src-tauri/tauri.conf.json
  • apps/undefined-chat/src/App.test.tsx
  • apps/undefined-chat/src/App.tsx
  • apps/undefined-chat/src/chat-store/connection-recovery.test.ts
  • apps/undefined-chat/src/chat-store/conversation-rename.test.ts
  • apps/undefined-chat/src/chat-store/history-order.test.ts
  • apps/undefined-chat/src/chat-store/resume-completion.test.ts
  • apps/undefined-chat/src/chat-store/runtime-contract.test.ts
  • apps/undefined-chat/src/chat-store/runtime-scope.test.ts
  • apps/undefined-chat/src/chat-store/send-recovery.test.ts
  • apps/undefined-chat/src/chat-store/snapshot-recovery.test.tsx
  • apps/undefined-chat/src/chat-store/store.test.ts
  • apps/undefined-chat/src/chat-store/store.ts
  • apps/undefined-chat/src/chat-store/types.ts
  • apps/undefined-chat/src/chat-store/upload-suspension.test.ts
  • apps/undefined-chat/src/connection-recovery.test.tsx
  • apps/undefined-chat/src/i18n/index.ts
  • apps/undefined-chat/src/image-viewer/ImageViewerModal.tsx
  • apps/undefined-chat/src/message-timeline/MessageTimeline.test.tsx
  • apps/undefined-chat/src/message-timeline/MessageTimeline.tsx
  • apps/undefined-chat/src/message-timeline/MessageTimelineContent.test.tsx
  • apps/undefined-chat/src/message-timeline/MessageTimelineContent.tsx
  • apps/undefined-chat/src/message-timeline/ToolBlock.README.md
  • apps/undefined-chat/src/message-timeline/ToolBlock.tsx
  • apps/undefined-chat/src/platform/AndroidLifecycle.test.ts
  • apps/undefined-chat/src/platform/AndroidLifecycle.ts
  • apps/undefined-chat/src/rendering/AttachmentImage.tsx
  • apps/undefined-chat/src/rendering/AttachmentImageContext.test.tsx
  • apps/undefined-chat/src/rendering/AttachmentImageContext.tsx
  • apps/undefined-chat/src/rendering/CodeBlock.test.tsx
  • apps/undefined-chat/src/rendering/CodeBlock.tsx
  • apps/undefined-chat/src/rendering/MarkdownContent.test.tsx
  • apps/undefined-chat/src/rendering/blob-lifecycle.test.tsx
  • apps/undefined-chat/src/runtime-client/tauri.test.ts
  • apps/undefined-chat/src/runtime-client/tauri.ts
  • apps/undefined-chat/src/runtime-client/types.ts
  • apps/undefined-chat/src/test-fixtures.ts
  • apps/undefined-chat/tests/build-chunks.node.mjs
  • apps/undefined-chat/tests/e2e/connection-setup.test.tsx
  • apps/undefined-chat/vite.config.ts
  • apps/undefined-console/README.md
  • apps/undefined-console/biome.json
  • apps/undefined-console/package.json
  • apps/undefined-console/src-tauri/Cargo.toml
  • apps/undefined-console/src-tauri/tauri.conf.json
  • apps/undefined-console/src/connection-profiles.test.cjs
  • apps/undefined-console/src/main.ts
  • config.toml.example
  • docs/automations.md
  • docs/build.md
  • docs/cognitive-memory.md
  • docs/configuration.md
  • docs/deployment.md
  • docs/development.md
  • docs/docker-deploy.md
  • docs/knowledge.md
  • docs/management-api.md
  • docs/memes.md
  • docs/message-batching.md
  • docs/naga_integration_contract.md
  • docs/openapi.md
  • docs/python-api.md
  • docs/undefined-chat.md
  • docs/webui-guide.md
  • docs/wechat-ilink.md
  • pyproject.toml
  • scripts/README.md
  • scripts/bump_version.py
  • scripts/reembed_cognitive.py
  • scripts/restore_profile.py
  • src/Undefined/__init__.py
  • src/Undefined/ai/client/ask_loop.py
  • src/Undefined/ai/client/queue.py
  • src/Undefined/ai/multimodal/analyzer.py
  • src/Undefined/api/_helpers.py
  • src/Undefined/api/app.py
  • src/Undefined/api/routes/chat.py
  • src/Undefined/api/routes/cognitive.py
  • src/Undefined/api/routes/memory.py
  • src/Undefined/api/routes/naga/send.py
  • src/Undefined/api/webchat_store.py
  • src/Undefined/arxiv/downloader.py
  • src/Undefined/arxiv/sender.py
  • src/Undefined/attachments/render.py
  • src/Undefined/attachments/segments.py
  • src/Undefined/automations/runner.py
  • src/Undefined/automations/storage.py
  • src/Undefined/automations/validate.py
  • src/Undefined/bilibili/downloader.py
  • src/Undefined/cognitive/historian/worker.py
  • src/Undefined/cognitive/profile_storage.py
  • src/Undefined/cognitive/service/service.py
  • src/Undefined/config/build_config.py
  • src/Undefined/config/config_class.py
  • src/Undefined/config/env_registry.py
  • src/Undefined/config/hot_reload.py
  • src/Undefined/config/load_sections/core.py
  • src/Undefined/config/load_sections/domains.py
  • src/Undefined/config/manager.py
  • src/Undefined/config/models.py
  • src/Undefined/config/parsers/helpers.py
  • src/Undefined/config/webui_settings.py
  • src/Undefined/deploy/config_patch.py
  • src/Undefined/deploy/generate.py
  • src/Undefined/deploy/runner.py
  • src/Undefined/deploy/templates/compose.bot.yaml
  • src/Undefined/deploy/templates/compose.lxmusic2api.yaml
  • src/Undefined/douyin/sender.py
  • src/Undefined/handlers/message_flow.py
  • src/Undefined/jm/client.py
  • src/Undefined/jm/downloader.py
  • src/Undefined/jm/parser.py
  • src/Undefined/knowledge/embedder.py
  • src/Undefined/knowledge/manager.py
  • src/Undefined/knowledge/reranker.py
  • src/Undefined/knowledge/store.py
  • src/Undefined/main.py
  • src/Undefined/memes/models.py
  • src/Undefined/memes/search.py
  • src/Undefined/memes/service.py
  • src/Undefined/memes/store.py
  • src/Undefined/memes/worker.py
  • src/Undefined/memory.py
  • src/Undefined/onebot/client.py
  • src/Undefined/onebot/file_references.py
  • src/Undefined/services/coordinator/background.py
  • src/Undefined/services/coordinator/group.py
  • src/Undefined/services/coordinator/private.py
  • src/Undefined/services/message_batcher/scheduler.py
  • src/Undefined/services/queue_manager.py
  • src/Undefined/skills/README.md
  • src/Undefined/skills/agents/file_analysis_agent/README.md
  • src/Undefined/skills/agents/file_analysis_agent/prompt.md
  • src/Undefined/skills/agents/file_analysis_agent/tools/cleanup_temp/config.json
  • src/Undefined/skills/agents/file_analysis_agent/tools/cleanup_temp/handler.py
  • src/Undefined/skills/agents/file_analysis_agent/tools/extract_archive/config.json
  • src/Undefined/skills/agents/file_analysis_agent/tools/extract_archive/handler.py
  • src/Undefined/skills/registry.py
  • src/Undefined/skills/shared.py
  • src/Undefined/skills/tools/arxiv_paper/README.md
  • src/Undefined/skills/tools/bilibili_opus/README.md
  • src/Undefined/skills/tools/bilibili_video/README.md
  • src/Undefined/skills/tools/douyin_video/README.md
  • src/Undefined/skills/tools/python_interpreter/README.md
  • src/Undefined/skills/tools/python_interpreter/handler.py
  • src/Undefined/skills/tools/task_progress/README.md
  • src/Undefined/skills/tools/task_progress/handler.py
  • src/Undefined/skills/toolsets/cognitive/README.md
  • src/Undefined/skills/toolsets/cognitive/get_profile/handler.py
  • src/Undefined/skills/toolsets/memory/README.md
  • src/Undefined/skills/toolsets/messages/README.md
  • src/Undefined/utils/common.py
  • src/Undefined/utils/http_download.py
  • src/Undefined/utils/io.py
  • src/Undefined/utils/paths.py
  • src/Undefined/utils/sender.py
  • src/Undefined/webui/app.py
  • src/Undefined/webui/core.py
  • src/Undefined/webui/routes/_auth.py
  • src/Undefined/webui/routes/_bot.py
  • src/Undefined/webui/routes/_config.py
  • src/Undefined/webui/static/js/api.js
  • src/Undefined/webui/static/js/config-form.js
  • src/Undefined/webui/static/js/log-view.js
  • src/Undefined/webui/static/js/main.js
  • src/Undefined/webui/static/js/memes.js
  • src/Undefined/webui/static/js/runtime.js
  • src/Undefined/webui/static/js/schedules.js
  • src/Undefined/webui/static/js/weixin.js
  • src/Undefined/webui/static/js/workflow-inspector.js
  • src/Undefined/webui/utils/config_io.py
  • src/Undefined/webui/utils/config_sync.py
  • src/Undefined/weixin/service.py
  • src/Undefined/weixin/transport.py
  • tests/frontend/runtime_chat_harness.js
  • tests/test_arxiv_downloader.py
  • tests/test_arxiv_sender.py
  • tests/test_attachment_cq_roundtrip.py
  • tests/test_attachment_file_uri.py
  • tests/test_automation_legacy_loop_count.py
  • tests/test_automation_loop_outputs.py
  • tests/test_automation_storage_ordering.py
  • tests/test_automations.py
  • tests/test_bilibili_downloader_adapter.py
  • tests/test_bilibili_opus_sender.py
  • tests/test_bump_version_script.py
  • tests/test_cognitive_historian_ordering.py
  • tests/test_cognitive_profile_paths.py
  • tests/test_cognitive_service.py
  • tests/test_config_from_mapping.py
  • tests/test_config_hot_reload.py
  • tests/test_config_watcher_restart.py
  • tests/test_core_config.py
  • tests/test_deploy_config_patch.py
  • tests/test_deploy_generate.py
  • tests/test_deploy_runner.py
  • tests/test_douyin_sender.py
  • tests/test_end_to_end_message_pipeline.py
  • tests/test_file_analysis_archive_cleanup.py
  • tests/test_group_llm_queue_capacity.py
  • tests/test_group_llm_queue_trim.py
  • tests/test_http_download.py
  • tests/test_jm_downloader.py
  • tests/test_jm_parser.py
  • tests/test_jm_tool.py
  • tests/test_knowledge.py
  • tests/test_main_shutdown.py
  • tests/test_meme_lifecycle.py
  • tests/test_meme_reanalysis.py
  • tests/test_meme_worker.py
  • tests/test_memory_persistence.py
  • tests/test_message_batcher.py
  • tests/test_message_batcher_integration.py
  • tests/test_multimodal_analysis_cache.py
  • tests/test_onebot_connection_lifecycle.py
  • tests/test_onebot_file_urls.py
  • tests/test_python_interpreter_handler.py
  • tests/test_queue_manager.py
  • tests/test_queued_llm_cancellation.py
  • tests/test_reembed_cognitive_script.py
  • tests/test_restore_profile_script.py
  • tests/test_runtime_api_app.py
  • tests/test_runtime_api_chat_jobs.py
  • tests/test_runtime_api_memory.py
  • tests/test_runtime_api_naga.py
  • tests/test_sender.py
  • tests/test_skills_import_boundary.py
  • tests/test_skills_registry_stats.py
  • tests/test_tool_search_ask_loop.py
  • tests/test_utils_common.py
  • tests/test_webchat_store_commits.py
  • tests/test_webui_auth_refresh_behavior.py
  • tests/test_webui_config_backups.py
  • tests/test_webui_config_hot_reload.py
  • tests/test_webui_config_save_behavior.py
  • tests/test_webui_config_transactions.py
  • tests/test_webui_csp_images.py
  • tests/test_webui_gzip.py
  • tests/test_webui_logs_frontend.py
  • tests/test_webui_management_api.py
  • tests/test_webui_memes_behavior.py
  • tests/test_webui_process_shutdown.py
  • tests/test_webui_runtime_chat_behavior.py
  • tests/test_webui_schedules_behavior.py
  • tests/test_webui_settings.py
  • tests/test_webui_update.py
  • tests/test_webui_weixin_behavior.py
  • tests/test_weixin_delivery.py
  • tests/test_weixin_service.py

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@69gg
69gg merged commit 9fde0f5 into main Oct 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant