Commit Graph

38 Commits

Author SHA1 Message Date
Pavan Kumar Gondhi d5e89de906 fix(synology-chat): deliver attachments without forwarding source URLs [AI] (#119941)
* fix(synology-chat): host outbound attachments

* fix(synology-chat): isolate hosted media routes

* fix(synology-chat): harden hosted media limits

* fix(synology-chat): inspect hosted media content

* fix(synology-chat): reject ambiguous media routes

* fix(synology-chat): retain indeterminate media capabilities

* fix(synology-chat): mask public callback URLs

* fix(synology-chat): align callback sensitivity metadata

* fix(synology-chat): reserve media capability query keys

* fix(synology-chat): release rejected staged media

* fix(synology-chat): preserve ambiguous media handoffs

* fix(synology-chat): scan complete active media preamble

* fix(synology-chat): report validated attachment readiness

* fix(synology-chat): bound public media capability probes

* fix(synology-chat): bound hosted media responses

* test(synology-chat): model response headers read-only

* fix(synology-chat): bound hosted media reads

* fix(synology-chat): bound hosted media delivery

* fix(synology-chat): retain media through active serves

* fix(plugin-sdk): lease hosted media readers atomically

* fix(synology-chat): close hosted media review gaps

* test(synology-chat): clean up hosted media state

* fix(system-agent): canonicalize sensitive config paths

* fix(system-agent): honor runtime config sensitivity hints

* fix(config): inherit sensitive metadata

* fix(synology-chat): close latest review findings

* test(system-agent): keep config recovery checks lint-clean

* fix(system-agent): redact structured config secrets

* fix(synology-chat): harden active-content sniffing

* fix(security): close hosted media review gaps

* fix(security): close remaining hosted media review findings

* fix(system-agent): narrow dynamic owner ids safely

* fix(system-agent): narrow dynamic channel ids safely

* test(channels): isolate hosted media proofs

* fix(security): close config and hosted media review gaps

* test(plugin-sdk): split outbound media retention coverage

* test(plugin-sdk): isolate capacity store fixtures

* test(system-agent): assert config secrecy invariant
2026-08-14 17:05:20 -05:00
Peter Steinberger b080dd1e76 refactor: consolidate coercion contracts (#122458)
* refactor: consolidate coercion contracts

Centralize exact string, record, numeric, date, Boolean, argument, and structured-error coercions while preserving call-site semantics.

Migrate canonical-name collisions and deprecated internal SDK bypasses, deleting 55 net production/tooling lines. Expand declaration ownership enforcement to 101 allowed helpers and add a narrow export-completeness audit.

* fix: preserve standalone script coercions

Keep copied Control UI tooling self-contained and retain the trusted release harness module-relative source seam when the harness runs against an old target cwd.
2026-08-11 23:26:37 -07:00
Alix-007 50ec5570ae fix(synology-chat): prevent duplicate messages after ambiguous failures (#119539)
* fix(synology-chat): avoid ambiguous send replays

* fix(synology-chat): classify aggregate send failures

* test(synology-chat): trim retry loopback proof

---------

Co-authored-by: Dallin Romney <dallinromney@gmail.com>
2026-08-08 11:46:04 +08:00
Peter Steinberger e812630f80 fix(synology-chat): reject failed webhook response envelopes (#118558)
Co-authored-by: Peter Steinberger <steipete@macos.shared>
2026-08-03 00:36:18 -07:00
zw-xysk 30c257f6b4 fix(synology-chat): bound outbound NAS response bodies to prevent Gateway OOM (#105089)
* fix(synology-chat): settle user_list overflow without hanging

Cap reads at 1 MiB with Buffer concat. On overflow, finish the promise
before destroy() — bare destroy often skips end/error and hung the test.

* fix(synology-chat): share bounded user-list reader

Co-authored-by: zw-xysk <zhao.wang1@xydigit.com>

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-15 10:38:01 -07:00
mushuiyu886 65d55d046b fix(synology-chat): replies target the wrong user when Unicode nicknames span response chunks (#108019)
* fix(synology-chat): preserve UTF-8 in user list responses

* refactor(synology-chat): use native response decoding

Co-authored-by: 杨浩宇0668001029 <yang.haoyu@xydigit.com>

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-15 02:02:00 -07:00
Peter Steinberger 21ec1546e5 refactor(extensions): trim internal plugin surfaces (#107796)
* refactor(diffs): privatize internal plugin surfaces

* refactor(file-transfer): privatize internal plugin surfaces

* refactor(nextcloud-talk): privatize internal plugin surfaces

* refactor(synology-chat): privatize internal plugin surfaces

* chore(deadcode): shrink extension export baseline
2026-07-14 15:02:56 -07:00
Peter Steinberger 4fa5092cdc docs: document small extension sources 2026-06-04 21:02:07 -04:00
Peter Steinberger 304e2c83c0 chore(lint): enable stricter oxlint rules 2026-05-31 18:59:02 +01:00
Peter Steinberger 3dfb76f13b fix(synology-chat): centralize user id parsing 2026-05-29 07:14:31 -04:00
Andy d2319d718c fix(status): keep default JSON scan lean
Default `openclaw status --json` stays on the lean health-probe path while preserving the JSON task summary, local update/install metadata, explicit probe timeouts, and configured gateway handshake timeouts. Deeper memory, registry, remote git, and local status-RPC diagnostics remain behind `status --json --all`.

Also keeps generated diffs viewer output in its built form and ignores it in oxfmt so `pnpm build` leaves a clean tree.

Proof:
- `node scripts/run-vitest.mjs src/commands/status.scan.fast-json.test.ts src/commands/status-json-payload.test.ts src/commands/status.scan.shared.test.ts`
- `OPENCLAW_LOCAL_CHECK=0 node scripts/run-oxlint-shards.mjs --threads=8`
- `node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core-test.tsbuildinfo`
- `node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.extensions.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/extensions-test.tsbuildinfo`
- `.agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main`
- GitHub checks green for head `47a63f87ea7c2351994fdb71e8cc18041aa0b64e`

Thanks @andyylin.

Co-authored-by: Andy <andyylin@users.noreply.github.com>
2026-05-28 02:28:49 +01:00
Peter Steinberger d1aa3cb925 fix: reject partial numeric command values 2026-05-27 20:10:01 -04:00
Peter Steinberger c1a026a976 fix: stabilize tests and reduce plugin memory churn 2026-05-26 00:01:30 +01:00
Peter Steinberger cf68115e6e test: dedupe synology client mock reads 2026-05-13 07:25:03 +01:00
Peter Steinberger 185ace0155 test: dedupe synology chat http mock calls 2026-05-12 15:12:36 +01:00
Shakker 54807c3af8 test: tighten synology tls assertions 2026-05-11 08:49:52 +01:00
brokemac79 a67753cc25 fix(agents): clarify subagent spawn wait guidance (#79051)
Summary:
- Replace the subagent spawn accepted-note yield guidance with push-based completion-event guidance.
- Cover the prompt with regression assertions that keep sessions_yield out of the note.
- Keep current rebased lint/type test helpers green.

Verification:
- pnpm lint
- pnpm check:test-types
- env -u OPENCLAW_TESTBOX -u OPENCLAW_TESTBOX_ID pnpm check:changed

Co-authored-by: brokemac79 <martin_cleary@yahoo.co.uk>
2026-05-10 17:11:32 +01:00
Shakker f1b4cdf73b test: tighten synology chat audit client assertions 2026-05-10 17:06:12 +01:00
Peter Steinberger 45ef4815df test: tighten messaging helper assertions 2026-05-08 20:55:20 +01:00
Shakker 873e26adbb test: tighten synology chat tls assertions 2026-05-08 19:10:29 +01:00
Peter Steinberger 9ef37d1907 test: tighten assertions and harness coverage 2026-05-08 05:28:12 +01:00
Agustin Rivera 38356c658a fix(synology): validate webhook file urls (#69784)
* fix(synology): validate webhook file urls

* fix(synology): restore file send throttle

* docs(changelog): note synology webhook file_url SSRF guard (#69784)

---------

Co-authored-by: Devin Robison <drobison@nvidia.com>
2026-04-21 12:00:28 -06:00
Peter Steinberger 8e681123d8 refactor: dedupe synology chat tests 2026-04-21 00:06:19 +01:00
Peter Steinberger 1f9bc4d057 test: share synology chat fixtures 2026-04-20 17:18:33 +01:00
Peter Steinberger 8d095147b4 fix: restore check gate 2026-04-06 15:20:03 +01:00
Peter Steinberger af62a2c2e4 style: fix extension lint violations 2026-04-06 14:53:55 +01:00
Peter Steinberger 561bacd06a fix: harden synology chat TLS helper defaults 2026-04-04 20:21:13 +09:00
Peter Steinberger 847faa3d04 test: trim extension test import churn 2026-04-03 04:41:08 +01:00
Tak Hoffman 3ccc58ae29 Restore channel test module rebinding 2026-03-27 23:29:42 -05:00
Peter Steinberger a1f995053e refactor: migrate more boundary parsing to zod 2026-03-27 05:07:50 +00:00
Peter Steinberger fb6454c543 refactor: narrow synology legacy name lookup 2026-03-22 23:32:21 -07:00
Peter Steinberger ea800dd4ef refactor: clarify synology delivery identity names 2026-03-22 23:32:21 -07:00
Peter Steinberger b9f0effd55 test: dedupe synology chat client timer setup 2026-03-13 21:54:39 +00:00
Peter Steinberger 1aa77e4603 refactor(extensions): reuse shared helper primitives 2026-03-07 10:41:05 +00:00
Jean-Marc 9a3800d8e6 fix(synology-chat): resolve Chat API user_id for reply delivery (#23709)
* fix(synology-chat): resolve Chat API user_id for reply delivery

Synology Chat outgoing webhooks use a per-integration user_id that
differs from the global Chat API user_id required by method=chatbot.
This caused reply messages to fail silently when the IDs diverged.

Changes:
- Add fetchChatUsers() and resolveChatUserId() to resolve the correct
  Chat API user_id via the user_list endpoint (cached 5min)
- Use resolved user_id for all sendMessage() calls in webhook handler
  and channel dispatcher
- Add Provider field to MsgContext so the agent runner correctly
  identifies the message channel (was "unknown", now "synology-chat")
- Log warnings when user_list API fails or when falling back to
  unresolved webhook user_id
- Add 5 tests for user_id resolution (nickname, username, case,
  not-found, URL rewrite)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(synology-chat): use Readable stream in integration test for Windows compat

Replace EventEmitter + process.nextTick with Readable stream for
request body simulation. The process.nextTick approach caused the test
to hang on Windows CI (120s timeout) because events were not reliably
delivered to readBody() listeners.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: harden synology reply user resolution and cache scope (#23709) (thanks @druide67)

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-03-02 19:50:58 +00:00
Peter Steinberger 1c753ea786 test: dedupe fixtures and test harness setup 2026-02-23 05:45:54 +00:00
Peter Steinberger 2c0b72acb8 test: speed up slow media and synology suites 2026-02-22 14:18:44 +00:00
Jean-Marc 03586e3d00 feat(channels): add Synology Chat native channel (#23012)
* feat(channels): add Synology Chat native channel

Webhook-based integration with Synology NAS Chat (DSM 7+).
Supports outgoing webhooks, incoming messages, multi-account,
DM policies, rate limiting, and input sanitization.

- HMAC-based constant-time token validation
- Configurable SSL verification (allowInsecureSsl) for self-signed NAS certs
- 54 unit tests across 5 test suites
- Follows the same ChannelPlugin pattern as LINE/Discord/Telegram

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(synology-chat): add pairing, warnings, messaging, agent hints

- Enable media capability (file_url already supported by client)
- Add pairing.notifyApproval to message approved users
- Add security.collectWarnings for missing token/URL, insecure SSL, open DM policy
- Add messaging.normalizeTarget and targetResolver for user ID resolution
- Add directory stubs (self, listPeers, listGroups)
- Add agentPrompt.messageToolHints with Synology Chat formatting guide
- 63 tests (up from 54), all passing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 00:09:58 +01:00