Commit graph

338 commits

Author SHA1 Message Date
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
b6e023cd91 Fix duplicate WhatsApp outbound delivery.
Claim pending rows atomically and serialize the sidecar poller so overlapping polls cannot send the same reply twice; also stop inbound queue delivery from falling through to a second enqueue.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-22 11:41:52 +08:00
10ae4abc1d Fix WhatsApp same-session quote re-injection.
Strip @mention prefixes and widen history lookup so reply-to of the bot's own prior answer is not wrapped as [被引用消息] again.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-22 10:24:23 +08:00
2446993b11 Fix WhatsApp overlap by serial queue, typing, and outbound delivery.
Serialize per-session inbound turns and merge follow-ups after the active run; show composing while busy and enqueue final replies so long agent runs still reach the group.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-22 10:04:25 +08:00
f1ed86537c Add ops IP knowledge playbook for protocol troubleshooting.
Give the ops specialist a skill to search docs/ip-knowledge-base and verify findings via netx before concluding.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-21 20:24:11 +08:00
db1d89d83b 增加知识文档 2026-07-21 19:01:49 +08:00
f3152acb88 fix(scheduler): clarify interval units in schedule tools
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-21 17:14:19 +08:00
e3828418d4 fix(chat): allow administrator to delete channel-only sessions
Align administrator session deletion with the administrator chat view so
sessions surfaced through channel_session_v2 can be removed without a
ui_session_owner row.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-21 16:55:51 +08:00
4f36f4a36f fix(scheduler): reuse one execution session per scheduled job
Reuse channel_session_v2 per job_id so cron runs do not create a new
oclaw session each time; isolate scheduled turn context to the active
turn_uuid so shared sessions do not leak prior run history.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-21 16:20:31 +08:00
146d83c336 fix(scheduler): inherit creator specialist when creating scheduled jobs
Pass the active workspace lane into tool execution and default schedule_create to that specialist so WhatsApp ops-bound jobs are stored and run as ops instead of generalist.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-21 15:42:58 +08:00
62ac04c40d fix(scheduler): isolate scheduled runs and @mention job creator on WhatsApp
Use a fresh execution session per run while keeping source_session_id for delivery only; filter bot JIDs and default scheduled @mentions to the job creator.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-21 14:49:31 +08:00
f5cb64a3a4 fix(whatsapp): deliver scheduled job attachments to groups
Scheduled outbound only sent text via pollOutboundQueue; collect deliverable attachments from the turn, encode them in source JSON, and send via sendReplyWithAttachments.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-21 14:29:55 +08:00
40eed39110 docs(ops): anonymize sample NE in ops expert intro
Replace realistic host/IP fixture with a placeholder in the WhatsApp alarm example.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-15 10:29:31 +08:00
4c85dedf33 docs(ops): add oclaw and netx ops expert introduction guide
Introduce the ops specialist, netx integration, automation flows, and WhatsApp channel usage with Mermaid diagrams.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 17:18:08 +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
30202dd291 feat(scheduler): confirm before deleting scheduled jobs
Require preview confirmation for schedule_delete, extra confirm_foreign for others' jobs in groups, and mirror the same flow in chat slash commands.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 10:11:04 +08:00
d036190195 feat(scheduler): workflow recipes with confirm-before-create
Store self-contained playbook recipes on scheduled jobs, add schedule_propose draft gate, and run playbook instructions at fire time instead of only short reminders.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 09:58:39 +08:00
ad5d1db3c6 feat(whatsapp): real group @mentions and cleaner inbound text
Wire mention JIDs/names through scheduled delivery and immediate replies (including attachment captions), sanitize group message text for the model, and surface channel-derived sessions in admin Chat.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 20:05:43 +08:00
cbe68a54cd feat(channel): unify deliverable outbound and WeChat attachments
Require deliverable:true for all channel attachments including images; extend save_deliverable_attachment with attachment_id; add WeChat proactive attachment delivery; inject channel file rules via system prompt instead of repeating on every user message.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 15:56:50 +08:00
dc5da21f5a docs(skill): clarify write_file vs run_command for channel file delivery
Guide the model to use run_command with openpyxl for xlsx exports instead of claiming the tool is unavailable.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 11:00:38 +08:00
19f4d285ce feat(channel): deliver generated files on WhatsApp and honor user tool policy
Add save_deliverable_attachment for explicit document outbound, pass channel user_id into tool risk gating so write_file/run_command respect per-user allow_high settings, and document the workflow in channel-file-delivery skill.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 10:10:51 +08:00
61d54b10fd fix(attachments): parse channel uploads for LLM and stop echoing user files
WhatsApp/channel binary_ref uploads now expand into text_ref/tabular summaries for the model, and outbound replies only auto-attach generated image/video media instead of lookup tool text_ref results.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-03 21:43:49 +08:00
fc10560052 fix(whatsapp): isolate group sessions and inject quoted context safely
Default WhatsApp groups to per-user sessions, skip redundant quoted-text injection when already in recent history, and disable group long-term memory writes unless explicitly enabled.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-03 17:48:34 +08:00
d90fca7293 fix(whatsapp): add outbound retry backoff for failed sends
Track send attempts and schedule retry windows for pending WhatsApp outbound messages, then mark as failed after max retries to avoid silent drops without infinite resend loops.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 17:43:57 +08:00
a8d3d2d5ec fix(scheduler): default scheduled job timezone to system timezone
Replace hardcoded Asia/Shanghai with host IANA timezone detection for new scheduled jobs across tools, admin API, gateway cron, and store layer.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 17:31:21 +08:00
a27bca5648 fix(scheduler): inherit creator specialist in schedule_create
When the model omits specialist, inject selected_specialist from the current tool executor context so scheduled jobs run under the expert that created them.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 16:36:25 +08:00
ad052daaf0 feat(tools): expose schedule tools to all specialists
Move schedule_* tool factories into the public registry so ops/generalist both can create and manage scheduled jobs, and add an English schedule shortcut.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 15:42:06 +08:00
07fd776a39 feat(ops): enforce skill install lane for ops workspace
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 14:56:58 +08:00
261e9bc72e docs(netx): update listManagedNe filter requirement and paging limits
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 11:07:47 +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
8781a200c9 docs(netx): document ume_ne_id exec and listCliTargets MCP tool
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 17:13:50 +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
5336f8835f fix(whatsapp): pass quoted UME alarm to agent when @ bot
Extract quotedText from reply context correctly and enrich inbound only after mention detection, keeping strict @-required group policy.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-23 14:36:14 +08:00
538945fb66 feat(netx-bridge): use English UME alarm text for WhatsApp push
Replace Chinese NetX labels with UME Alarm Raised/Updated/Cleared and
English field names in proactive alert messages.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-22 20:37:51 +08:00
eaeb9fd33d fix(netx-bridge): use OCLAW_OPS_AI_SHARED_TOKEN for alarm WSS auth
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-22 11:22:39 +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
9b6bf1d4eb fix(llm): handle null-delta terminal stream chunks from mytokenland gateways
Some OpenAI-compatible proxies finish tool-call streams with delta=None and
a full message payload; accessing delta.tool_calls crashed tool rounds.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-10 20:47:23 +08:00
dbd22ef9be fix(whatsapp): download inbound media and send typed outbound attachments
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-05 19:50:34 +08:00
35a66dcc44 docs(netx): allow ping/ping6 in execManagedNe CLI policy
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-05 16:15:00 +08:00
9b58479e92 fix(whatsapp): only reply in groups when bot is among @mentions
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-05 14:14:13 +08:00
847567f495 docs(ops): use placeholder IPs in bastion hop playbook example
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-05 10:59:32 +08:00
3f17efb720 docs(ops): document bastion hop troubleshooting in managed-ne playbook
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-05 10:47:52 +08:00
959cd8227c docs(netx): state execManagedNe allows show/display commands only
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 20:51:07 +08:00
0fc05452ec fix(whatsapp): match bot LID mentions ignoring device suffix
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 20:15:54 +08:00
8c665290c4 fix(whatsapp): resolve LID @-mentions in sidecar and trust mentions_bot in gateway
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 20:01:45 +08:00
dcb779a691 fix(whatsapp): sync sidecar on start and forward all group inbounds
Copy bridge files when starting WhatsApp sidecar, enforce group policy only in gateway with richer @ detection, and log skipped group messages for debugging.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 19:52:25 +08:00
9657b313a3 fix(whatsapp): restore group @ replies with LID matching and send fallback
Match bot mentions across JID/LID formats, accept reply-to-bot triggers, keep raw quote participants, and fall back to plain text when quoted sends fail.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 19:41:33 +08:00
a218139da6 fix(whatsapp): suppress silent group replies and quote sender on reply
Infer group chats from @g.us JIDs, drop (silent)/NO_REPLY outbound text, and @ plus quote the asker when replying in groups.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 19:15:00 +08:00
900e3d0d3e feat(whatsapp): gate group replies on mention and share group sessions
Stop replying to every group message by filtering on @bot/triggers in the sidecar and gateway, and map group chats to one shared session while preserving per-sender identity.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 18:49:59 +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