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
dev
019e1151d0
fix(mcp_admin): add module-level import asyncio to fix 500 in test_mcp_connection ( #766 root cause)
CI / gate (push) Has been cancelled
2026-07-25 14:03:36 +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
qihu-dev
c32eed39bd
feat(chat): 收拢式AI思考/执行过程可视化 + 修复span(name)重复传参导致技能/MCP执行崩溃
2026-07-22 00:17:54 +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