Commit Graph
100 Commits
Author SHA1 Message Date
QihuAI Design 6f192a89cf #983/#984 amber 金暖白设计语言:globals.css 主色令牌 indigo->amber + 3处硬编码色修正 2026-08-23 11:21:22 +08:00
QihuAI Design 8f57956904 #978 safe-align: 固化 frontend-v2 空白页修复真相源
- 新增 frontend-v2/ 为生产前端真相源(此前仅容器 dist,未入 git)
- vite.config.ts: minify:false 根治压缩器压坏 react-router 6.28 (o.slice)
- useApi.ts: asArray select 防御非裸数组返回值
- LandingPage/AppServices: Array.isArray coerce 双重防御 (apps.slice)
- 关联: INCIDENT-2026-08-23-blank-page.md / SOP-FRONTEND-ITERATIVE-DEVELOPMENT.md
- 公网验证通过 2026-08-23 09:31 (DOM 24493B, 无 slice 错误)
2026-08-23 09:36:35 +08:00
QihuAI Design e58c37ea17 #954 更新扫描器 UA 黑名单加入 Infrawatch + InternetMeasurement (20260810-205514)
access.log 发现 Infrawatch 探测 /mcp /sse 端点,InternetMeasurement 探测 / 首页. 加入 UA 黑名单 return 444. 验证:两个 UA 均被 444,正常 Mozilla 浏览器 200.
2026-08-10 20:55:15 +08:00
QihuAI Design c1f8b164bb docs+tests: #873 事件契约与双 Claw Adapter 文档及哨兵测试
- 新增 tests/test_engine_event.py (31 用例: EngineEvent 线格式/to_wire/from_wire,
  SseAdapter 裁剪+帧格式+frames, BufferAdapter 累积/媒体/诊断/截断, Diagnosis,
  test_dual_claw_wiring_source_guard 校验 chat.py/im_llm.py 接线)
- 新增 docs/dual-claw-event-contract.md (#873 契约文档 7 节)
- 全量 pytest 64 用例全绿 (含 test_dual_claw/test_node_registry 无回归)
- 仅文档/测试,非运行时代码,不 push
2026-08-04 17:28:57 +08:00
QihuAI Design 33d0f9c32e feat(workflow #874): NodeRegistry 统一工作流节点抽象 + 双 Claw 事件对齐
#874 P3 工作流引擎 NodeRegistry 统一(加速带「工具即节点」思想落地,零源码拷贝重写):

- app/core/node_registry.py(新增):把 skill / MCP / Agent / DAG 四套割裂表达收敛为
  单一 Node 抽象。BaseNode(Protocol) 定义 node_type/name/input_schema/output_schema/
  risk_level + async run(ctx);NodeContext 携带 db/tenant_id/claw_type/trace_id/黑板/emit;
  NodeResult.to_blackboard() 与既有 orchestrator 黑板结构无缝互转。内建八型节点
  llm/reduce/local/external/agent/skill/mcp/loop,均继承 NodeBase 公共生命周期
  (发 start 步骤 -> 执行 -> ok/fail 覆盖同 index),异常统一归一为 NodeError(带结构化
  diagnosis)。SkillNode 用 asyncio.to_thread 包裹同步执行器避免阻塞事件循环;
  LoopNode 硬限流 20 次迭代 / 并发上限 5,子节点经 ctx.child() 复用同一 StepCounter 与
  emit,保证步骤序号全图唯一。CapabilitySnapshot 统一承载 skills/mcp_servers/agents/
  function_definitions/mcp_tool_map,供 _build_system_prompt、run_graph、yaml 校验三处
  共用同一份能力真相。normalize_claw() 将 im_wechat/im_platform 归一为 "im",避免
  Grafana 维度碎片化。

- app/core/capability_discovery.py:新增 discover_agents(),与 discover_skills 同构的
  三级降级策略(显式安装 -> published 兜底 -> rank_by_query 裁剪),补齐 Agent 维度的
  统一能力发现,杜绝各处内联第二份发现逻辑(#866 回退事故教训)。

- app/core/orchestrator.py:VALID_NODE_TYPES 与 validate_graph 改为运行期读
  registry.node_types()/requires_agent(),注册表成为节点类型的单一真相源;_run_node 改为
  拼装 NodeContext 后委托 registry.get(ntype).run(ctx),本体只保留调度与拓扑;run_graph
  新增 on_event/claw_type/tenant_id/snapshot 参数,编排全过程以统一 EngineEvent 下发。

- app/core/yaml_workflow.py:valid_node_types() 实时读注册表;validate_yaml 补 skill/mcp/
  loop 必填校验;yaml_to_orchestration / orchestration_to_yaml 双向透传节点扩展字段
  (label/skill_id/func_name/tool/server_id/args/body/items/split/max_iterations/
  concurrency/join),修复配置往返丢字段。

- app/core/engine_event.py:make_step 新增 node 参数,以 step["node"]={id,type,label}
  承载节点身份。设计书原文的 EngineEvent(kind="node") 与前端仅识别 thinking/skill/mcp/
  agent/kb/media 的现状冲突(未知 kind 会被静默丢帧),故映射为已知 kind + 附加字段,
  线格式对旧前端字节兼容。

- app/api/chat_service.py:Web Claw 编排调用点透传 on_event/claw_type/tenant_id,
  租户与通道标签复用 #875 的 ContextVar(get_route_ctx),不再新增一层参数透传。
  IM Claw 经 EngineCore 自动继承同一事件流(单引擎原则,im_llm.py 零改动)。

- tests/test_node_registry.py(新增):R-NODE-1~11 确定性哨兵,无网络无外部依赖。守卫
  内建八型齐全、注册表为单一真相源(orchestrator 与 yaml 校验实时同源)、describe 契约、
  双 Claw 事件对齐(SseAdapter 与 BufferAdapter 逐键相等且均带 node 身份)、claw 归一与
  tenant 标签、新节点必填校验、YAML 往返不吞字段、Loop 限流聚合、失败结构化诊断两端可见、
  禁止第二份能力发现、register 拒绝非法节点。

验证:容器内 py_compile 全通过;pytest tests/ 退出码 0(85 项 = 83 passed + 2 skipped,
0 FAILED/ERROR),含 R-NODE 16 项与 R-DUAL 双 Claw 哨兵。

safe-align: 仅复制 7 个 git-tracked 文件,未触碰 secrets/.venv/node_modules/dist/caches。
本地提交不 push。
2026-08-04 15:16:00 +08:00
QihuAI Design 04a0641202 feat(otel #876): 双 Claw 强制标签 + 入口接线 + Grafana 双 Claw 对比看板
#876 OpenTelemetry 可观测(双 Claw 标签):
- app/core/otel.py: 新增 set_otel_ctx/get_otel_ctx(ContextVar 三元组 tenant_id+claw_type+
  trace_id);current_span_cm 自动注入双 Claw 强制标签,全部 13 个 span 调用点零签名侵入带维度;
  record_span_metrics 指标维度补 tenant_id+claw_type(trace_id 因高基数不计入指标标签)。
- app/core/llm_router.py: set_route_ctx 桥接转调 set_otel_ctx(单次入口注入双端共享:
  路由上下文 + OTel 标签),失败安全。
- app/api/chat.py: send_message 与 send_message_stream 入口注入 set_route_ctx(web),
  stream 经 asyncio.create_task 子协程自动传播 contextvars,使 _send_message_core 内
  所有 span 均带 tenant_id+claw_type。
- app/api/im_llm.py: _call_real_llm 入口最早注入 set_route_ctx(im_wechat),并显式开启
  im.send_message span(此前 IM Claw 完全无 span,Grafana 无 IM 数据点),finally 关闭。
- tests/test_dual_claw.py: R-DUAL-6 由 skip 转为确定性断言(Web/IM 双 Claw span 必带
  tenant_id+claw_type),作为持续哨兵。
- 交付 Grafana 双 Claw 对比看板 JSON(aiflow_span_* / aiflow_llm_route_total 按 claw_type
  分组:P50/P95 延迟、成功率、QPS、租户健康 Top10)。Alloy OTLP 仅桥接 metrics→Prometheus,
  trace 无 pipeline(#800 已压制 UNIMPLEMENTED 噪声),看板基于 metrics 出图。

safe-align: 仅复制 5 个 git-tracked 文件,未触碰 secrets/venv/node_modules/caches。本地提交不 push。
2026-08-04 13:49:34 +08:00
QihuAI Design 180409d317 feat(#875): LLM Router shadow mode + consolidate litellm master key 2026-08-04 13:16:30 +08:00
QihuAI Design 037c965c26 feat(engine): #873 dual-Claw event contract + SseAdapter/BufferAdapter + chat.py SSE delegate + im_llm EngineCore thin-shell (gray-gated)
- app/core/engine_event.py (#880): EngineEvent dataclass + make_* factories, single construction entry, byte-compatible wire with legacy ChatPage.tsx
- app/core/claw_adapters.py (#884): SseAdapter (hot frames zero-metadata, terminal keeps trace_id) + BufferAdapter (assemble() preserves __media__)
- app/api/chat.py (#881): /messages/stream now delegates to SseAdapter; wire bytes unchanged (46B delta / done+message_id)
- app/api/im_llm.py (#883): IM_USE_ENGINE_CORE gray gate; _call_engine_core reuses EngineCore via BufferAdapter (default OFF, preserves media fast-path)
- app/api/chat_service.py: capture 3 container-ahead fixes (stray import asyncio removed, logger.info format, LiteLLM master key)
2026-08-04 12:25:12 +08:00
QihuAI Design 34648e4810 fix(im_bot): segment long WeChat text replies + enhance send diagnostics (#878)\n\niLink returns HTTP 200 but WeChat silently drops long messages (1698-char\nHTML image link, 3011-char skill list). Add WECHAT_TEXT_MAX_LEN=1500 and\nsegment long text into multiple items. Also log payload item lengths and\nmedia URL lengths for future diagnosis. 2026-08-04 11:14:02 +08:00
QihuAI Design f4e18bafe4 test: add R-DUAL dual-Claw regression sentinel (#873) - always-on guards for IM unified discovery / Web-IM parity / naming single-source; opt-in live MCP reachability; R-DUAL-3/6 pending 2026-08-04 10:42:45 +08:00
QihuAI Design 29a1ce2e54 fix: 双Claw能力对齐 + MCP/LLM代理绕过(P0止血)
- 新增 app/core/capability_discovery.py:统一能力发现层,Web/IM 双Claw共用单一实现
  (三级降级:用户安装 → 平台published → 相关性裁剪;MCP 自动挂载已启用服务)
- im_llm.py:IM Bot Claw 改用统一发现层,恢复 skills(12) + MCP(26工具) 能力,
  修复 #866 部署回退导致的 agents=[]/mcp=[] 回归;mcp__ 前缀分流到 call_mcp_tool
- mcp_client.py:注入 httpx_client_factory(trust_env=False) 绕过容器 HTTP_PROXY,
  修复外部 MCP(xiaobenyang.com / anysearch.com) tools/list 全部静默失败(mcp_tools 0→26)
- llm_client.py / im_bot_user.py:2026-07-31 代理劫持内部请求 + 媒体断连修复(随镜像已上线)
2026-08-04 10:21:19 +08:00
QihuAI Design 9a43ee244d fix(im_llm): 代理绕过Docker内部hostname 2026-07-31 08:51:15 +08:00
QihuAI Design 96aabc31f6 feat: mumuainovel app service infrastructure (db+compose+nginx) 2026-07-28 11:41:40 +08:00
QihuAI Design a9d8642db5 phase2-risk-loop-mempalace
CI / gate (push) Has been cancelled
2026-07-28 09:18:16 +08:00
QihuAI Design 88b9a232ce fix-frontend-3-items-complete
CI / gate (push) Has been cancelled
2026-07-28 06:31:48 +08:00
QihuAI Design 1633d5c33e phase1-agent-canvas-done
CI / gate (push) Has been cancelled
2026-07-27 23:20:22 +08:00
QihuAI Design 96be3fdeb3 phase1-final
CI / gate (push) Has been cancelled
2026-07-27 22:27:56 +08:00
QihuAI Design 52f1770515 phase1-complete-billing-skillruntime 2026-07-27 18:16:28 +08:00
QihuAI Design 89ce7d80dc phase1-billing-skillruntime 2026-07-27 18:14:57 +08:00
QihuAI Design 65440d91ee phase1-billing-meilisearch 2026-07-27 17:05:21 +08:00
QihuAI Design 1e0bd6f7a2 phase1-skillmd-v2-schema 2026-07-27 16:55:48 +08:00
QihuAI Design a336ac283d phase0-litellm-deployed-via-hk-proxy 2026-07-27 15:54:28 +08:00
QihuAI Design cf8c955d45 phase0-containers-meilisearch-litellm
CI / gate (push) Has been cancelled
2026-07-27 11:09:49 +08:00
QihuAI Design 245484a0c5 phase0-final-rls-rbac-complete
CI / gate (push) Has been cancelled
2026-07-27 09:57:55 +08:00
QihuAI Design 2068421d41 phase0-fix-auth-order-db-migration 2026-07-27 09:54:03 +08:00
QihuAI Design 7b1941fdaf phase0-multi-tenant-rls-rbac 2026-07-27 09:44:06 +08:00
QihuAI Design f9c8bda6e0 docs-add-iteration-plan
CI / gate (push) Has been cancelled
2026-07-27 09:26:16 +08:00
QihuAI Design ec7de645f4 docs-add-architecture-blueprint
CI / gate (push) Has been cancelled
2026-07-27 09:10:11 +08:00
QihuAI Design efa63f9d25 fix-overflow-x-horizontal-scroll
CI / gate (push) Has been cancelled
2026-07-27 08:54:39 +08:00
QihuAI Design c624d8f37c mimo-token-plan-adapter
CI / gate (push) Has been cancelled
2026-07-26 21:47:48 +08:00
QihuAI Design bb32884ecb p2-mcp-schema-error-step-enhancements
CI / gate (push) Has been cancelled
2026-07-26 20:59:52 +08:00
QihuAI Design df67a298be mcp-tool-naming-fix
CI / gate (push) Has been cancelled
2026-07-26 15:37:17 +08:00
QihuAI Design e1e50e884e feat(chat): align AI tool-use with GPT-4.1/Anthropic standards -- Fix1: AGENT_GUIDE in system prompt (Persistence/Tool-calling/Planning), Fix2: install_app def improved, Fix3: max_tool_rounds 5->15
CI / gate (push) Has been cancelled
2026-07-26 08:35:42 +08:00
QihuAI Design a2504bce34 fix(chat): resolve Auto-route failover event-loop freeze (#812)
Root cause: ensure_structured_column() executed a synchronous blocking
engine.connect().execute(SELECT information_schema.columns ...) inside the
async request path (_build_chat_history / _maybe_compress_history), freezing
the uvicorn event loop and hanging all endpoints (~200s, recovered only by
docker restart).

Fix:
- chat_context.py: remove per-request ensure_structured_column() calls; run
  once idempotently at app startup (main.py lifespan). Use CURRENT_DATABASE()
  for PostgreSQL compatibility.
- main.py: add startup-only ensure_structured_column() hook (try/except).
- llm_client.py: trust_env=False + bounded httpx.Timeout/wait_for so broken
  endpoints fail fast instead of hanging the event loop.
- chat_service.py: run media generation in a background daemon thread with its
  own event loop (_launch_media_task_bg) so SSE end does not cancel image/video
  tasks (#811); remove TEMP faulthandler diagnostic.

Safe-align: persist accumulated live container changes (admin/*, knowledge,
market, models, config, observability, mcp_client, platform_knowledge,
im_bot_platform, chat_media, capability_registry, requirements) and add
workflow_templates.

Verified: live failover test (model-006 -> conn-refused) returns in ~1.9s with
concurrent login 0.83s/200; event-loop responsiveness restored (sub-second).
2026-07-26 00:35:35 +08:00
QihuAI Design 394a7786e0 chore: remove MySQL service from docker-compose (PostgreSQL migration complete)\n\n- Drop dead mysql service, mysql_data volume, and aiflow depends_on: mysql\n- Remove unused MYSQL_* env vars from aiflow service\n- Retain DATABASE_URL/POSTGRES_* pointing at qihu-aiflow-pg18\n- Closes the MySQL teardown started in task #802
CI / gate (push) Has been cancelled
2026-07-25 20:59:44 +08:00
QihuAI Design 640edc4970 chore: normalize tsconfig.json line endings (file missed by prior commit)
CI / gate (push) Has been cancelled
The earlier renormalize commit (771c845) missed frontend/tsconfig.json; this
completes the LF normalization so all tracked text files are LF. .gitattributes
(* text=auto eol=lf) prevents future CRLF.
2026-07-25 12:33:53 +08:00
QihuAI Design 771c8456b8 chore: normalize line endings to LF via .gitattributes
Root-cause fix for mixed CRLF/LF in the repo (no .gitattributes previously).
Adds '* text=auto eol=lf' and explicit binary rules so all future checkouts
are LF. Renormalizes all tracked text files (no logical content change).
Backup tags: image qihuaiflow:backup-lineend-20260725-121632, git backup-lineend-pre-20260725-121632.
2026-07-25 12:16:39 +08:00
QihuAI Design 2a7bb875f9 fix(mcp/chat): root-cause fixes for AnySearch MCP test + URL app install
- mcp_admin.py: replace get_event_loop().run_until_complete() with asyncio.run() in _test_mcp_server worker-thread path (RuntimeError: no current event loop in thread). Fixes backend AnySearch 'test failed'.
- chat_skill.py: add synchronous _execute_install_app() that auto-detects skill/mcp/agent from a URL and creates MarketApp(+MCPServer is_enabled=True for mcp) + AppInstallation. No running-loop asyncio call (called sync from chat dispatch).
- chat_service.py: register 'install_app' function_definition and dispatch branch so the AI chat can install skills/mcp/agent by URL.
Image already persisted via docker export/import (qihuaiflow:with-deps=aaf6fe67cde8) because base image was pruned and docker commit failed.
2026-07-25 11:51:19 +08:00
QihuAI Design 256d9f33e6 chore(align): sync Git with running container as authoritative source
Phase 0 SSE 流式聊天 landed in the running container and captured in Git so
the three sources (container := image := Git) agree.

Phase 0 — SSE 流式聊天(Web 端,IM bot 路径保持不变、共用引擎):
- app/api/chat.py: 新增独立 SSE 端点
  POST /app/api/chat/conversations/{conv_id}/messages/stream
  基于 asyncio.Queue + create_task 将 _send_message_core 桥接为
  text/event-stream 生成器,吐出 delta / reasoning / done / error 事件
- app/api/chat_service.py: _send_message_core 增加 stream + on_event 参数;
  普通(无工具)聊天 round-0 主调用走 achat_complete(stream=True) 流式;
  done 事件携带 message_id / content / process_steps / used_skills /
  used_mcp / generating
- app/core/llm_client.py: 修复 _create_kwargs 硬编码 stream=False 的根因 bug
  (流式调用传 stream=True 导致 TypeError: multiple values for keyword),
  现 _create_kwargs(request_body, stream=True) 字段随参数变化
- frontend/src/pages/front/ChatPage.tsx + ChatPage.css + types/index.ts:
  发消息改为 fetch SSE 消费,实时增量渲染 AI 回复文本与思考链(reasoning),
  done 事件用 message_id 定稿并渲染过程步骤;网络/流式失败自动回退非流式

Alignment performed 2026-07-24 18:25:11. No deletions; secrets/venv/node_modules/
caches were not touched (tracked-source-only copy).
2026-07-24 18:25:15 +08:00
QihuAI Design 3788a93425 chore(align): sync Git with running container as authoritative source
Phase 0 SSE 流式聊天 landed in the running container and captured in Git so
the three sources (container := image := Git) agree.

Phase 0 — SSE 流式聊天(Web 端,IM bot 路径保持不变、共用引擎):
- app/api/chat.py: 新增独立 SSE 端点
  POST /app/api/chat/conversations/{conv_id}/messages/stream
  基于 asyncio.Queue + create_task 将 _send_message_core 桥接为
  text/event-stream 生成器,吐出 delta / reasoning / done / error 事件
- app/api/chat_service.py: _send_message_core 增加 stream + on_event 参数;
  普通(无工具)聊天 round-0 主调用走 achat_complete(stream=True) 流式;
  done 事件携带 message_id / content / process_steps / used_skills /
  used_mcp / generating
- app/core/llm_client.py: 修复 _create_kwargs 硬编码 stream=False 的根因 bug
  (流式调用传 stream=True 导致 TypeError: multiple values for keyword),
  现 _create_kwargs(request_body, stream=True) 字段随参数变化
- frontend/src/pages/front/ChatPage.tsx + ChatPage.css + types/index.ts:
  发消息改为 fetch SSE 消费,实时增量渲染 AI 回复文本与思考链(reasoning),
  done 事件用 message_id 定稿并渲染过程步骤;网络/流式失败自动回退非流式

Alignment performed 2026-07-24 16:28:19. No deletions; secrets/venv/node_modules/
caches were not touched (tracked-source-only copy).
2026-07-24 16:28:19 +08:00
QihuAI Design e8a1791c9f chore(align): sync Git with running container as authoritative source
Standards alignment (STANDARDS_AUDIT_2026-07-24): Phase 1 标准化核心 +
Phase 2 质量层 landed in the running container and captured in Git so the
three sources (container := image := Git) agree.

Backend (Phase 1 标准化核心):
- mcp_client.py: replaced hand-rolled JSON-RPC with official `mcp` SDK
  (ClientSession, streamable_http/sse transports, protocol auto-negotiation)
- core/otel.py + core/observability.py: standard OpenTelemetry SDK bridge
  (OTLP gRPC), wired to Grafana Alloy (qihu-aiflow-alloy:4317) which forwards
  metrics to Prometheus; emits aiflow_span_duration_ms / aiflow_span_count
- deployments: Grafana Alloy container + Prometheus remote-write receiver

Backend (Phase 2 质量层):
- core/rag_pipeline.py: standardized RAG (recursive overlap chunking +
  rerank hook) reusing pgvector_search
- core/llm_client.py: SDK-ified LLM + embeddings (aembed/embed) collapsing
  hand-rolled httpx calls; trust_env=False to bypass container proxy

Migrations:
- 018_normalize_marketapp_scene.sql: fixed capability allowlist
  (prevents capability wipe on restart)

Alignment performed 2026-07-24 12:18:51. No deletions; secrets/venv/node_modules/
caches were not touched (tracked-source-only copy).
2026-07-24 12:18:52 +08:00
QihuAI Design acde481bed chore(align): sync Git with running container as authoritative source
One-time alignment to close drift between the running container
(qihu-aiflow / image qihuaiflow:with-deps) and this Git repository.
Container hotfixes previously persisted only via `docker commit` are now
captured in Git so Git becomes the single source of truth.

Backend:
- chat_service.py: accumulated fixes incl. EigenFlux README guidance
- chat_context.py / chat_media.py: URL/web-repo context injection
- api/url_reader.py: NEW SSRF-safe web/README reader (Issue #725)
- skills_admin.py & Skills.tsx: 14-scene capability unification
- pgvector_search.py, orchestrator.py, platform_knowledge.py,
  market.py, admin/models.py: drift sync

Frontend:
- ChatPage.tsx: collapsible AI think/act block (Issue #724)
- MarketPage / EvolutionDashboard / TokenDashboard styling sync

Migrations:
- 018_normalize_marketapp_scene.sql: fixed capability allowlist
  (prevents capability wipe on restart)

Alignment performed 2026-07-24 07:44:19. No deletions; secrets/venv/node_modules/
caches were not touched (tracked-source-only copy).
2026-07-24 07:44:19 +08:00
QihuAI Design 26075272d6 chore(align): sync Git with running container as authoritative source
One-time alignment to close drift between the running container
(qihu-aiflow / image qihuaiflow:with-deps) and this Git repository.
Container hotfixes previously persisted only via `docker commit` are now
captured in Git so Git becomes the single source of truth.

Backend:
- chat_service.py: accumulated fixes incl. EigenFlux README guidance
- chat_context.py / chat_media.py: URL/web-repo context injection
- api/url_reader.py: NEW SSRF-safe web/README reader (Issue #725)
- skills_admin.py & Skills.tsx: 14-scene capability unification
- pgvector_search.py, orchestrator.py, platform_knowledge.py,
  market.py, admin/models.py: drift sync

Frontend:
- ChatPage.tsx: collapsible AI think/act block (Issue #724)
- MarketPage / EvolutionDashboard / TokenDashboard styling sync

Migrations:
- 018_normalize_marketapp_scene.sql: fixed capability allowlist
  (prevents capability wipe on restart)

Alignment performed 2026-07-23 22:42:43. No deletions; secrets/venv/node_modules/
caches were not touched (tracked-source-only copy).
2026-07-23 22:42:46 +08:00
QihuAI Design a1fd8b074d chore(align): sync Git with running container as authoritative source
One-time alignment to close drift between the running container
(qihu-aiflow / image qihuaiflow:with-deps) and this Git repository.
Container hotfixes previously persisted only via `docker commit` are now
captured in Git so Git becomes the single source of truth.

Backend:
- chat_service.py: accumulated fixes incl. EigenFlux README guidance
- chat_context.py / chat_media.py: URL/web-repo context injection
- api/url_reader.py: NEW SSRF-safe web/README reader (Issue #725)
- skills_admin.py & Skills.tsx: 14-scene capability unification
- pgvector_search.py, orchestrator.py, platform_knowledge.py,
  market.py, admin/models.py: drift sync

Frontend:
- ChatPage.tsx: collapsible AI think/act block (Issue #724)
- MarketPage / EvolutionDashboard / TokenDashboard styling sync

Migrations:
- 018_normalize_marketapp_scene.sql: fixed capability allowlist
  (prevents capability wipe on restart)

Alignment performed 2026-07-23 22:16:24. No deletions; secrets/venv/node_modules/
caches were not touched (tracked-source-only copy).
2026-07-23 22:16:25 +08:00
QihuAI Design 2721da5d4c feat: 思考过程展示优化 — 先展开再自动收拢
AiProcessBlock 改进:
- 超时从 2.6s 延至 6s,用户有充足时间阅读思考链路
- 新增 aiProcessPulse 脉冲高亮动画,强调'思考过程刚出炉'
- 展开时自动 scrollIntoView,确保不被正文遮挡
- 摘要文案改为'AI 思考 / 执行过程(N步 — 自动收拢中...)'

CSS 新增:
- .ai-process-fresh 脉冲动画 + summary 文字高亮
- @keyframes aiProcessPulse: 0→50%→100% 边框扩散+收拢
2026-07-23 22:00:49 +08:00
QihuAI Design 9d67b0544c chore(align): sync Git with running container as authoritative source
One-time alignment to close drift between the running container
(qihu-aiflow / image qihuaiflow:with-deps) and this Git repository.
Container hotfixes previously persisted only via `docker commit` are now
captured in Git so Git becomes the single source of truth.

Backend:
- chat_service.py: accumulated fixes incl. EigenFlux README guidance
- chat_context.py / chat_media.py: URL/web-repo context injection
- api/url_reader.py: NEW SSRF-safe web/README reader (Issue #725)
- skills_admin.py & Skills.tsx: 14-scene capability unification
- pgvector_search.py, orchestrator.py, platform_knowledge.py,
  market.py, admin/models.py: drift sync

Frontend:
- ChatPage.tsx: collapsible AI think/act block (Issue #724)
- MarketPage / EvolutionDashboard / TokenDashboard styling sync

Migrations:
- 018_normalize_marketapp_scene.sql: fixed capability allowlist
  (prevents capability wipe on restart)

Alignment performed 2026-07-23 19:43:56. No deletions; secrets/venv/node_modules/
caches were not touched (tracked-source-only copy).
2026-07-23 19:43:56 +08:00
QihuAI Design 4a95657030 chore(align): sync Git with running container as authoritative source
One-time alignment to close drift between the running container
(qihu-aiflow / image qihuaiflow:with-deps) and this Git repository.
Container hotfixes previously persisted only via `docker commit` are now
captured in Git so Git becomes the single source of truth.

Backend:
- chat_service.py: accumulated fixes incl. EigenFlux README guidance
- chat_context.py / chat_media.py: URL/web-repo context injection
- api/url_reader.py: NEW SSRF-safe web/README reader (Issue #725)
- skills_admin.py & Skills.tsx: 14-scene capability unification
- pgvector_search.py, orchestrator.py, platform_knowledge.py,
  market.py, admin/models.py: drift sync

Frontend:
- ChatPage.tsx: collapsible AI think/act block (Issue #724)
- MarketPage / EvolutionDashboard / TokenDashboard styling sync

Migrations:
- 018_normalize_marketapp_scene.sql: fixed capability allowlist
  (prevents capability wipe on restart)

Alignment performed 2026-07-23 16:04:25. No deletions; secrets/venv/node_modules/
caches were not touched (tracked-source-only copy).
2026-07-23 16:04:26 +08:00
QihuAI Design d3d8d62b94 fix(media): repair JSON_CONTAINS auto-routing + reconcile stale backend tests
CI / gate (push) Has been cancelled
Real bug:
- capability_registry.resolve_auto_model and chat_media._build_media_route used
  `Column.op("JSON_CONTAINS")(col, val)`, but SQLAlchemy's op() accepts only ONE
  argument -> TypeError on every image/video/audio auto-route, silently failing
  media generation (caught as "后台生成异常"). Replaced with func.json_contains().

Test reconciliation (no production behavior change):
- tests/test_context_engine.py: tiktoken upgrade made the hardcoded len//2 token
  estimates wrong; relax to tokenizer-agnostic assertions and add
  structured_memory=None to the _Summary mock (code now branches on it).
- tests/test_regression_r1r2r3.py: R3 FakeModel lacked `name` (code reads m.name);
  also the assertion assumed a literal '超时' string, but the failover architecture
  catches model-level exceptions and writes a user-understandable error marker
  instead. Align the assertion to the real contract: a media failure/timeout must
  be written back as a user-understandable error message, never left as '生成中…'.

CI gate: 28 backend pytest + 15 frontend vitest all green.
2026-07-23 09:16:31 +08:00
QihuAI Design a08ec87b22 chore(align): sync Git with running container as authoritative source
One-time alignment to close drift between the running container
(qihu-aiflow / image qihuaiflow:with-deps) and this Git repository.
Container hotfixes previously persisted only via `docker commit` are now
captured in Git so Git becomes the single source of truth.

Backend:
- chat_service.py: accumulated fixes incl. EigenFlux README guidance
- chat_context.py / chat_media.py: URL/web-repo context injection
- api/url_reader.py: NEW SSRF-safe web/README reader (Issue #725)
- skills_admin.py & Skills.tsx: 14-scene capability unification
- pgvector_search.py, orchestrator.py, platform_knowledge.py,
  market.py, admin/models.py: drift sync

Frontend:
- ChatPage.tsx: collapsible AI think/act block (Issue #724)
- MarketPage / EvolutionDashboard / TokenDashboard styling sync

Migrations:
- 018_normalize_marketapp_scene.sql: fixed capability allowlist
  (prevents capability wipe on restart)

Alignment performed 2026-07-23 05:42:47. No deletions; secrets/venv/node_modules/
caches were not touched (tracked-source-only copy).
2026-07-23 05:42:48 +08:00
QihuAI Design 49f7503978 fix(models): widen market_apps.skill_content to MEDIUMTEXT for large SKILL.md 2026-07-22 12:42:43 +08:00
QihuAI Design 6da8c3938e fix(admin/mcp): prevent unnecessary wrapping in table headers and badges 2026-07-22 08:54:03 +08:00
QihuAI Design 6d06f9165c feat(skills): auto-tag+classify existing 60 skills, auto-tag on import, 409 uniqueness check, add tags column to admin 2026-07-22 07:58:40 +08:00
QihuAI Design 46528eddbb fix(market): 补齐MarketApp ORM category/tags字段 + 硬化导入管道(空内容兜底生成SKILL.md + GitHub直链归一) 2026-07-21 20:25:55 +08:00
QihuAI Design 97125d7b65 T4: AnySearch 改为全局固定配置 + 修复外部服务弹窗 UI 2026-07-21 19:27:27 +08:00
QihuAI Design 3c9d9518b1 T4: AnySearch 联网检索接入 (anysearch_client trust_env直连 NO_PROXY, kb_router use_web RRF融合, chat_context 自动注入联网上下文, admin 支持 anysearch 服务类型, 新增 POST /api/knowledge/web-search 端点) 2026-07-21 18:29:51 +08:00
QihuAI Design be7d792dc2 T3: TreeSearch 结构化文档两级检索 (build_kb_tree + tree_search BM25+向量融合, 接入 kb_router 为 tree_chunk 源, 新增 GET /api/knowledge/tree-search) 2026-07-21 12:56:57 +08:00
QihuAI Design 75f53a7e8a fix: 文生图/视频测试连接走媒体端点直连(_proxy_for_url 增加 images/videos 直连规则),绕过智能路由代理重置长连接导致的 Server disconnected;gpt-image-2/agnes 测试连接恢复。配合 models.py 的 1024x1024 size 与 chat_media.py 的 failover 路由(默认模型第一顺位)。 2026-07-20 22:26:30 +08:00
QihuAI Design 0b00d6da45 fix: 文生图连接测试 size 1024x1024 + 媒体端点智能推导 + 图像/视频模型 failover 路由(默认模型第一顺位) 2026-07-20 22:11:53 +08:00
QihuAI Design 7674729804 test(frontend): extract Markdown renderer to utils/markdown.ts + add vitest regression tests
CI / gate (push) Has been cancelled
2026-07-20 20:32:36 +08:00
QihuAI Design 11b80b90f4 fix(migrations): MariaDB 兼容幂等化 privacy_mode 列与 distributions 种子插入
CI / gate (push) Has been cancelled
2026-07-20 19:37:57 +08:00
QihuAI Design 71a6403e5b fix: 加宽 skill_trajectory_links.atom_id 列 VARCHAR(36)->128 修复 DataError(1406);TraceIdFilter 从 root logger 移至 handler 修复子 logger %(trace_id)s KeyError 日志刷屏;evolution scheduler 循环增加 db.rollback() 兜底;附带 models.py CRLF->LF 归一。
CI / gate (push) Has been cancelled
2026-07-20 19:02:40 +08:00
QihuAI Design 5def2697de fix(chat): image send 500 + table/newline formatting (v2026.07.20.1708)
CI / gate (push) Has been cancelled
2026-07-20 17:08:20 +08:00
QihuAI Design 612ce37518 audit fixes: align all frontend timestamps to Beijing time + debounce MarketPage search (vv2026.07.20.1)
CI / gate (push) Has been cancelled
2026-07-20 15:38:55 +08:00
QihuAI Design d55a496ff4 Phase 4.3 ACA: MCP.tsx protocol selector panel + api ACA methods (v2026.07.19.12)
CI / gate (push) Has been cancelled
2026-07-20 14:45:21 +08:00
QihuAI Design 72d6f9ab66 Phase 4.1+: mermaid diagrams + YAML workflow buttons + agents API (v2026.07.19.11)
CI / gate (push) Has been cancelled
2026-07-20 09:24:40 +08:00
QihuAI Design 79c27795a8 Phase 4.2+4.3: YAML workflow spec + ACA protocol abstraction (v2026.07.19.10)
CI / gate (push) Has been cancelled
2026-07-19 20:17:49 +08:00
QihuAI Design c716dab851 Phase 4.1+: expose version/verified/security_scan/dependencies in admin get_all_apps
CI / gate (push) Has been cancelled
2026-07-19 19:29:48 +08:00
QihuAI Design 669c16b0a0 Phase 4.1: 技能市场安检引擎 + 版本化 + 绿标 (v2026.07.19.9)
CI / gate (push) Has been cancelled
2026-07-19 19:15:35 +08:00
QihuAI Design 71fc502a92 Phase 3.3 前端: 后台 Agent 编排图 JSON 编辑器(载入/校验/保存/清除/示例)
CI / gate (push) Has been cancelled
2026-07-19 16:55:20 +08:00
QihuAI Design 96b3f0af37 Phase 3.3 多 Agent 编排图引擎: orchestration JSON 列 + 拓扑并行引擎 + local/external/reduce 节点 + 工具沙箱继承 + 后台编排 API
CI / gate (push) Has been cancelled
2026-07-19 16:41:27 +08:00
QihuAI Design 3b34ba78b8 feat(agents): Phase3.2 Agent凭据Fernet加密存储 写入加密+调用点解密+返回脱敏+主密钥持久化防竞态 [v2026.07.19.7]
CI / gate (push) Has been cancelled
2026-07-19 15:27:15 +08:00
QihuAI Design 0600c37b9e feat(agents): Phase3.1 工具/MCP权限沙箱(tool_policy) 白名单+预算熔断+每轮上限+后台管理UI [v2026.07.19.6]
CI / gate (push) Has been cancelled
2026-07-19 12:34:40 +08:00
QihuAI Design 2969544d54 feat(observability): Phase2.3 媒体/LLM 可观测面板(后端归因聚合+前端页) 并修复 token_usage_logs trace_id 写入(chat_service/im_llm) [v2026.07.19.5]
CI / gate (push) Has been cancelled
2026-07-19 10:18:14 +08:00
QihuAI Design 491f31cead refactor(context): Phase2 上下文引擎升级 分层记忆+压缩+隔离 [v2026.07.19.4]
CI / gate (push) Has been cancelled
2026-07-19 09:29:57 +08:00
QihuAI Design a7a57f9a03 refactor(observability): Phase2.2 成本归因 trace_id列+token日志写入+LLM/MCP/媒体子span [v2026.07.19.3]
CI / gate (push) Has been cancelled
2026-07-19 08:51:28 +08:00
QihuAI Design 6aefdfa5c2 refactor(observability): Phase2.1 统一可观测基座 trace_id+结构化日志+span计时 [v2026.07.19.2]
CI / gate (push) Has been cancelled
2026-07-19 07:47:25 +08:00
QihuAI Design 1b6a184d27 refactor(chat): split 10070-line monolith into 8 service submodules (Phase1) [v2026.07.19.1]
CI / gate (push) Has been cancelled
2026-07-19 00:59:03 +08:00
QihuAI Design 4167e23e50 ci: add minimal CI gate (pre-push hook + ci_gate.py + dormant Gitea workflow) [v2026.07.18.5]
CI / gate (push) Has been cancelled
2026-07-19 00:01:07 +08:00
QihuAI Design dd10245ad5 test: 前端 vitest 测试基建 (Phase0) — 北京时间渲染回归 4 用例全绿 2026-07-18 23:47:21 +08:00
QihuAI Design 1744ff40ce test: 回归用例 R1/R2/R3 固化三个反复问题 (Phase0) — 9 用例全绿 2026-07-18 23:36:01 +08:00
QihuAI Design 13578ba4c2 test: 后端 pytest 测试基建 (Phase0) — 6 用例全绿 + 部署前备份SOP合规 2026-07-18 23:29:55 +08:00
QihuAI Design 9e9c506ba9 release: v2026.07.18.1 (prod) — Phase0 工程纪律止血:部署前镜像备份SOP + 版本号规范 + 测试基建 2026-07-18 23:19:18 +08:00
QihuAI Design 1ea7ea352f chore: remove accidental .bak file 2026-07-18 13:54:19 +08:00
QihuAI Design d593d8dc42 fix: 显式选中技能/MCP 时优先按工具资料回答 + 媒体任务超时/日志
- _build_system_prompt 末尾增加【最高优先级覆盖规则】:用户明确选择技能/MCP 并询问其介绍/功能/用法时,
  必须只基于该工具资料作答,禁止引用平台知识库中技能市场/MCP/平台能力的通用描述。
- _generate_media_task 增加启动/结束日志,对图像生成加 90s 超时、视频 300s 超时,避免异步任务挂死导致前端一直显示“生成中”。
2026-07-18 13:52:26 +08:00
QihuAI Design 1578d68f95 fix: 修复前台4项问题(MCP列举/微信技能上限/Word资产栏/技能MCP反馈) + 同步容器live状态
- #549 平台MCP列举: 注入全量已启用MCP清单, AI不再凭空编造
- #550 微信Bot技能自动发现上限 15->300
- #551 知识库Word文档同步资产后Word栏可见 + 双向删除同步(assets/knowledge级联软删)
- #552 对话反馈实际使用的技能/MCP(used_mcp字段), 含历史消息序列化
- 同步容器内其他未提交live改动(im_bot_platform/TokenDashboard/WechatBot/ChatPage)
2026-07-18 08:06:37 +08:00
QihuAI Design 7fb7c07f57 fix(admin/skills): 支持删除从市场导入的 MarketApp 技能 2026-07-17 22:25:47 +08:00
QihuAI Design cc35c61fbd fix: 技能市场分类映射缺失+筛选chip激活态配色;聊天显式选中技能时正确介绍技能并精简回复排版 2026-07-17 21:45:30 +08:00
QihuAI Design f8d1c18927 fix(admin): 后台未登录访问 Skills/MCP/Agent 报 Not authenticated\n\n- AdminLayout 增加登录+管理员守卫,无 token 或非 admin 跳 /login\n- api request() 处理 403 Not authenticated/需要管理员权限,清 token 跳登录\n- 根因:FastAPI HTTPBearer 无 token 返回 403 而非 401,前端未处理 403 跳转 2026-07-17 20:46:05 +08:00
QihuAI Design e2369b4915 fix(market): 强化场景分类器解析兜底,避免合法 id 误判为 None 2026-07-17 15:44:58 +08:00
QihuAI Design dc3077b5ae fix(market): 强化场景分类器解析兜底,避免合法 id 误判为 None 2026-07-17 15:37:35 +08:00
QihuAI Design fe051bd9f3 feat(market): 采用元宝岗位/职能分类(14类)替代人群场景 + AI验证期自动归类 2026-07-17 15:22:57 +08:00
QihuAI Design 9bcf15099f feat(market): 技能/MCP 分类改为面向用户的业务场景(人群->场景),AI验证期按场景归类 2026-07-17 14:55:21 +08:00
QihuAI Design 6f3fb400a4 feat(market): skills/mcp 能力分类 + AI验证期自动识别 + 导入自动入座 2026-07-17 12:09:42 +08:00
QihuAI Design 2ae5d9f9b5 fix(skills): 修复导入技能时 SKILL 内容丢失导致无法正常工作
- 前端 handleSubmit/handleCreateApp 发送 skillsContent;handleHubImport 对 skill 把目录 URL 作为 download_url
- 后端 upload_app 对 skill 类型写入 skill_content(手动粘贴或 Hub 抓取)
- 新增 _fetch_skill_content 按目录 URL 抓取真实 SKILL.md 回填(best-effort,仅接受有效 markdown)
- 清理 50 条空壳 skill 记录(skill_content 为空,不可恢复)
- 经 E2E 验证:手动粘贴/Hub 抓取/MCP 重导三条路径均能正确落库
2026-07-17 10:46:47 +08:00
QihuAI Design 47d38ca173 fix(MCP): 修复导入MCP时传输代码丢失导致无法连接的问题
- 前端 MarketPage 提交时随 download_url 发送粘贴的 MCP 代码(handleSubmit+handleCreateApp)
- 后端新增 parse_mcp_config 解析标准 JSON 配置, 提取 url/headers/transport
- upload_app 与 _sync 使用解析器落库 mcp_servers 并自动连通性测试
- _test_mcp_server 连接测试携带 headers 鉴权头
- 优化 MCP 代码输入框占位符为真实配置格式
2026-07-17 09:43:43 +08:00
QihuAI Design 24ed907ba5 feat: 实现MCP工具调用链路(streamable_http) - chat中MCP作为function calling真实调用tools/call 2026-07-16 20:59:42 +08:00
QihuAI Design ab90ac9473 fix: MCP后台删除/禁用同步清理market_apps源头,避免被_sync复活 2026-07-16 20:09:16 +08:00
QihuAI Design 6331e84185 feat: MCP streamable_http connection test + auto-test on import 2026-07-16 18:38:10 +08:00
QihuAI Design feb9865b00 fix: sync MarketApp MCP records to admin MCP Client management 2026-07-16 18:12:07 +08:00
QihuAI Design c9b5f964be feat(frontend): per-platform Streamable HTTP input for MCP Hub import 2026-07-16 17:36:58 +08:00