Commit graph

59 commits

Author SHA1 Message Date
628a9dffd2 Subtract dead agent husks and unify the gateway executor path.
Remove SpecialistAgentRunner, plan_agent_v2 re-export shims, empty runtime husks, and disconnected Admin knobs. Fold ops into build_gateway_executor, align AIA_ENABLE_PLUGIN_TOOLS with catalog, and allow ops on the default MCP specialist list.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-11 01:02:29 +08:00
9d4dced4e4 Skip overlapping scheduled runs and surface playbook status in job lists.
Due ticks no longer stack on an active run (WA skip notice + stale clear); schedule_list/admin/gateway now show playbook, steps_n, and last_run signals without dumping full recipes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-11 00:07:42 +08:00
3cdf550298 Make Chat abort actually stop the agent turn.
Wire should_stop from aborted runs, snapshot abort before clearing flags so finals are not emitted after stop, and keep fail-path turn_uuid aligned for bubble splitting.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-23 10:16:07 +08:00
896126ef88 Move Chat background-jobs entry to the sidebar footer.
Keeps the running-count badge visible without competing with the new-chat action above the session list.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-23 09:26:53 +08:00
0cf6aafa30 Add background jobs with Chat UI so long agent scripts can run for hours safely.
start_job/get_job/sleep replace blocked run_command for multi-hour work; Chat shows a live count badge and allows manual kill, with a reaper reclaiming timed-out or stale processes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-23 01:02:57 +08:00
c31625d05b Fix WhatsApp image delivery and Chat duplicate attachment display.
Enqueue deliverable tool attachments on the WhatsApp queue path, and dedupe the same attachment_id within one Chat bubble (prefer deliverable).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-22 20:03:05 +08:00
ad1b95d0bc fix(admin): make popups and overlays respect light theme
Replace hardcoded dark modal, menu, toast, and lightbox colors with theme CSS variables so text stays readable in light mode.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 15:29:21 +08:00
1ea13a205d feat(whatsapp): add access control with quote-based admin approval
Introduce whitelist/blacklist gating, pending requests, Admin UI management, and stanza-mapped quote approval so admins can approve via WhatsApp DM without blocking normal LLM chat.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-01 11:36:58 +08:00
47813f6a94 feat(scheduler): add scheduled jobs with channel-aware delivery
Introduce persisted cron/interval jobs, gateway scheduler loop, worker turns,
and admin CRUD/edit UI. Route proactive reminders via the originating chat
channel (WhatsApp vs WeChat), harden Weixin outbound with durable queue and
PG-compatible polling, and fix chat UI to show each scheduled reminder separately.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 15:56:10 +08:00
7210293f42 feat(netx-bridge): WhatsApp proactive alerts from NetX key alarms
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-22 11:17:32 +08:00
bc1b45a8fd fix(chat,channels): admin session delete, weixin inbound, PG and docs
- List/delete chat sessions for administrator by username (cross-tenant UUID)

- Return 404 when delete does not remove a session; add tests

- Weixin: dispatch lang, inbound attachments, reply persist, native reply timeout

- PG compat scrub and administrator session delete repo path

- RUNBOOK: WhatsApp re-bind with Remove-Item auth; weixin poll diag scripts

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 01:36:45 +08:00
39fd1905b6 fix(chat): keep tool-call process notes out of visible body
Preserve tool_call event_type when hydrating WS final messages, never render main-channel process notes as assistant body text, and prefer structured message content over stream buffer on finalize.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-31 12:41:12 +08:00
4610989d72 fix(mcp): preflight python module check and surface install errors
- Verify python -m module import in preflight with fix hints

- Pass env_schema defaults in health/sync; catch JSON install exceptions in UI

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-30 23:42:44 +08:00
a0a3f4b65f feat(mcp): integrate netx via netx_mcp and improve MCP install
- Gate builtin netx tools; ops docs/skills use mcp__netx__*

- Import Cursor mcpServers JSON; pass env_schema defaults to subprocess

- Allow source_type=local; UTF-8 MCP stdio on Windows

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-30 15:44:34 +08:00
8233db93db Increase default tool rounds to 100 with 300 cap.
Raise Admin/UI defaults and backend clamps for AIA_TURN_MAX_TOOL_ROUNDS across gateway, worker, and direct loop paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-28 11:34:20 +08:00
89b295293d Raise default tool rounds to 30 and cap at 100 per turn.
Update gateway, worker, direct_loop, and Admin tool policy UI/docs for AIA_TURN_MAX_TOOL_ROUNDS.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-27 17:34:39 +08:00
f1626195f7 fix(chat): honor ui_lang on WebSocket turns; ops NE display by host_name
Resolve runtime language from ui_lang and chat.send lang instead of hardcoding zh.
Align generalist/ops prompts with user language and require host_name (not ne_id) in ops outputs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 22:14:44 +08:00
428eed7ae4 chore(admin): remove netx ops tools sidebar link
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-17 12:11:43 +08:00
807679aaaa feat: 更新 knowledge-base-manager skill,添加完整 ID 映射和严格目录限制 2026-05-16 22:27:57 +08:00
d14e9d3596 feat(persistence): PostgreSQL assistant store, chat persist fixes, gateway scripts
- Add SQLAlchemy Core repos, pg adapter/compat, assistant_store factory, Alembic bootstrap and migration/cutover scripts.

- Harden chat_message writes (NUL scrub for PG), turn_uuid on attempt failure, WS turn_runner fallbacks and gateway executed_turn_uuid init.

- start_gateway: log paths, PS7 stderr handling via cmd, background stdout/stderr redirect; runtime assistant_runtime_log_dir export.

- Ops: clear_all_chat_sessions with PG-only --postgresql and env-gated wipe; clear_postgres_chat_sessions.ps1.

- Tests: SA repos, pg compat, persist fallback, smoke env isolation; CI and docs touch-ups.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 09:33:50 +08:00
4ea26a022b fix(chat): fold tool_call main-channel text and fix aggregate row loss
- _buildRenderRows: include assistant content for event_type=tool_call as
  assistant_text items with assistantEventType=tool_call (was omitted).
- Tag other assistant_text slices with assistantEventType for clarity.
- _buildAggregatedAssistantBubble: for tool_call slices, add non-redundant
  main-channel text to the reasoning fold under reasoning.processNotes;
  skip when already covered by reasoning blocks (whitespace-normalized
  substring). Inline markdown for those process lines is omitted to avoid
  duplicate display. Bump chat.js cache query.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-13 00:02:18 +08:00
c938147fdb fix(chat): default reasoning fold on for new browsers and bump chat.js cache
The reasoning/tool collapsed bundle is gated by adminChatShowToolOutput,
which was only read from localStorage with default false. A fresh browser
therefore hid persisted reasoning in the fold while streaming still showed
tokens. Default to true and bump chat.html asset version so deployments pick
up the script.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-12 20:29:58 +08:00
46ebfeb54f fix(chat): persist/split <thinking>/<thought> blocks like stream UI
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-12 19:32:19 +08:00
7ea02e66ca fix(chat): show thinking_mode reasoning in folded bundle from event_payload
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-12 19:28:03 +08:00
c33ca303a2 Fix prewarm prompt preview staleness (cache + Admin wait)
Include skill_role_binding store JSON in executor and manager prompt cache signatures so skill catalog updates after binding edits without restart. Admin async prewarm now polls prewarm/status until not running before router() so parallel prompts fetch matches completed warm.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-11 16:24:33 +08:00
4dbb834c95 Fix role binding filter when mapping is empty
should_apply_workspace_role_filter no longer requires at least one bound skill. With binding enabled and an empty map, the catalog shows only public workspace skills per role (matches prewarm and runtime). Update Admin copy and add regression test.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-11 16:07:34 +08:00
091a5626e7 Expose skill role binding stored vs env override in Admin API
Add enabled_stored and enabled_env_present on skills binding GET/POST so UIs can explain when AIA_SKILL_ROLE_BINDING_ENABLED overrides SQLite. Add Admin hints for save-required and env override. Add skill_role_binding_enabled_stored/env_present helpers and a unit test.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-11 15:59:51 +08:00
4335040a27 feat(video): DashScope video specialist with correct i2v request bodies
- Add video_generation_client: async video-synthesis, t2v vs i2v (Wan 2.7 input.media first_frame vs legacy img_url).

- Coerce *-t2v* to *-i2v* when first frame present; AIA_VIDEO_I2V_INPUT_STYLE / I2V_MODEL overrides.

- Gateway/direct_loop early return for video specialist; workspace video + factory allowlist.

- Normalize WS and admin chat attachments (image_ref parity); mp4 attachment store roundtrip tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-10 16:20:43 +08:00
398d85ba06 fix(chat): complete streaming for reasoning, tools, and tool calls
- Forward reasoning_content and non-stream reasoning to on_token in
  OpenAI chat completions; Gemini thought parts to on_token.
- Stream bubble: always render session.tool panels; format tool_use_call
  payloads and title as call · tool_name.
- Emit tool_use_call via on_tool_ui before tool execution so WS shows
  invoke cards before tool_use_result.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-10 14:02:14 +08:00
396dba76ea feat(chat): image specialist session image fallback and WS UX
- Resolve legacy multimodal inputs from session history when the user sends
  text-only (assistant images first, then user uploads); optional env toggles.
- Support relay_pointer image resolution in legacy lane collector.
- Align uvicorn WebSocket frame limit with MAX_PAYLOAD_BYTES; document
  OCLAW_UVICORN_WS_MAX_SIZE and compatible-mode env knobs.
- Admin chat: encode attachments after bubble preview; FileReader-based
  base64 for large files.
- Tests and docs for new behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-10 11:25:21 +08:00
faeb067856 feat(chat): image specialist legacy lane, Responses fixes, ACL + UI attachments
- Image expert: DashScope-style /chat/completions via image_legacy_client; early exit in
  direct_loop when skill_binding_role is image; shared placeholder helper; docs/IMAGE_SPECIALIST_LANE.md.
- Strict attachment ACL: link_attachment_acl on assistant chat_message rows (sqlite_store);
  chat attachment rate limit when user_id empty; admin chat tests updated.
- Admin chat UI: aggregate bubbles render assistant_text attachments (image_ref); WS expand path.
- turn_runner: persisted_chat_attachments_nonempty for final_msg selection.
- OpenAI Responses transport + agent_messages/agent_core_attempt adjustments; env docs and tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-10 07:06:05 +08:00
d1bcc4debe feat: multimodal image clients, workspaces, Tushare skill, test fixes
- Replace monolithic image_message_client with HTTP/OCR/legacy modules; tighten OpenAI transport + tool schemas for multimodal downgrade to OCR specialist path.
- Add image/stock workspace prompts (META/SOUL/ROLE_SYSTEM); register experts; tweak specialist agent/direct loop/query_image_attachment.
- Add bundled runtime/skills/tushare-finance (references, api_client, SKILL metadata).
- Document OCR-related env vars; admin chat tweaks; README; weixin_install Ensure-OfficialPluginRuntimeDeps helper.
- Tests: multimodal downgrade + OCR coverage, strict tool pairing in attachment replay guard, workspace contract skips _internal/_system dirs, router/trace/prompt guards.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-10 04:41:42 +08:00
04050747ae fix(chat): handle missing branding dir and full-width layout
Create optional _local/branding directory at startup to avoid StaticFiles FileNotFoundError, and force standalone chat root containers to occupy full width.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-09 14:53:30 +08:00
acf1266e90 feat(品牌): 支持 _local 外部优先 Logo 与图标覆盖
新增 /admin/brand-assets 静态挂载,并在前端与桌面端统一采用外部优先、内置兜底的品牌资源解析;同时补充 BRANDING 文档与 README 入口说明。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-07 10:17:38 +08:00
6628cd1220 feat(models): add toggle to hide chat model selector
Expose a model-management setting to control chat-page model dropdown visibility, persist it in app settings, and apply it in chat UI rendering.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-06 18:58:01 +08:00
16169b3de2 fix(desktop): external gateway mode and start script alignment
- Add desktop env for non-embedded gateway (OCLAW_DESKTOP_EMBED_BACKEND, base URL, skip channel).
- Wire start_all/start_desktop to pass gateway URL when keeping existing gateway; fix root start_all flags.
- Prefer electron.cmd for background desktop launch; admin static theme presets and chat boot timeouts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-06 11:06:16 +08:00
b0e0c05d8a feat: integrate netx ops data access and unify prompt/workspace runtime
Migrate prompt templates into runtime workspaces, add network_ops netx toolchain (latest batch injection, raw fields, SQL query), and align docs/tests/admin/runtime wiring so ops analysis can query netx detail data through stable role-scoped paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-03 23:54:38 +08:00
83f46f8aa2 feat: add admin audit pagination and improve admin/chat UX.
Move admin operation audit to true offset-based pagination with SQL-side filtering and total count metadata, while keeping legacy response compatibility. Also refine admin Experts section layout and improve chat image viewer interactions and reasoning finalization behavior to reduce UX regressions.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-02 20:12:32 +08:00
37522f492a feat: plan agent v2, global chat mode, and user-mode v2 flag sync
- Add runtime/plan_agent_v2 package and shims; gateway/direct_loop/WS wiring

- Admin chat: interaction mode and specialist only in user menu; session API stores memory_mode and execution_mode only

- POST /admin/api/chat/user-mode mirrors plan_agent_version to AIA_EXPERT_PLAN_AGENT_V2_ENABLED (v2 to 1, v1 to 0)

- Composer cleanup (hidden mode select, no reasoning toggle in meta bar); tests and _local/system.env.example

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-02 18:41:45 +08:00
ae44cbcad5 完善 MCP/会话上下文治理并补齐搜索与诊断能力。
补充历史压缩与会话诊断链路,强化 tool pairing 与空响应兜底观测;完善 Admin MCP 导入/绑定与相关前端展示;新增 web_search_fast/web_fetch_clean 及多项测试与文档更新,并同步技能安装与角色绑定策略改进。

Made-with: Cursor
2026-05-01 17:46:50 +08:00
5d67303d22 修复 Admin Skills 安装区块不显示,并支持卸载 _workspace/public lane。
同时补齐 _workspace/public 目录约定、公共技能免绑定规则,并为 run_command 增加默认禁用开关与回归测试。

Made-with: Cursor
2026-05-01 03:34:32 +08:00
5ef9abb069 将高风险 public 工具开关改为按用户生效。
在 Admin 工作区路径页新增并保存用户级 public_tools_allow_high,扩展用户路径策略存储字段并让 catalog 风险门控优先读取该用户策略(环境变量仍可覆盖)。

Made-with: Cursor
2026-05-01 01:59:11 +08:00
4d9232f3b3 统一技能安装与 Skills 市场接入链路。
新增公开安装工具与多来源 provider 支持,补齐管理端与目录加载逻辑,并同步更新相关测试与文档以保证可见性和路径安全。

Made-with: Cursor
2026-04-30 22:17:50 +08:00
d5e30542aa 统一会话展示与专家路由行为,修复图片异步显示与气泡宽度问题。
本次移除 image 专家角色并同步更新路由/绑定/测试,同时增强 session-bootstrap 的共享与角色分层记忆加载,减少刷新依赖并提升默认可用性。

Made-with: Cursor
2026-04-29 22:16:49 +08:00
2edd78ac3b 统一图片附件在聊天与通道回送链路的可见性与可发送性。
支持 tool_result 的 image_ref 前端渲染,并在微信/WhatsApp 回送时将 attachment 引用自动展开为可发送媒体,补齐回归测试。

Made-with: Cursor
2026-04-29 20:26:53 +08:00
6a71892c72 增加 Admin MCP 更新检测与按需更新能力。
新增 check-updates 接口并在已安装列表展示更新状态,支持一键检查更新与仅更新过期项,减少 MCP 上游变更导致的被动排障成本。

Made-with: Cursor
2026-04-29 10:47:03 +08:00
25180921e7 兼容 memory-wiki 输入路径并强调相对路径
- memory-wiki 的 wiki_root 路径解析兼容:相对路径 / data/wiki 前缀 / wiki_root 下绝对路径
- 系统提示词强调:模型传相对 wiki 根路径(相对 data/wiki),避免直接给 data/wiki/... 或绝对路径
- 修复并回归:memory-wiki 工具动态加载模块 import-time 错误(sys.modules 注入)
- chat.js 增强会话滚动跟随(异步渲染补滚)

Made-with: Cursor
2026-04-29 08:54:58 +08:00
5ab69e88d3 Update channel dispatch UX and harden sidecar startup behavior.
This aligns Weixin/WhatsApp with admin-managed model routing by adding channel/account-level specialist controls, improves OSS startup resilience by skipping missing sidecars gracefully, and refreshes runbook/readme guidance for the new default behavior and Weixin OpenAI-key silent handling.

Made-with: Cursor
2026-04-28 22:58:50 +08:00
31e3962c74 Harden attachment access controls and stabilize the Weixin bridge.
This persists referenced media safely, adds explicit attachment ACL/backfill flows, and fixes the Weixin sidecar so official login state can bridge reliably into oclaw without duplicate replays or dropped replies.

Made-with: Cursor
2026-04-28 15:38:55 +08:00
6cfaff06f6 Refactor media payload handling to persist base64 blobs as attachment refs and keep non-turn model paths safe by degrading risky payloads.
This preserves multimodal fidelity for the latest user turn while preventing historical/tool replay bloat, and adds admin UI support for referenced attachment preview/download flows.

Made-with: Cursor
2026-04-28 10:30:27 +08:00