Commit Graph

380 Commits

Author SHA1 Message Date
Shakker
33910876a7 test: tighten imessage gating assertion 2026-05-11 10:16:33 +01:00
Shakker
1ba3a2c882 test: tighten imessage inbound assertion 2026-05-11 10:15:38 +01:00
Shakker
dfb07441f9 test: tighten imessage catchup warning assertion 2026-05-10 18:34:46 +01:00
Shakker
f31fd753ee test: tighten imessage monitor retry assertions 2026-05-10 18:33:44 +01:00
Shakker
3ba2ab7a09 test: tighten imessage capability assertions 2026-05-10 18:32:09 +01:00
Shakker
d283e73dd9 test: tighten imessage deliver cache assertions 2026-05-10 18:30:52 +01:00
Shakker
2a26413762 test: tighten imessage deliver reply assertions 2026-05-10 18:30:02 +01:00
Shakker
d9a49732f3 test: tighten imessage synthesized reply assertion 2026-05-10 18:28:50 +01:00
Shakker
a49916913a test: tighten imessage effect action assertions 2026-05-10 18:28:03 +01:00
Shakker
a59c5123b0 test: tighten imessage phone target assertions 2026-05-10 18:27:01 +01:00
Shakker
a3afd0ac3f test: tighten imessage reply attachment assertion 2026-05-10 18:26:06 +01:00
Shakker
79fb5a9113 test: tighten imessage action bridge assertions 2026-05-10 18:25:08 +01:00
Shakker
e3d1432ecb test: tighten imessage action list assertions 2026-05-10 18:23:57 +01:00
Shakker
11e275b3ff test: tighten imessage action discovery assertions 2026-05-10 18:22:18 +01:00
Shakker
bf96ecc4a5 test: tighten imessage send receipt assertions 2026-05-10 18:20:12 +01:00
Omar Shahine
c0a65ba75e fix(imessage): WARN-log when private API bridge is unavailable (#80035)
When the imsg private API bridge is not attached to Messages.app,
`handleAction` throws and the model receives a `success:false` tool
result with a "Run imsg launch" hint. The throw never reaches the
gateway log, so an operator has no signal that an outbound reply was
silently dropped — `~/.openclaw/logs/openclaw.log` stays quiet and
`openclaw channels status` continues to report the channel as
`enabled, configured, running`.

Add a `channels/imessage` subsystem WARN log right before the throw
so the silent-drop is visible to log-tailing tooling and operators
without changing the tool result shape or the model-facing error
message. Cover the path with a regression test that asserts the WARN
fires once with the documented format and that the underlying send
adapter is never called on the failure path.

Admin-merged: required CI failures (check-lint, check-test-types,
check-additional-extension-bundled) are pre-existing upstream errors
in extensions/{codex,discord,googlechat,memory-core,slack,
synology-chat,telegram,irc,line,nextcloud-talk,qqbot} test files
that affect every open PR and are unrelated to this change. PR diff
is restricted to extensions/imessage/.
2026-05-10 11:45:20 -04:00
Peter Steinberger
827b0de0ce refactor: reduce plugin sdk surface 2026-05-10 12:37:10 +01:00
Vincent Koc
a31b75f543 chore(channels): remove bluebubbles hangover 2026-05-10 13:53:58 +08:00
Peter Steinberger
9243b575ed chore(release): prepare 2026.5.10-beta.1 2026-05-10 06:13:38 +01:00
Peter Steinberger
a0fb7fb045 refactor: centralize channel ingress access 2026-05-10 00:18:36 -04:00
Peter Steinberger
434b3d3876 fix: clarify Codex OAuth recovery hints 2026-05-09 23:53:57 +01:00
Omar Shahine
200eb62ef4 fix(imessage): wire reply attachments through send-rich --file (with feature gate) (#79864)
Merged via squash.

Prepared head SHA: 5e5cdfed79
Co-authored-by: omarshahine <10343873+omarshahine@users.noreply.github.com>
Co-authored-by: omarshahine <10343873+omarshahine@users.noreply.github.com>
Reviewed-by: @omarshahine
2026-05-09 14:59:04 -04:00
Shakker
01741f81f8 test: remove stale unused imports 2026-05-09 11:26:43 +01:00
Peter Steinberger
9385eaaf88 chore(release): prepare 2026.5.8 2026-05-09 08:05:17 +01:00
Shakker
92d7ab6845 test: tighten channel empty array assertions 2026-05-09 04:58:00 +01:00
Shakker
880a542944 test: tighten channel plugin empty assertions 2026-05-09 04:24:16 +01:00
Omar Shahine
81e0a1a99b feat(imessage): inbound catchup (cursor + replay loop + monitor wiring) (#79387)
Closes #78649. Adds opt-in inbound iMessage catchup that recovers messages landing in chat.db while the gateway is offline (crash, restart, mac sleep). Mirrors the design of the retired BlueBubbles catchup, adapted for the imsg JSON-RPC chats.list + messages.history fetch path.

- Schema: new channels.imessage.catchup block with enabled / maxAgeMinutes (1..720) / perRunLimit (1..500) / firstRunLookbackMinutes (1..720) / maxFailureRetries (1..1000). Disabled by default — opt-in.
- Cursor + replay loop (extensions/imessage/src/monitor/catchup.ts): per-account state under <openclawStateDir>/imessage/catchup/. Walks rows oldest-first, advances on success/give-up, holds at failed.rowid - 1 when a failure is below maxFailureRetries (cannot leapfrog held failures even when later rows in the same batch succeed). Watermark floor for parse-rejected rows.
- Bridge (extensions/imessage/src/monitor/catchup-bridge.ts): live chats.list + per-chat messages.history fetch adapter; dispatch adapter routes through the live handleMessageNow path so allowlists / group policy / dedupe / echo cache behave identically on replayed and live messages. Watermark clamped to last dispatched rowid when the cap truncates.
- Monitor wiring (extensions/imessage/src/monitor/monitor-provider.ts): catchup runs once between watch.subscribe and the live dispatch loop when enabled. Bypasses the inbound debouncer for serial per-row dispatch.
- Echo-cache TTL bumped 2 min → 12 h so own outbound rows from before a gap are not re-fed as inbound on replay.
- Generated bundled-channel-config-metadata.generated.ts so the runtime AJV schema accepts the new catchup block.
- Docs: new "Catching up after gateway downtime" section + BlueBubbles migration parity update.

Tests: 322/322 in extensions/imessage/, including 5 regression tests covering the cursor-leapfrog, parse-rejected stall, watermark vs held failure, and cap-truncation-cursor-floor edge cases that codex (gpt-5.4) and clawsweeper (gpt-5.5) found during review. Live-tested end-to-end against the running gateway: replayed=1 fetchedCount=1, agent reply observed, cursor persisted at the test row's exact rowid.

Co-authored-by: Omar Shahine <10343873+omarshahine@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 22:55:59 -04:00
Omar Shahine
85ebb4c471 feat(imessage): per-group systemPrompt (parity with other channels) (#79383)
Merged via squash.

Prepared head SHA: 2eecd01ed8
Co-authored-by: omarshahine <10343873+omarshahine@users.noreply.github.com>
Co-authored-by: omarshahine <10343873+omarshahine@users.noreply.github.com>
Reviewed-by: @omarshahine
2026-05-08 21:02:39 -04:00
Peter Steinberger
b584cadd9d test: tighten imessage coalesce guard assertion 2026-05-09 01:36:18 +01:00
Vincent Koc
a834175e01 chore(imessage): remove bluebubbles code comments 2026-05-09 08:03:02 +08:00
Peter Steinberger
fb689b9b97 test: require imessage adapter fixtures 2026-05-08 18:49:32 +01:00
Peter Steinberger
fe79d85ae0 feat(imessage): add native imsg message actions
Adds native iMessage private-API message actions, lightweight message-tool discovery, bridge capability cache sharing, execution-time action gates, target alias coverage, and regression tests.
2026-05-08 05:34:22 +01:00
Omar Shahine
df069f7b02 fix(imessage): surface silent group-allowlist drops at default log level (#79190)
Merged via squash.

Prepared head SHA: 6454366a62
Co-authored-by: omarshahine <10343873+omarshahine@users.noreply.github.com>
Co-authored-by: omarshahine <10343873+omarshahine@users.noreply.github.com>
Reviewed-by: @omarshahine
2026-05-07 20:09:05 -07:00
Omar Shahine
e259751ec9 feat(imessage): private-API support via imsg JSON-RPC [AI-assisted] (#78317)
Merged via squash.

Prepared head SHA: b7d336b296
Co-authored-by: omarshahine <10343873+omarshahine@users.noreply.github.com>
Co-authored-by: omarshahine <10343873+omarshahine@users.noreply.github.com>
Reviewed-by: @omarshahine
2026-05-07 19:20:18 -07:00
Vincent Koc
84638bfbb0 fix(imessage): report non-mac default imsg hosts 2026-05-07 12:53:01 -07:00
Peter Steinberger
1ef85c7d4c test: make suites safe without isolation (#78834)
* test: make suites safe without isolation

* fix: narrow auth profile credential types

* test: inject channel module loader factory locally
2026-05-07 08:43:29 +01:00
Peter Steinberger
0b88d6286c chore: bump version to 2026.5.6 2026-05-06 09:47:34 +01:00
Peter Steinberger
05eda57b3c refactor: migrate bundled plugins to message lifecycle 2026-05-06 01:46:42 +01:00
Peter Steinberger
5397667272 chore(release): prepare 2026.5.4 2026-05-04 10:09:55 +01:00
Peter Steinberger
31161abd40 chore(release): bump version to 2026.5.3 2026-05-03 03:08:47 +01:00
Peter Steinberger
80da0a0213 chore: bump version to 2026.5.2 2026-05-02 11:58:45 +01:00
Peter Steinberger
235d06bff1 refactor: trim imessage helper exports 2026-05-01 18:23:49 +01:00
Peter Steinberger
15649228d4 refactor: trim extension helper shims 2026-05-01 14:39:03 +01:00
Peter Steinberger
0fe007f71b refactor: trim extension test hooks 2026-05-01 14:32:30 +01:00
Alex Knight
e1a7c5b860 fix: handle EPIPE errors on child process stdin writes (#75602)
Fix three child-process stdin write paths that let async EPIPE errors
escape to uncaughtException and crash the gateway.

extensions/imessage/src/client.ts (the actual #75438 crash path):
- Add child.stdin.on('error') listener in start() to catch async EPIPE
  and reject all pending requests via failAll().
- Add write callback to request() stdin.write() that rejects the
  specific pending request on error, instead of leaving it hanging
  until timeout.

src/agents/mcp-stdio-transport.ts:
- Fix write callback race in send(): previously resolved the promise
  immediately when write() returned true, then the write callback with
  EPIPE would fire after the promise was already fulfilled. Now always
  settles the promise from the write callback so the outcome is known
  before resolving.

src/process/exec.ts:
- Add stdin.on('error') before writing input so EPIPE from a
  prematurely-exited child is swallowed — the process exit handler
  reports the real status.

One reporter observed a gateway crash after 10.5 hours of stable
uptime — a single EPIPE on an iMessage RPC child process stdin write
killed the gateway with code 1.

Fixes: #75438
2026-05-01 21:45:12 +10:00
Peter Steinberger
ffe67e9cdc refactor(channels): route inbound turns through kernel 2026-04-30 04:08:47 +01:00
Peter Steinberger
c403ea9063 refactor(channels): move more turn policy into kernel 2026-04-30 03:44:21 +01:00
Peter Steinberger
02ebac6250 refactor(channels): share turn dispatch results 2026-04-30 02:58:40 +01:00
Peter Steinberger
9a9cd0c0ab refactor(channels): add shared turn kernel 2026-04-29 23:16:16 +01:00
Peter Steinberger
7d74c1f4b9 test: align channel fixtures with open dm policy 2026-04-29 07:08:06 +01:00