154 Commits

Author SHA1 Message Date
jxxghp
c2c9950bb1 fix(postgresql): support unix socket connections
Allow PostgreSQL socket paths without forcing a TCP port and reuse a single URL builder for sync, async, and migration flows. Document Redis socket URLs and close the socket connection request. Closes #5720
2026-05-07 13:22:14 +08:00
jxxghp
ffbe348d66 fix(openlist): paginate Alist directory listings
Fetch all OpenList/AList fs/list pages when using the default per_page=0 to avoid truncating directories at 200 entries. Add an isolated regression test for the auto-pagination behavior.

Fixes #5723
2026-05-07 13:09:28 +08:00
jxxghp
6d7b0733af fix(transfer): avoid polluted history fallback at shared roots
Parent-path fallback should stop at shared download roots so an old root-level download cannot hijack unrelated manual transfers. Keep exact DownloadFiles matches allowed at the shared root to preserve valid no-subfolder lookups.

Closes #5716

Regression from afcd895f52

Follow-up to #5702
2026-05-07 13:01:20 +08:00
jxxghp
49a51cca25 fix(media): use Jellyfin-compatible season artwork names
Save season artwork in season folders with standard names like poster.jpg so Jellyfin can recognize them. Fixes #5725.
2026-05-07 12:54:38 +08:00
jxxghp
62541ffe43 fix(qbittorrent): restore qBittorrent 5.2 compatibility
Support WebUI API Key auth, newer add responses, and cookie sync so qBittorrent 5.2 can connect reliably while keeping legacy fallback behavior.

Fixes #5724
2026-05-07 07:41:05 +08:00
jxxghp
c762628217 fix(agent): preserve full command output in temp logs
Return only a 10KB preview to the agent so large command results do not overwhelm conversations while keeping the full output available for follow-up reads. Add pytest to the project dependencies to make the regression tests runnable in the project venv.
2026-05-06 20:04:17 +08:00
jxxghp
39f9550f86 fix(agent): 修复添加订阅时的用户名映射 2026-05-04 21:27:48 +08:00
Yifan
cb6dcc6a2e refactor jellyfin module load logic in unittest 2026-05-02 16:32:18 +08:00
奕凡
43c421b0bb Import call in unittest.mock for additional testing 2026-05-02 16:32:18 +08:00
奕凡
76c5f54465 Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-02 16:32:18 +08:00
Yifan
04443fcfba fix(jellyfin): resolve URL string interpolation failure and enhance RBAC fallback resilience
Co-authored-by: Copilot <copilot@github.com>
2026-05-02 16:32:18 +08:00
jxxghp
4d0a722b09 refactor: reorganize interaction chain 2026-05-01 09:53:04 +08:00
jxxghp
db6dc926cf feat: unify slash command interactions 2026-05-01 08:53:52 +08:00
jxxghp
53bf81aede refactor: rename MoviePilotToolSelectorMiddleware to ToolSelectorMiddleware and enhance tool selection logic 2026-04-30 19:05:49 +08:00
jxxghp
afcc071d07 feat: optimize tool selection middleware to cache and reuse tool selection per agent run
- Refactor MoviePilotToolSelectorMiddleware to perform tool selection once per agent execution and cache the result in state, avoiding redundant LLM calls for each model round.
- Add abefore_agent to select tools at the start of agent execution and store selected tool names in state.
- Update awrap_model_call to reuse cached tool selection from state for subsequent model calls.
- Enhance test coverage for tool selection caching and reuse logic.
- Improve error logging in skill version extraction.
2026-04-30 18:29:54 +08:00
jxxghp
0583495548 refactor: remove legacy disable_thinking and reasoning_effort parameters from LLM helper and related tests 2026-04-30 17:10:14 +08:00
jxxghp
45f5326fb4 fix tool selection middleware 2026-04-30 13:47:43 +08:00
jxxghp
53f6897d62 feat: ensure essential tools are always included in LLM tool selection and update tests
- Add mechanism to always include core tools (e.g., file operations, command execution) in LLMToolSelectorMiddleware
- Update MoviePilotToolFactory to provide filtered always-include tool names based on loaded tools
- Set default LLM_MAX_TOOLS to 30 in config
- Refactor agent initialization to support always_include parameter
- Enhance tests to cover always_include logic and async agent creation
2026-04-30 13:04:52 +08:00
jxxghp
28a2386f2f feat: add agent tools for querying and managing filter rules and rule groups
- Add tools for querying built-in and custom filter rules, and for adding, updating, and deleting custom rules and rule groups
- Refactor filter module to use shared builtin rule definitions
- Enhance rule group querying to include syntax guidance and usage references
- Add unittests for agent filter rule tools registration and parsing logic
2026-04-30 12:56:38 +08:00
jxxghp
b228107a25 refactor: migrate LLM helper to agent module and add unified LLM API endpoints
- Move LLMHelper and related logic from app.helper.llm to app.agent.llm.helper
- Update all imports to reference new LLMHelper location
- Introduce app/agent/llm/__init__.py for internal LLM adapter exports
- Add llm.py API router with endpoints for model listing, provider auth, and test calls
- Remove legacy LLM endpoints from system.py
- Update requirements for langchain-anthropic and anthropic
- Refactor test_llm_helper_testcall.py for async LLMHelper usage and new import paths
2026-04-30 09:48:50 +08:00
jxxghp
2375508616 Restore background dispatch without channel context 2026-04-30 07:04:59 +08:00
jxxghp
baebd0ed1a Fix background prompt message leakage 2026-04-30 06:58:43 +08:00
jxxghp
6532c60a3c Refine agent background reply handling 2026-04-30 00:25:23 +08:00
jxxghp
11478faff3 separate reply sending from output persistence 2026-04-29 23:56:16 +08:00
jxxghp
e9291cec6a respect output persistence in background agent replies 2026-04-29 23:51:03 +08:00
jxxghp
7586a2cd42 disable agent message tools for ui background tasks 2026-04-29 23:30:59 +08:00
jxxghp
ef5bd29759 move ui background message suppression into agent context 2026-04-29 23:22:37 +08:00
jxxghp
7ab643d34a suppress channel notifications for ui background tasks 2026-04-29 23:13:57 +08:00
jxxghp
0b7505a604 refactor search AI recommendation flow 2026-04-29 22:55:27 +08:00
jxxghp
460d716512 feat: add batch AI re-organize for transfer history and search result recommendation
- Implement batch AI re-organize endpoint for transfer history with progress tracking
- Add batch_manual_transfer_redo system task template and prompt generation
- Refactor agent_manager to support generic background prompt execution
- Add AIRecommendChain for search result recommendation using agent background prompt
- Update search endpoints to use new AIRecommendChain and remove legacy code
- Enhance test cases for batch manual transfer redo
- Minor code cleanup and style fixes
2026-04-29 22:16:04 +08:00
jxxghp
af35101774 fix: default to text replies for voice input 2026-04-29 18:54:58 +08:00
jxxghp
b7749c44fd 重构语音能力配置与逻辑,统一音频输入输出开关并优化语音回复判断 2026-04-29 18:15:34 +08:00
jxxghp
4b27b7bc42 重构 UgreenCrypto 模块路径至 app.modules.ugreen 并更新相关引用 2026-04-29 16:29:17 +08:00
jxxghp
4a3cc5ee18 新增多个人设说明文档并完善测试用例 2026-04-29 16:20:44 +08:00
jxxghp
344280cd61 Refactor agent persona runtime layering 2026-04-29 14:12:47 +08:00
jxxghp
6b9790026c refine plugin agent tool responsibilities 2026-04-29 08:50:48 +08:00
jxxghp
bcc321eb70 add plugin agent management tools 2026-04-29 08:29:04 +08:00
jxxghp
8789f35228 Improve non-verbose agent tool summaries 2026-04-29 07:07:33 +08:00
jxxghp
c5b716c231 feat: introduce unified agent runtime config and system task prompt framework
- Add structured runtime config files (AGENT_PROFILE.md, AGENT_WORKFLOW.md, AGENT_HOOKS.md, USER_PREFERENCES.md, SYSTEM_TASKS.md, CURRENT_PERSONA.md) for persona, workflow, hooks, and system tasks
- Implement agent_runtime_manager to load, validate, and render runtime config and system task prompts
- Refactor agent initialization to use runtime-managed directories for skills, jobs, memory, and activity logs
- Add AgentHooksMiddleware for structured pre/in/post hooks injection
- Replace hardcoded system task prompts with template-driven rendering from SYSTEM_TASKS.md
- Update tests to cover runtime config loading, migration, and system task prompt rendering
- Update .gitignore to exclude config/agent/
2026-04-28 13:04:28 +08:00
jxxghp
483fe55372 fix: correct Plex notification image lookup
Closes #5700
2026-04-28 09:19:18 +08:00
jxxghp
5d588ee127 fix: correct traditional Chinese subtitle rename detection
Fixes #5703
2026-04-28 09:00:14 +08:00
jxxghp
afcd895f52 fix: backfill transfer download history matching
Fixes #5702
2026-04-28 08:55:40 +08:00
jxxghp
1ded58adbb fix: adapt audiences user data parser 2026-04-27 12:56:45 +08:00
jxxghp
6a6bcf59a0 增强 execute_command 工具:支持输出截断、并发限制与进程组清理,新增单元测试 2026-04-27 10:05:25 +08:00
jxxghp
323844b26d revert execute_command streaming changes
Restore the previous subprocess handling for execute_command and drop the new command streaming test so agent startup is unblocked.
2026-04-27 08:12:37 +08:00
jxxghp
140d224a9a fix agent stream blocking during command execution
Offload synchronous message edits from the event loop and stream subprocess output so long-running commands stay responsive.
2026-04-27 07:57:32 +08:00
jxxghp
7bc032d17c Revert Telegram duplicate edit fix 2026-04-27 07:36:13 +08:00
jxxghp
2df476dbff Fix Telegram duplicate message edits 2026-04-27 07:17:58 +08:00
jxxghp
221eb21694 refine internal middleware llm usage for streaming agents
Use a non-streaming model for middleware-only calls so internal outputs do not leak into user streams and model-based middleware stays consistent.
2026-04-27 06:55:41 +08:00
jxxghp
4208c79d72 refine tool提示语为更简洁风格,补充last_buffer_char属性及非VERBOSE模式流式输出换行逻辑,新增工具流式分隔符单元测试 2026-04-26 11:15:11 +08:00