Commit Graph

5831 Commits

Author SHA1 Message Date
Devin Robison
90979d7c3e fix(feishu): resolve card-action chat type before dispatch (#68201)
* fix(feishu): resolve card-action chat type before dispatch

* changelog: resolve card-action chat type before dispatch (#68201)

* address review: prefer chat_mode over chat_type, add error-path tests

- Swap resolution order to check chat_mode (conversation type) before
  chat_type (privacy classification), since Feishu's chat_type can
  return "private" for private group chats which would be wrongly
  classified as p2p.
- Treat "topic" as group semantics in the normalizer.
- Add comment explaining the field semantics and why "private" maps
  to "p2p" (safe-failure direction).
- Add two error-path tests: API returns non-zero code, and API throws.

* map chat_type=public to group in normalizer

Feishu's chat_type can return "public" for public group chats.
Without this mapping the fallback resolver would miss it and default
to p2p, routing a group card action through DM handling.

* address Aisle: cache chat-type lookups and scrub log output

- Add a 30-minute TTL cache for chatId -> chatType so repeated card
  actions on the same chat skip the Feishu API call.
- Strip chatId, event.token, and raw error strings from log messages;
  use err.message instead of String(err) to avoid leaking stack traces
  or HTTP internals from the Feishu SDK.

* prune expired chat-type cache entries

Add pruneChatTypeCache() called on each lookup so expired entries are
evicted and the cache stays bounded in long-running processes.

* address Aisle: scope cache by account, cap size, sanitize logs

- Key cache by accountId:chatId to prevent cross-account contamination.
- Cap cache at 5000 entries and evict oldest when exceeded.
- Sanitize response.msg and err.message with CR/LF stripping and
  length cap before logging to prevent log injection.
2026-04-17 12:29:04 -06:00
Gustavo Madeira Santana
3a1e469732 QA: track scenario coverage intent 2026-04-17 14:05:49 -04:00
Gustavo Madeira Santana
f334ca2b50 Auto-reply: fast-path sandbox media root resolution 2026-04-17 14:05:49 -04:00
Gustavo Madeira Santana
6184f17c91 Twitch: add bundled setup entry (#68008)
Merged via squash.

Prepared head SHA: 59305356a0
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-04-17 13:49:08 -04:00
Gustavo Madeira Santana
a464f5926b Secrets: avoid broad web search discovery for single plugin config
Add an Exa web-search contract artifact and use single bundled plugin-scoped webSearch config as a provider hint. This keeps runtime secret resolution on metadata-only surfaces instead of importing full provider tool implementations.
2026-04-17 13:38:24 -04:00
Peter Steinberger
0747a9c85a test(discord): isolate debug proxy env 2026-04-17 18:35:06 +01:00
Peter Steinberger
8c249a8cca fix(matrix): keep guarded transport mockable 2026-04-17 17:44:11 +01:00
Peter Steinberger
7815d25eef fix: keep Matrix transport tests on mocked fetch 2026-04-17 17:33:34 +01:00
Peter Steinberger
8caad53f57 test(matrix): mock runtime fetch seam 2026-04-17 17:33:01 +01:00
Peter Steinberger
769198e67e perf: skip Matrix secret resolver for plain credentials 2026-04-17 17:31:00 +01:00
Peter Steinberger
41ef752dd8 fix(extensions): guard channel runtime fetches 2026-04-17 17:28:21 +01:00
Peter Steinberger
c580933623 test: shorten Matrix thread binding waits 2026-04-17 17:26:46 +01:00
Peter Steinberger
b9d5c1a58b test: narrow Matrix storage path test imports 2026-04-17 17:24:01 +01:00
Peter Steinberger
79cd5ed368 test: split Matrix client config tests 2026-04-17 17:16:21 +01:00
Peter Steinberger
54d9a09912 perf: narrow Matrix monitor reply imports 2026-04-17 17:14:44 +01:00
Peter Steinberger
73d8d3b2eb test: remove duplicate Matrix runtime API check 2026-04-17 17:08:37 +01:00
Peter Steinberger
d851f9e816 perf: narrow Matrix thread binding runtime imports 2026-04-17 17:04:31 +01:00
Peter Steinberger
d7f9f67296 perf: narrow Matrix onboarding resolution test 2026-04-17 16:58:19 +01:00
Peter Steinberger
14c4d6457a perf: narrow Matrix account runtime imports 2026-04-17 16:53:46 +01:00
Gustavo Madeira Santana
d6c90b5af1 Tests: avoid memory-search cold plugin loads 2026-04-17 11:37:46 -04:00
Peter Steinberger
2535331e94 perf: remove Matrix test polling 2026-04-17 16:32:57 +01:00
Peter Steinberger
acace04c35 perf: remove Matrix auth retry waits in tests 2026-04-17 16:30:04 +01:00
Chunyue Wang
0b3d876e74 fix(codex): prevent gateway crash when app-server subprocess terminates abruptly (#67947)
Fixes openclaw#67886. Handles stdin EPIPE in CodexAppServerClient by attaching an error handler, guarding writeMessage against writes after close, and aligning closeWithError cleanup with close.
2026-04-17 23:28:37 +08:00
Peter Steinberger
d565c2cc34 perf: add lightweight secret input runtime 2026-04-17 16:28:15 +01:00
Peter Steinberger
5f3bb53788 perf: skip missing Matrix IDB snapshot locks 2026-04-17 16:24:29 +01:00
Peter Steinberger
a954e2fb46 perf: narrow Matrix thread binding test imports 2026-04-17 16:21:48 +01:00
Peter Steinberger
b2b835fb18 perf: reduce Matrix monitor wait polling 2026-04-17 16:19:29 +01:00
Peter Steinberger
4d7d14cfa7 perf: flush Matrix event tests deterministically 2026-04-17 16:18:27 +01:00
Peter Steinberger
bac3d26fe7 perf: narrow Matrix reaction approval imports 2026-04-17 16:17:01 +01:00
Peter Steinberger
2a0a498b0d perf: speed Matrix handler tests 2026-04-17 16:14:28 +01:00
Peter Steinberger
3b81bf4c7c perf: narrow Matrix handler session store import 2026-04-17 16:09:10 +01:00
Peter Steinberger
40c9da1d57 perf: avoid Matrix entry full-channel load in tests 2026-04-17 16:06:26 +01:00
Peter Steinberger
af954a81d1 perf: optimize bundled extension tests 2026-04-17 16:05:09 +01:00
Peter Steinberger
605cb60586 perf: optimize Matrix test boundaries 2026-04-17 16:05:09 +01:00
Gustavo Madeira Santana
82fe6f50ef QA: organize scenarios by theme 2026-04-17 11:03:47 -04:00
Gustavo Madeira Santana
54e4e16844 Tests: narrow session binding contract setup 2026-04-17 03:36:13 -04:00
Gustavo Madeira Santana
89706d323c Docs: add test performance guardrails 2026-04-17 02:23:49 -04:00
EE
1ce2596195 matrix: fix sessions_spawn --thread subagent session spawning (#67643)
Merged via squash.

Prepared head SHA: 1e5127e217
Co-authored-by: eejohnso-ops <238848106+eejohnso-ops@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-04-17 02:17:56 -04:00
Peter Steinberger
5817a76236 test: merge browser contract server suites 2026-04-17 07:15:27 +01:00
Peter Steinberger
daaebb8558 test: split browser snapshot target helper 2026-04-17 07:15:27 +01:00
Peter Steinberger
132d3c76a0 test: reuse browser server harness imports 2026-04-17 07:15:27 +01:00
Peter Steinberger
35dcd06764 test: trim agent test hotspots 2026-04-17 07:15:27 +01:00
Gustavo Madeira Santana
7ae670e501 Tests: fast-path Slack message tool discovery 2026-04-17 02:00:26 -04:00
Gustavo Madeira Santana
878f2122e5 Tests: fast-path Matrix ACP thread binding 2026-04-17 02:00:26 -04:00
Gustavo Madeira Santana
807c6648f9 Tests: fast-path gateway auth bypass discovery 2026-04-17 02:00:26 -04:00
Ayaan Zaidi
26f7198eda fix(memory-core): preserve vector dims on readonly recovery 2026-04-17 11:22:56 +05:30
Ayaan Zaidi
5aad79571e fix(telegram): clear compaction replay after visible boundaries 2026-04-17 11:18:22 +05:30
Rubén Cuevas
7b0e950e09 fix: dedupe degraded sqlite-vec warnings (#67898) (thanks @rubencu)
* Agents: dedupe bootstrap truncation warnings

* Memory: dedupe sqlite-vec degradation warnings

* Memory: align degraded vector warning

* test(memory-core): remove stale vector warning arg

* fix(memory-core): reset degraded warning on vector reset

* fix(memory-core): preserve warning latch across reindex rollback

* fix: dedupe degraded sqlite-vec warnings (#67898) (thanks @rubencu)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-04-17 11:09:14 +05:30
Chinar Amrutkar
8205de84a9 fix: clear stale telegram ACP bindings on startup (#67822) (thanks @chinar-amrutkar)
* fix(telegram): clean up thread bindings to stale/failed ACP sessions on startup

When loading persisted thread bindings on manager creation, validate each
ACP session against the session store. Remove bindings where:
- Session entry doesn't exist (deleted externally)
- Session status is failed/killed/timeout
- ACP runtime state is 'error'

This addresses issue #60102 where Telegram DMs remained routed to stale
ACP sessions even after restart, because the binding file persisted
across restarts without validating the target session was still valid.

* fix(telegram): guard against null session entry and transient store read failures

Address review comments on PR #67822:

1. Skip bindings when readAcpSessionEntry returns null or when
   session store is temporarily unreadable (storeReadFailed: true).
   Without this, a transient I/O error would mark all ACP bindings
   as stale and delete them on every startup.

2. Only set needsPersist when bindings were actually removed.
   Previously, stale session keys from OTHER accounts could set
   needsPersist=true even when zero bindings were removed for
   the current account — causing spurious disk writes.

Also clean up redundant optional chaining on entry.status now
that we guard against undefined/nullable sessionEntry.

* perf(telegram): dedupe ACP session reads in startup cleanup

Cache readAcpSessionEntry calls by targetSessionKey. Multiple bindings
to the same ACP session now result in a single session store read instead
of one read per binding.

Addresses chatgpt-codex-connector P2 review comment on PR #67822.

* fix(telegram): skip non-ACP session keys in stale binding cleanup

Address chatgpt-codex-connector P1 review comment on PR #67822:

Plugin-bound Telegram conversations use "plugin-binding:*" keys
with targetKind === "acp", but these are NOT ACP runtime sessions.
readAcpSessionEntry() returns no entry for them, so !sessionEntry.entry
would classify them as stale and delete them on every startup.

Now checks isAcpSessionKey(binding.targetSessionKey) to skip plugin-bound
sessions from the stale session cleanup scan.

Also clarifies the comment to explain why we use targetKind === "acp"
// together with isAcpSessionKey() check.

* fix(telegram): import isAcpSessionKey from sessions/session-key-utils

isAcpSessionKey is not re-exported from openclaw/plugin-sdk/routing.
Fix import to use the correct subpath: openclaw/sessions/session-key-utils.

Addresses chatgpt-codex-connector P1 review comment on PR #67822.

* fix(telegram): import from relative path, remove unused variable

- Import isAcpSessionKey from relative path ../../sessions/session-key-utils.js
  (not openclaw/sessions/session-key-utils which doesn't exist)
- Remove unused 'bindings' variable in for-of loop

Addresses CI failures on PR #67822.

* fix(telegram): export isAcpSessionKey from plugin-sdk/routing

isAcpSessionKey lives in src/routing/session-key.ts, which is already
exported via openclaw/plugin-sdk/routing. Re-export it from routing.ts
so extensions can import via the public plugin-sdk path.

Fixes chatgpt-codex-connector P1: relative path ../../sessions/session-key-utils.js
doesn't exist in the build output, making the Telegram extension fail
module resolution before startup cleanup can run.

* test(telegram): cover startup ACP binding cleanup

* fix: clear stale telegram ACP bindings on startup (#67822) (thanks @chinar-amrutkar)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-04-17 11:03:36 +05:30
Rubén Cuevas
c65f356ddc fix: keep telegram transient preview across compaction retry (#66939) (thanks @rubencu)
* fix(telegram): keep transient previews across compaction

* test(telegram): cover suppressed approval previews after compaction

* fix(telegram): preserve delayed message-start boundaries

* fix: keep telegram transient preview across compaction retry (#66939) (thanks @rubencu)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-04-17 10:57:46 +05:30