12 Commits

Author SHA1 Message Date
ymq
7ed0ed9b80 fix(llm_bridge): 网关 200 但无 choices 的响应自动重试,避免 KeyError 打崩角色agent
llmage 网关偶发返回 200 但内容无 choices(错误JSON),llm_call_msgs_native 的 data[choices] 直接 KeyError,导致 role_agent 任务失败并报人工介入。_post_chat_completion 对无 choices 的 200 响应视为可重试异常,重试后仍失败则 raise 带网关原始内容的 ValueError。
2026-08-17 18:43:37 +08:00
ymq
853f3d5082 fix: llm_bridge._decrypt_key 修复 unpassword 参数顺序 + key 默认值兜底,正确解密 confidential_fields 加密的 api_key 2026-08-17 15:28:16 +08:00
ymq
791bd88c6d fix(llm): 严格本机构隔离,去掉系统级(org_id='0')兜底 2026-08-17 13:22:25 +08:00
ymq
e9838a3ec6 feat(llm): llm表查询按org_id多租户隔离(本机构+系统级),角色agent与会话agent模型选择统一(RoleSpec.model_name→产线default_model→deepseek-v4-pro) 2026-08-17 12:18:33 +08:00
ymq
8c0d63efb1 fix: LLM 调用加瞬时错误重试(3次) + 超时 180s→300s(connect 30s);心跳回收阈值 10→20 分钟防误杀慢任务
- llm_bridge: 抽出 _post_chat_completion,超时/连接错误/429/5xx 重试3次退避;total=300 connect=30
- init.py: 僵尸回收阈值对齐 LLM 最坏单轮时长(3×300s≈15min),20分钟
- agent_loop_v2: diagnose 心跳超时判定 10→20 分钟
2026-08-15 00:46:30 +08:00
ymq
0e5368a894 feat: cockpit agent 切原生 function calling
- llm_bridge 新增 llm_call_msgs_native 支持 tools 参数+解析 tool_calls
- agent_loop_v2._call_llm 优先走 native function calling,失败回退文本
- run loop 处理原生 tool_calls(role=tool 回填)
- _init_components 把 config.tools 注册进 ToolRegistry(修复 registry 空导致 tools_description 为空、schema 为空的 bug)
2026-08-13 17:05:26 +08:00
ymq
afa6972903 refactor: role agent to LLM tool-loop with read/write/shell/git tools + llm_call_msgs 2026-08-09 17:34:36 +08:00
09e58e5e19 fix: DBPools init (config.databases), sor.R→sqlExe, add call_llm() wrapper
- _get_db() / _get_task_raw(): properly init DBPools with config.databases
- Replace sor.R() with sqlExe() to avoid 3-arg signature issues
- Add call_llm() as SDLC handler interface delegating to llm_call
2026-08-03 10:38:09 +08:00
0423fa3c99 refactor: add intent_classifier.py, register in init.py, LLM bridge shared 2026-08-02 00:00:20 +08:00
0253615fcc fix: decrypt api_key from llm table in llm_bridge 2026-08-01 16:32:47 +08:00
d535e61f29 fix: llm_bridge reads model config from llm DB table, falls back to env vars 2026-08-01 10:25:33 +08:00
113eb7e040 feat: add KTV pipeline handlers (17 step types, 3 production modes)
- handlers_ktv.py: 17 async step handlers for KTV production
  - Audio/Video preparation (ffmpeg)
  - Demucs vocal separation (GPU server SSH)
  - Lyric calibration (SenseVoice ASR + LLM)
  - Subtitle rendering (ASS karaoke format)
  - Lyric generation & evaluation (Mode C)
  - Music generation (Suno/MiniMax API)
  - Character design & image generation (wan2.7)
  - Storyboard generation (LLM)
  - Scene video generation (T2V/Ref2V)
  - Scene video evaluation (quality threshold)
  - Scene video concatenation (ffmpeg loop)
  - KTV synthesis (dual-track + MTV)

- llm_bridge.py: async LLM call bridge (harnessed_agent / OpenAI API)
- storage.py: extract deps from step_config JSON
- init.py: auto-register KTV handlers on load
2026-06-11 20:36:05 +08:00