advent259141
3a8bfa0873
style: ruff format on merge-touched files
2026-03-13 09:20:08 +08:00
advent259141
c07fba7add
merge: resolve conflicts with origin/master
...
- .gitignore: keep both .serena and .worktrees/ entries
- astr_main_agent_resources.py: keep deletion (refactored to tools/)
- send_message.py: port video message type support from master
2026-03-13 09:17:31 +08:00
zenfun
855483c8c2
style: fix ruff I001/F401 violations in changed files
2026-03-13 01:18:39 +08:00
zenfun
048c511b18
fix: align browser property with base class and remove dead env writes
...
- shipyard_neo: browser property now returns None when not initialized
instead of raising RuntimeError, matching ComputerBooter base contract
- computer_tool_provider: remove dead os.environ writes for shipyard
(SHIPYARD_ENDPOINT / SHIPYARD_ACCESS_TOKEN are never read anywhere)
and remove unused os import
2026-03-13 01:14:23 +08:00
zenfun
dfc0c34d95
fix: address review issues in tool injection refactor
...
- Rewrite TestApplySandboxToolsRefactored to test ComputerToolProvider
directly (_apply_sandbox_tools was removed; old tests permanently skipped)
- Add TestExecutorCapabilityGuard with 5 strict tests for browser
capability rejection at executor level
- Fix typo: "on hehalf you" -> "on behalf of you" in subagent result
- Remove extra blank lines (ruff E303) after _apply_sandbox_tools comment
- Remove dead _build_sync_and_scan_command (no callers after refactor)
2026-03-13 01:11:50 +08:00
zenfun
7c3cc7b90c
refactor: add capabilities to sandbox tool binding logs
2026-03-12 02:58:48 +08:00
zenfun
a5a1ba72fd
refactor: add get_sandbox_capabilities API and structured logging to computer_client
2026-03-12 02:58:15 +08:00
zenfun
e1d76117b4
refactor: standardize booter structured logging format
2026-03-12 02:57:04 +08:00
zenfun
ad3911a21f
refactor: add debug logging to sandbox tool resolution
2026-03-12 02:56:59 +08:00
zenfun
3440dcd14b
test: add booter decoupling and profile-aware tool tests
2026-03-12 02:55:09 +08:00
zenfun
e85eef05b8
fix: stabilize tool injection for LLM prefix cache hits
...
Two changes to make the tool schema sent to the LLM deterministic:
1. ToolSet.normalize() — sort tools by name before serialization.
Called at the end of build_main_agent() after all injection passes.
Eliminates ordering drift from plugin load order, MCP reconnection,
and persona tool list differences.
2. Always inject full sandbox tool set — ComputerToolProvider now
returns get_default_sandbox_tools() unconditionally, regardless of
sandbox boot state. Browser tools are always in the schema even if
the sandbox profile lacks browser capability. The executor rejects
calls to unavailable browser tools with a descriptive error instead
of silently omitting them from the schema.
This eliminates the pre-boot/post-boot tool set jump that caused
prefix cache misses on the second request of a conversation.
2026-03-12 02:43:19 +08:00
zenfun
f16edd4fff
refactor: delegate tool injection to booter self-description API
...
- Add get_default_tools/get_tools/get_system_prompt_parts to ComputerBooter base
- Each booter subclass (ShipyardNeo, Shipyard, Boxlite) declares its own tools
- ComputerToolProvider now delegates to booter API via computer_client helpers
- Add unified query API: get_sandbox_tools, get_default_sandbox_tools, etc.
- Extract Neo prompts to dedicated computer/prompts.py module
- Add booter type constants (booters/constants.py)
- Fix subagent tool path to pass sandbox_cfg and session_id
- Fix Sourcery issues: shell injection in send_message, typo in prompts,
internal tools bypass inactivated_llm_tools check
2026-03-12 02:43:19 +08:00
DOHEX
3e2cb6a2ab
fix(telegram): remove deprecated normalize_whitespace param from ( #6044 )
...
telegramify_markdown.markdownify calls
2026-03-12 00:34:07 +08:00
莫思潋
25830524f3
fix(docs): typo in docker.md & napcat.md ( #6048 )
...
* Fix wording in admin ID configuration instructions
* Update docker.md
2026-03-12 00:30:31 +08:00
Soulter
304094630c
perf: optimize booter selection for edge cases and message sending tool ( #6064 )
...
* feat: add video message support and enhance message type descriptions in SendMessageToUserTool
* feat: add error handling for disabled sandbox runtime in get_booter function
2026-03-12 00:29:52 +08:00
Soulter
5c3643c54c
feat: added support for file, voice, and video messages for QQ Official Bot (including WebSocket mode). ( #6063 )
2026-03-12 00:26:08 +08:00
エイカク
589cce18af
fix: improve Windows local skill file reading ( #6028 )
...
* chore: ignore local worktrees
* fix: improve Windows local skill file reading
* fix: address Windows path and decoding review feedback
* fix: simplify shell decoding follow-up
* fix: harden sandbox skill prompt metadata
* fix: preserve safe sandbox skill summaries
* fix: relax sandbox summary sanitization
* fix: tighten path sanitization for skill prompts
* fix: harden sandbox skill display metadata
* fix: preserve Unicode skill paths in prompts
* fix: quote Windows skill prompt paths
* fix: simplify local shell output decoding
* fix: localize Windows prompt path handling
* fix: normalize Windows-style skill paths in prompts
* fix: align prompt and shell decoding behavior
2026-03-11 23:58:28 +09:00
Soulter
e254caf82d
fix(docs): add official developer group ID to multiple language READMEs and enhance regex description in config metadata
2026-03-11 21:26:11 +08:00
advent259141
438fc105cd
feat: 增加在工具注入前对工具是否启用的检查
2026-03-11 20:37:41 +08:00
Soulter
7efcd242d6
fix(docs): update edit link patterns and remove obsolete repository reference
2026-03-11 17:42:42 +08:00
JIANG Zijun
5d811d3949
fix: Persist Discord pre-ack emoji config across restart by adding missing default key ( #6031 )
...
* Initial plan
* fix: add discord default platform_specific pre-ack config
Co-authored-by: Jzjerry <20167827+Jzjerry@users.noreply.github.com >
* Delete tests/unit/test_config.py
we don't need to add tests
* fix: use 🤔 as default discord pre-ack emoji
Co-authored-by: Jzjerry <20167827+Jzjerry@users.noreply.github.com >
* add back old test config
* doc: discord pre-ack-emoji doc
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com >
Co-authored-by: Jzjerry <20167827+Jzjerry@users.noreply.github.com >
2026-03-11 16:41:08 +08:00
Flartiny
8e6aaee10c
fix(webui): unify search input clear behavior ( #6017 )
...
* fix(webui): unify search input clear behavior
* fix: centralize search input normalization
2026-03-11 15:14:16 +08:00
エイカク
6da59cfb07
fix: 插件依赖自动安装逻辑与 Dashboard 安装体验优化 ( #5954 )
...
* fix: install plugin requirements before first load
* fix: handle pip option arguments correctly
* fix: harden pip install input parsing
* refactor: simplify pip install input parsing
* fix: align plugin dependency install handling
* fix: respect configured pip index overrides
* test: parameterize plugin dependency install flows
* refactor: simplify multiline pip input parsing
* fix: install plugin dependencies before loading
* fix: protect core dependencies from downgrades and simplify package input splitting
* fix: enhance dependency conflict reporting and improve user-facing warnings
* refactor: preserve pip log indentation and fix CodeQL URL sanitization alert
* fix: explicit re-export for DependencyConflictError to satisfy ruff F401
* test: enhance index override verification in pip installer tests
* fix: correctly map pip ERROR and WARNING outputs to proper log levels
* refactor: show specific version conflicts in DependencyConflictError and revert log level mapping
* refactor: simplify install() by decoupling pip logging, failure classification and constraint file management
* refactor: further simplify pip installer and requirement parsing logic
* refactor: simplify dependency installation logic and improve circular requirement reporting
* style: organize imports in astrbot/core/__init__.py
* refactor: optimize requirement parsing efficiency and flatten pip installer API
* style: fix import sorting in astrbot/core/__init__.py
* refactor: consolidate requirement parsing, optimize core protection, and improve exception propagation
* fix: preserve valid pip requirement parsing
* fix: skip empty pip installs and preserve blank output
* chore: normalize gitignore entry style
* fix: tighten pip trust and requirement parsing
* refactor: centralize pip install parsing and failure handling
* fix: redact pip argv credentials in logs
* fix: surface plugin dependency install errors
* fix: cache core constraints and clarify requirement installs
* fix: harden pip requirement parsing for plugin installs
* fix: simplify pip installer parsing internals
* fix: tighten pip installer parsing and redaction
* refactor: simplify plugin dependency install flow
* fix: preserve core constraint conflict errors
* fix: harden pip installer fallback resolution
* refactor: split pip requirement and constraint helpers
* refactor: simplify pip installer helper flow
* refactor: streamline requirement precheck helpers
* refactor: clarify core constraint resolution
* fix: surface pip install failures explicitly
* refactor: separate pip conflict context parsing
* fix: harden core constraint resolution
* test: cover pip installer failure call sites
* refactor: remove dead requirements fallback helper
* refactor: narrow core constraint error handling
* refactor: unify requirement iteration
* refactor: share requirement name parsing
* test: align pip helper coverage
* fix: bind pip output limit at runtime
* refactor: reuse core requirement parser for tokens
2026-03-11 14:21:55 +09:00
advent259141
eae87e1ec9
Merge branch 'agent-fix-clean' of https://github.com/advent259141/AstrBot into agent-fix-clean
2026-03-11 10:42:30 +08:00
advent259141
894d72e657
feat: Introduce an internal agent sub-stage to the pipeline, enabling LLM agentic capabilities with configurable tools and context management.
2026-03-11 10:42:19 +08:00
Gao Jinzhe
42b8293f99
Merge branch 'AstrBotDevs:master' into agent-fix-clean
2026-03-11 09:48:36 +08:00
Soulter
10ceacfbb1
chore: bump version to 4.19.5
v4.19.5
2026-03-11 00:17:14 +08:00
ChuwuYo
66f5ccd902
fix: add file size validation to TTS provider test and MiniMax empty audio detection ( #5999 )
...
- Add audio data validation in MiniMax TTS get_audio() method to detect empty responses
- Validate generated audio file size in TTSProvider.test() to ensure valid output
- Provide detailed error messages guiding users to check group_id configuration
- Auto-cleanup test audio files after validation
- Fixes issue where 0KB audio files would pass TTS detection when group_id is not configured
2026-03-11 00:07:19 +08:00
Soulter
3379587223
feat(mcp): enhance logging and initialize MCP clients in background ( #5993 )
...
* feat(mcp): enhance logging and initialize MCP clients in background
fixes : #5777
* rf
* fix(mcp): simplify MCP client initialization in background
* fix(mcp): update error message for MCP background initialization failure
2026-03-11 00:00:48 +08:00
邹永赫
e25a1a42cf
Revert "fix: clarify missing MCP stdio command errors ( #5992 )"
...
This reverts commit 0c771e4a77 .
2026-03-11 00:08:06 +09:00
advent259141
21f1fa82f4
feat: Implement API routes and dashboard UI for managing tools and MCP servers.
2026-03-10 22:22:18 +08:00
エイカク
0c771e4a77
fix: clarify missing MCP stdio command errors ( #5992 )
...
* fix: clarify missing MCP stdio command errors
* refactor: tighten MCP error presentation helpers
* fix: improve MCP test connection feedback
* fix: structure MCP test connection errors
* refactor: share MCP test error codes
2026-03-10 23:05:50 +09:00
advent259141
ff4412a627
refactor: Centralize and decouple computer-use tool injection logic into a new ComputerToolProvider and associated tool modules.
2026-03-10 22:00:23 +08:00
advent259141
bf430e659a
feat: Introduce cron job management and refactor tool provisioning with dedicated providers for computer-use runtimes.
2026-03-10 21:05:09 +08:00
camera-2018
ec21cb13d3
feat(lark): supports CardKit streaming output for feishu ( #5777 )
...
* feat(lark): 支持飞书 CardKit 流式输出
* refactor(lark): extract streaming fallback logic and deduplicate final text update
* fix(lark): 修复流式输出竞态条件及增强健壮性
- 修复 sender loop 中 delta 快照竟态: await 期间 delta 被 generator
更新导致 last_sent 记录了未发送的值, 造成输出卡在最后一段
- send_streaming 入口增加 platform_meta 守卫, 未启用时直接回退
- _fallback_send_streaming 移除对已耗尽 generator 的 super() 调用,
改为内联父类副作用 (Metric.upload + _has_send_oper)
- Metric.upload 统一改为 await, 确保指标上报在方法返回前完成
- 装饰器 support_streaming_message 改为 False, 与 meta() 动态配置对齐
- i18n hint 补充提示: 需在「AI 配置 → 其他配置」中开启流式输出
* chore(lark): 收口配置
* docs(lark): update streaming output instructions and client version requirements
---------
Co-authored-by: bread-ovo <2570425204@qq.com >
Co-authored-by: Soulter <905617992@qq.com >
2026-03-10 19:40:46 +08:00
Soulter
1d26b96d90
fix(workflow): update build-docs.yml to trigger on version tags instead of master branch
2026-03-10 17:16:56 +08:00
一袋米要扛幾樓
be017c87f4
fix: 前端修正切換到 chat 切換後回 welcome 的配置保存最終切換頁面 ( #5792 )
...
* 前端修正切換到chat切換後回 welcome 的配置保存最終切換頁面
* 修復 SSR 不含localStorage 環境驗證
2026-03-10 17:14:28 +08:00
lustresixx
23fffa95c8
fix(provider): support 84-char Azure TTS subscription keys ( #5813 )
...
* fix(provider): support 84-char Azure TTS subscription keys
* test(provider): add negative Azure TTS key validation cases
* chore: delete test
---------
Co-authored-by: Soulter <905617992@qq.com >
2026-03-10 17:09:13 +08:00
dependabot[bot]
5b303e2e6d
chore(deps): bump the github-actions group with 7 updates ( #5966 )
...
Bumps the github-actions group with 7 updates:
| Package | From | To |
| --- | --- | --- |
| [actions/setup-node](https://github.com/actions/setup-node ) | `2` | `6` |
| [actions/checkout](https://github.com/actions/checkout ) | `4` | `6` |
| [actions/setup-python](https://github.com/actions/setup-python ) | `5` | `6` |
| [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action ) | `3` | `4` |
| [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action ) | `3` | `4` |
| [docker/login-action](https://github.com/docker/login-action ) | `3` | `4` |
| [docker/build-push-action](https://github.com/docker/build-push-action ) | `6` | `7` |
Updates `actions/setup-node` from 2 to 6
- [Release notes](https://github.com/actions/setup-node/releases )
- [Commits](https://github.com/actions/setup-node/compare/v2...v6 )
Updates `actions/checkout` from 4 to 6
- [Release notes](https://github.com/actions/checkout/releases )
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md )
- [Commits](https://github.com/actions/checkout/compare/v4...v6 )
Updates `actions/setup-python` from 5 to 6
- [Release notes](https://github.com/actions/setup-python/releases )
- [Commits](https://github.com/actions/setup-python/compare/v5...v6 )
Updates `docker/setup-qemu-action` from 3 to 4
- [Release notes](https://github.com/docker/setup-qemu-action/releases )
- [Commits](https://github.com/docker/setup-qemu-action/compare/v3...v4 )
Updates `docker/setup-buildx-action` from 3 to 4
- [Release notes](https://github.com/docker/setup-buildx-action/releases )
- [Commits](https://github.com/docker/setup-buildx-action/compare/v3...v4 )
Updates `docker/login-action` from 3 to 4
- [Release notes](https://github.com/docker/login-action/releases )
- [Commits](https://github.com/docker/login-action/compare/v3...v4 )
Updates `docker/build-push-action` from 6 to 7
- [Release notes](https://github.com/docker/build-push-action/releases )
- [Commits](https://github.com/docker/build-push-action/compare/v6...v7 )
---
updated-dependencies:
- dependency-name: actions/setup-node
dependency-version: '6'
dependency-type: direct:production
update-type: version-update:semver-major
dependency-group: github-actions
- dependency-name: actions/checkout
dependency-version: '6'
dependency-type: direct:production
update-type: version-update:semver-major
dependency-group: github-actions
- dependency-name: actions/setup-python
dependency-version: '6'
dependency-type: direct:production
update-type: version-update:semver-major
dependency-group: github-actions
- dependency-name: docker/setup-qemu-action
dependency-version: '4'
dependency-type: direct:production
update-type: version-update:semver-major
dependency-group: github-actions
- dependency-name: docker/setup-buildx-action
dependency-version: '4'
dependency-type: direct:production
update-type: version-update:semver-major
dependency-group: github-actions
- dependency-name: docker/login-action
dependency-version: '4'
dependency-type: direct:production
update-type: version-update:semver-major
dependency-group: github-actions
- dependency-name: docker/build-push-action
dependency-version: '7'
dependency-type: direct:production
update-type: version-update:semver-major
dependency-group: github-actions
...
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-10 16:56:52 +08:00
Soulter
fc33b3eb68
docs: transfer AstrBotDevs/AstrBot-docs to AstrBotDevs/AstrBot ( #5960 )
...
* docs: transfer AstrBotDevs/AstrBot-docs to AstrBotDevs/AstrBot
* refactor: reorder imports and improve type hints in sync_docs_to_wiki.py and upload_doc_images_to_r2.py
* feat: add GitHub Actions workflow to sync wiki with documentation
Co-authored-by: Soulter <37870767+Soulter@users.noreply.github.com >
Co-authored-by: anka-afk <110004162+anka-afk@users.noreply.github.com >
Co-authored-by: zouyonghe <62183434+zouyonghe@users.noreply.github.com >
Co-authored-by: shuiping233 <49360196+shuiping233@users.noreply.github.com >
Co-authored-by: LIghtJUNction <106986785+LIghtJUNction@users.noreply.github.com >
Co-authored-by: Sjshi763 <179909421+Sjshi763@users.noreply.github.com >
Co-authored-by: xiewoc <70128845+xiewoc@users.noreply.github.com >
Co-authored-by: QingFeng-awa <151742581+QingFeng-awa@users.noreply.github.com >
Co-authored-by: PaloMiku <96452465+PaloMiku@users.noreply.github.com >
Co-authored-by: shangxueink <138397030+shangxueink@users.noreply.github.com >
Co-authored-by: IGCrystal-A <244300990+IGCrystal-A@users.noreply.github.com >
Co-authored-by: RC-CHN <67079377+RC-CHN@users.noreply.github.com >
Co-authored-by: MC090610 <113341105+MC090610@users.noreply.github.com >
Co-authored-by: Waterwzy <196913419+Waterwzy@users.noreply.github.com >
Co-authored-by: Lanhuace-Wan <186303160+Lanhuace-Wan@users.noreply.github.com >
Co-authored-by: LiAlH4qwq <61769640+LiAlH4qwq@users.noreply.github.com >
Co-authored-by: HSOS6 <209910899+HSOS6@users.noreply.github.com >
Co-authored-by: th-dd <162813557+th-dd@users.noreply.github.com >
Co-authored-by: miaoxutao123 <81676466+miaoxutao123@users.noreply.github.com >
Co-authored-by: nuomicici <143102889+nuomicici@users.noreply.github.com >
Co-authored-by: nasyt233 <210103278+nasyt233@users.noreply.github.com >
Co-authored-by: jlugjb <7426462+jlugjb@users.noreply.github.com >
Co-authored-by: Raven95676 <176760093+Raven95676@users.noreply.github.com >
Co-authored-by: Futureppo <180109455+Futureppo@users.noreply.github.com >
Co-authored-by: MliKiowa <61873808+MliKiowa@users.noreply.github.com >
Co-authored-by: Fridemn <150212937+Fridemn@users.noreply.github.com >
Co-authored-by: BakaCookie520 <138355736+BakaCookie520@users.noreply.github.com >
Co-authored-by: YumeYuka <125112916+YumeYuka@users.noreply.github.com >
Co-authored-by: xming521 <32786500+xming521@users.noreply.github.com >
Co-authored-by: ywh555hhh <121592812+ywh555hhh@users.noreply.github.com >
Co-authored-by: stevessr <89645372+stevessr@users.noreply.github.com >
Co-authored-by: roeseth <41995115+roeseth@users.noreply.github.com >
Co-authored-by: ikun-1145141 <265925499+ikun-1145141@users.noreply.github.com >
Co-authored-by: evpeople <54983536+evpeople@users.noreply.github.com >
Co-authored-by: Yue-bin <60509781+Yue-bin@users.noreply.github.com >
Co-authored-by: W1ndys <109416673+W1ndys@users.noreply.github.com >
Co-authored-by: TheFurina <218887821+TheFurina@users.noreply.github.com >
Co-authored-by: Seayon <12275933+Seayon@users.noreply.github.com >
Co-authored-by: OnlyblackTea <38585636+OnlyblackTea@users.noreply.github.com >
Co-authored-by: ocetars <74854972+ocetars@users.noreply.github.com >
Co-authored-by: railgun19457 <117180744+railgun19457@users.noreply.github.com >
Co-authored-by: JunieXD <107397009+JunieXD@users.noreply.github.com >
Co-authored-by: advent259141 <197440256+advent259141@users.noreply.github.com >
Co-authored-by: Doge2077 <91442300+Doge2077@users.noreply.github.com >
Co-authored-by: Bocity <23430545+Bocity@users.noreply.github.com >
Co-authored-by: Aurora-xk <192227833+Aurora-xk@users.noreply.github.com >
2026-03-09 23:38:21 +08:00
ChuwuYo
795aec9578
feat(extension): add filtering and sorting for installed plugins in WebUI ( #5923 )
...
* feat(extension): add PluginSortControl reusable component for sorting
* i18n: add i18n keys for plugin sorting and filtering features
* feat(extension): add sorting and status filtering for installed plugins
Backend changes (plugin.py):
- Add _resolve_plugin_dir method to resolve plugin directory path
- Add _get_plugin_installed_at method to get installation time from file mtime
- Add installed_at field to plugin API response
Frontend changes (InstalledPluginsTab.vue):
- Import PluginSortControl component
- Add status filter toggle (all/enabled/disabled) using v-btn-toggle
- Integrate PluginSortControl for sorting options
- Add toolbar layout with actions and controls sections
Frontend changes (MarketPluginsTab.vue):
- Import PluginSortControl component
- Replace v-select + v-btn combination with unified PluginSortControl
Frontend changes (useExtensionPage.js):
- Add installedStatusFilter, installedSortBy, installedSortOrder refs
- Add installedSortItems and installedSortUsesOrder computed properties
- Add sortInstalledPlugins function with multi-criteria support
- Support sorting by install time, name, author, and update status
- Add status filtering in filteredPlugins computed property
- Disable default table sorting by setting sortable: false
* test: add tests for installed_at field in plugin API
- Assert all plugins have installed_at field in get_plugins response
- Assert installed_at is not null after plugin installation
* fix(extension): add explicit fallbacks for installed plugin sort comparisons
* i18n(extension): rename install time label to last modified
* fix(extension): cache installed_at parsing and validate timestamp format in tests
* test(dashboard): strengthen installed_at coverage for plugin API
2026-03-09 17:12:22 +09:00
Soulter
7d31140c14
chore: bump version to 4.19.4
v4.19.4
2026-03-09 11:13:39 +08:00
Soulter
654112ca86
feat(wecomai): implement long connection mode and update configuration options ( #5930 )
2026-03-09 11:10:32 +08:00
Soulter
5dd30f9a45
chore: bump version to 4.19.3
v4.19.3
2026-03-09 00:20:33 +08:00
Jason
a53a1ca49b
fix(provider): handle MiniMax ThinkingBlock when max_tokens reached ( #5913 )
...
* fix(provider): handle MiniMax ThinkingBlock when max_tokens reached
Fixes #5912
Problem: MiniMax API returns ThinkingBlock when stop_reason='max_tokens',
but AstrBot throws 'completion 无法解析' exception because both
completion_text and tools_call_args are empty.
Root cause: The validation logic didn't consider ThinkingBlock
(reasoning_content) as valid content.
Fix: When completion_text and tools_call_args are empty but
reasoning_content is present, treat it as valid instead of throwing
exception. This happens when the model thinks but runs out of tokens
before generating the actual response.
Impact: MiniMax models now work correctly when responses are truncated
due to max_tokens limit.
* refactor: address review feedback
1. Use getattr for safe stop_reason access (prevent AttributeError)
2. Use ValueError instead of generic Exception for better error handling
Thanks @gemini-code-assist and @sourcery-ai for the review!
* refactor: flatten nested if/else with guard clause
Address Gemini Code Assist feedback:
- Use guard clause for early return
- Flattened nested conditional for better readability
Logic unchanged, just cleaner code structure.
* fix(provider): improve logging for ThinkingBlock completions in ProviderAnthropic
---------
Co-authored-by: Soulter <905617992@qq.com >
2026-03-09 00:17:11 +08:00
whatevertogo
3fd6c4c8a6
fix: 修复 asyncio 事件循环相关问题 ( #5774 )
...
* fix: 修复 asyncio 事件循环相关的问题
1. components.py: 修复异常处理结构错误
- 将 except Exception 移到正确的内部 try 块
- 确保 _download_file() 异常能被正确捕获和记录
2. session_lock.py: 修复跨事件循环 Lock 绑定问题
- 添加 _access_lock_loop_id 追踪事件循环
- 当事件循环变化时重新创建 Lock
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
* fix: 根据代码审查反馈修复问题
1. components.py: 移除 asyncio.set_event_loop() 调用
- 创建临时 event loop 时不再设置为全局
- 避免干扰其他 asyncio 使用
2. session_lock.py: 简化延迟初始化逻辑
- 移除 loop-ID 追踪和 _get_lock 方法
- 使用 setdefault 简化 session lock 创建
- 保留延迟初始化行为
3. wecomai_queue_mgr.py: 使用 time.monotonic() 替代 loop.time()
- 同步方法不再依赖活动的 event loop
- 避免在非异步上下文中抛出 RuntimeError
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
* fix: 优化 asyncio 事件循环管理,使用安全的方式创建和关闭事件循环
* fix: 根据代码审查反馈改进异常处理和事件循环使用
- main.py: 显式处理 check_dashboard_files() 返回 None 的情况
- components.py: 使用 logger.exception 保留异常堆栈信息
- star_manager.py: 添加 Future 异常回调处理 __del__ 执行异常
- bay_manager.py: 缓存事件循环引用避免重复调用
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
* refactor: 简化 SessionLockManager 使用 defaultdict 和 setdefault
- 使用 defaultdict(asyncio.Lock) 简化锁的懒创建
- 使用 setdefault 简化 _get_loop_state 逻辑
- 减少 get + if 分支,提升可读性
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
* fix: 降低 webui_dir 检查失败时的日志级别为 warning
改为警告而非退出,允许程序在无 WebUI 的情况下继续运行
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
* refactor: 重构事件循环锁管理,简化锁状态管理逻辑
* 新增对 SessionLockManager 的多事件循环隔离测试
* fix: 修复测试中的变量声明和断言,确保事件循环管理器的正确性
* fix: 修复插件删除时异常处理逻辑,确保正确记录错误信息
* fix: 新增针对多个事件循环的 OneBot 实例的测试,确保锁对象在不同事件循环间不共享
---------
Co-authored-by: whatevertogo <whatevertogo@users.noreply.github.com >
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-09 01:00:13 +09:00
sanyekana
5808784f07
fix: prevent crash on malformed MCP server config ( #5666 ) ( #5673 )
...
* fix: prevent crash on malformed MCP server config (#5666 )
* fix: prevent crash on malformed MCP server config (#5666 )
* fix: validate MCP connection before persisting server config
* fix: guard mcpServers type before iterating server list
* refactor: use typed empty-config error and extract MCP rollback helper
* fix: translate error messages and comments to English for consistency
---------
Co-authored-by: Soulter <905617992@qq.com >
2026-03-08 23:46:32 +08:00
Soulter
537849c1e7
fix(dingtalk): text is ignored; cannot send file actively ( #5921 )
2026-03-08 23:31:11 +08:00
Soulter
7f3c0fdeb2
fix: cannot receive image, file in dingtalk ( #5920 )
...
fixes : #5916 #5786
2026-03-08 23:18:56 +08:00
Windy_cold
8e431e2076
correct openrouter api_base ( #5911 )
2026-03-08 21:53:56 +09:00