Commit graph

95 commits

Author SHA1 Message Date
43f6a792eb Fix spaced DSML variant parsing and reasoning stream filtering.
Support < | | DSML | | ...> markup from vLLM gateways, filter DSML in reasoning_content during streaming, and fix invoke parse false negatives.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-27 16:25:58 +08:00
97d5c1744a Add DeepSeek DSML-to-tool_calls conversion at transport and runtime layers.
Promote DSML markup from assistant text into native tool calls during streaming and completion, filter DSML from UI tokens, and document AIA_DSML_TEXT_TOOLS for local vLLM proxies.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-27 15:39:11 +08:00
6f754ee5ea ops: use host_name as primary key for alarm NE display
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-20 00:04:33 +08:00
1366459ee0 feat(ops): enforce English-only replies and localize netx protocol labels
Append english_output_guard when lang=en, strengthen ops/generalist EN role prompts,
pass NETX_TOOL_LANG into netx tools, and map Chinese protocol buckets to English.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 23:35:46 +08:00
0de5f7bc98 fix(ops): English replies from English prompts and ROLE_SYSTEM.en
Detect language from user message before UI hint, load ops ROLE_SYSTEM.en.md when en, and wire user_text through WS/HTTP/worker paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 22:41:46 +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
807679aaaa feat: 更新 knowledge-base-manager skill,添加完整 ID 映射和严格目录限制 2026-05-16 22:27:57 +08:00
acfb2cf73b fix(chat): compress-history on PostgreSQL dict rows
- Normalize select id,content rows from dict_row vs sqlite Row in history_tool_result_compact.

- Expand memory_wiki_search ToolSpec to match wiki_search parameters; add schema regression test.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-15 19:22:45 +08:00
0dc0c4663f docs(pg): slim migration guide to shell one-liners
Migrator: only refuse import when SQLite and PG both have rows for a table (PG seed rows ok when SQLite empty). Add unit test for conflict helper.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 15:15:08 +08:00
1490bd5f24 feat: unify runtime logging (rotating files, log root, scripts, desktop)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-14 10:11:51 +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
2b32d11f43 feat(tools): add grep and workspace profile, fix write path
- Add grep_tool: ripgrep with Python fallback; avoid --json with -l/-c.
- Add workspace_profile_tool: scan, languages, tests, packages, git, CI hints; tests.
- write_file: resolve relative paths via workspace root (no data/workspace prefix).
- Update path guard and local public tool tests for new write behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-13 23:02:52 +08:00
420abac9f1 refactor: root-package imports (svc/runtime/interfaces) and fix PYTHONPATH
- Rename platform/ to svc/ to avoid shadowing stdlib platform.
- Replace from oclaw.* with from svc/runtime/interfaces; update -m CLI paths.
- tests/conftest: prepend repo root to sys.path (no parent-folder package name).
- CI: paths and offline_eval script under repo root.
- Ops scripts: PYTHONPATH must be repo root for python -m runtime.* (fixes gateway/WhatsApp sidecar startup).
- Fix default oclaw.json path in tabular/file attachment limits; stabilize attachment test config.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-13 14:51:17 +08:00
289cac4dd6 feat: parse DeepSeek V4 DSML tool_calls from assistant text
Add dsml_tool_parse per upstream HF encoding README (invoke/parameter,
string true|false, JSON for non-strings). Normalize <||DSML|| gateways.

Wire into run_oclaw_direct_loop when AIA_DSML_TEXT_TOOLS is on or
base_url/model suggests DeepSeek; skip DSML repair retry in that mode.
Strip the first tool_calls block from persisted assistant body. Finalize
pass keeps DSML disabled so no tools run after the no-tool round.

Tests cover parser variants and direct_loop execution for DeepSeek URL
and forced env.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-13 00:51:22 +08:00
5efac74f87 fix(chat): always persist reasoning_content on assistant event_payload
Non-thinking profiles previously wrote model reasoning only as separate
event_type=reasoning rows whose event_payload held chunk_index metadata, so
JSON inspection showed tool payloads but no reasoning_content key.

Store the full merged reasoning blob on the primary assistant row whenever
present (same shape as thinking mode). Update instruction-leak filtering to
scan event_payload.reasoning_content as well as legacy reasoning rows.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-12 23:02:38 +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
5b2f182ae4 fix(admin): run_command toggle GET matches DB absent; add disabled hint
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-12 19:17:13 +08:00
274a9b8ddd feat(mcp): pass all mcp_local.env keys to subprocess; allowlist supplements host-only
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-12 18:51:07 +08:00
48d5e468e6 feat(mcp): allowlist EXTRA merges with default; add Trilium keys to default
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-12 17:39:14 +08:00
f367779ad1 Docs: UME NE keyword matches host_name (netx-side)
Align ops playbook and netx_query_ume_ne_inventory description with netx API.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-11 17:27:26 +08:00
1c90a3570e Add netx UME NE inventory tools for ops
Expose netx_query_ume_ne_inventory and netx_get_ume_ne (GET /v1/ume/inventory/ne and /ne/{id}). Update ops playbook, ROLE_SYSTEM, env example comment, and unit tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-11 17:24:57 +08:00
939a734e76 Bust executor prompt cache on workspace SKILL.md layout changes
Add workspace_skills_layout_signature (hash of paths + mtimes + sizes) and fold it into get_executor_prompt_static and manager prebuild cache keys. Add tests for signature drift and cache invalidation.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-11 16:28:16 +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
df30b5902f feat: 路径约定体系 & 自优化管道落地 2026-05-10 23:28:41 +08:00
2c7b318561 feat(runtime): enforce native tool calls and web-only stack scripts
Apply a global native tool_calls-only prompt rule to prevent DSML/textual protocol outputs, and expand start_web/stop_web to manage gateway, sidecars, and wiki worker without launching desktop.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-10 20:08:03 +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
75a3038f33 fix(run_command): decode subprocess output as UTF-8 on Windows
GBK default decoding failed on curl/wttr.in UTF-8 output, leaving stdout empty
with exit 0; use utf-8 + replace.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-10 12:08:42 +08:00
beb52006d8 refactor: move bundled skills tree to repo root skills/
- Relocate runtime/skills -> skills/; runtime_skills_root() prefers oclaw/skills
  with fallback to legacy runtime/skills for unmigrated trees.
- session-bootstrap hook handler resolves repo root via PROJECT_ROOT.
- Update architecture/migration docs and in-tree skill references.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-10 11:35:57 +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
6307ade480 fix(netx-tools): ignore system proxy for netx API calls
Set trust_env=False for netx tool HTTP clients so local netx endpoints are called directly instead of via host proxy settings.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-09 16:10:40 +08:00
38de5a305f fix(scripts): resolve repo root by searching oclaw.json
Make start/stop scripts robust to directory renames, and improve stop hints when process termination is denied.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-09 11:41:24 +08:00
f538409c08 feat(ops): add UME alarm playbook skill and tool guardrails
- Add ops-netx-ume-playbook skill (zh-CN) with presets, paging and SQL safety defaults
- Strengthen ops identity disclosure rules (always 'oclaw智能运维')
- Improve netx UME anchor context and add raw/aggregate/SQL tooling ergonomics

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-09 00:05:23 +08:00
5b925854f0 fix(whatsapp): 固定安装依赖版本并规避导出路径错误
将 whatsapp 安装脚本改为固定版本安装 baileys/tsx/typescript 等依赖,并在安装前移除 whatsapp-rust-bridge,降低 ERR_PACKAGE_PATH_NOT_EXPORTED 兼容性问题。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-07 15:09:06 +08:00
89fe51d282 fix(whatsapp): 修复登录脚本黑窗秒退并补充文档入口
将 whatsapp_login.ps1 改为前台执行并保留错误输出,新增 -VerboseRunner 参数与退出码校验;同时在 README 增加 WhatsApp 安装与启停入口。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-07 15:01:51 +08:00
b15ff4c31c fix(prompt): invalidate bootstrap cache on wiki changes
Add a session-bootstrap content signature to the executor prompt cache key so identity/wiki updates invalidate cached system prompts and take effect on the next turn.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-06 23:42:52 +08:00
5fc0805c69 feat(memory): improve wiki search observability and retrieval flow
Expand memory wiki search with context-rich paginated results and bounded query expansion, and add default three-stage retrieval guidance for agents using memory_wiki_search.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-06 23:19:28 +08:00
d731288ffa fix(runtime): harden tool-call pairing and extend run_command timeouts
Prevent invalid tool_calls replay by requiring immediate tool-result adjacency in message building, and raise run_command default and tool-level timeout ceilings to reduce install-command timeout failures.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-06 22:34:54 +08:00
9f4fa3d319 fix(chat): harden session auto-title and keep a single no-tool LLM call
- Add session_auto_title prompts, finalize_auto_title (reject prose, truncate, fallback).
- Third-round naming: one model.chat(system, user) with empty tools; reuse executor.model.
- Extend worker title tests for garbage model output.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-06 15:19:22 +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
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
df91434936 适配 Bailian WebParser 兼容接入并完善 sidecar 文档。
新增 WebParser 兼容工具与 MCP health/tools-sync 兼容模式,让 WebParser/sse 可注册到 agent 并暴露明确 schema;同时修复 mcp argv 环境变量展开并补齐微信 sidecar 纯本地化安装与文档说明。

Made-with: Cursor
2026-05-01 17:40:52 +08:00
329fb2239a 统一技能安装链路并提交当前skills变更。
新增 public 的 skill_auto_install 工具并移除 catalog 旧实现,同时按当前工作区状态提交 skills 精简与 skill-creator 新增内容。

Made-with: Cursor
2026-05-01 04:23:24 +08:00
1c71a29ec1 将附件/多模态查询与编辑工具从 generalist 迁移到 public。
同时移除 network_ops 的转发壳文件,统一工具入口并更新对应测试引用,降低重复维护成本。

Made-with: Cursor
2026-05-01 04:13:43 +08:00