Commit Graph

13981 Commits

Author SHA1 Message Date
Tak Hoffman ada703a7b4
fix: preserve session cleanup hooks after subagent announce 2026-03-24 11:44:10 -05:00
Tak Hoffman 79ef86c305
fix: preserve cleanup hooks after subagent register failure 2026-03-24 11:32:19 -05:00
Peter Steinberger 49e3f2db06 test: speed up core unit suites 2026-03-24 16:26:58 +00:00
Tak Hoffman 3e9ff16645
fix(discord): avoid bundling pi-ai runtime deps 2026-03-24 11:17:08 -05:00
Peter Steinberger 781295c14b refactor: dedupe test and script helpers 2026-03-24 15:48:35 +00:00
David Guttman 66e954858b
add missing autoArchiveDuration to DiscordGuildChannelConfig type (#43427)
* add missing autoArchiveDuration to DiscordGuildChannelConfig type

The autoArchiveDuration field is present in the Zod schema
(DiscordGuildChannelSchema) and actively used at runtime in
threading.ts and allow-list.ts, but was missing from the
canonical TypeScript type definition.

Add autoArchiveDuration to DiscordGuildChannelConfig to align
the type with the schema and runtime usage.

* Discord: add changelog for config type fix (#43427) (thanks @davidguttman)

---------

Co-authored-by: Onur Solmaz <2453968+osolmaz@users.noreply.github.com>
2026-03-24 16:30:24 +01:00
David Guttman aa91000a5d
feat(discord): add autoThreadName 'generated' strategy (#43366)
* feat(discord): add autoThreadName 'generated' strategy

Adds async thread title generation for auto-created threads:
- autoThread: boolean - enables/disables auto-threading
- autoThreadName: 'message' | 'generated' - naming strategy
- 'generated' uses LLM to create concise 3-6 word titles
- Includes channel name/description context for better titles
- 10s timeout with graceful fallback

* Discord: support non-key auth for generated thread titles

* Discord: skip fallback auto-thread rename

* Discord: normalize generated thread title first content line

* Discord: split thread title generation helpers

* Discord: tidy thread title generation constants and order

* Discord: use runtime fallback model resolution for thread titles

* Discord: resolve thread-title model aliases

* Discord: fallback thread-title model selection to runtime defaults

* Agents: centralize simple completion runtime

* fix(discord): pass apiKey to complete() for thread title generation

The setRuntimeApiKey approach only works for full agent runs that use
authStorage.getApiKey(). The pi-ai complete() function expects apiKey
directly in options or falls back to env vars — it doesn't read from
authStorage.runtimeOverrides.

Fixes thread title generation for Claude/Anthropic users.

* fix(agents): return exchanged Copilot token from prepareSimpleCompletionModel

The recent thread-title fix (3346ba6) passes prepared.auth.apiKey to
complete(). For github-copilot, this was still the raw GitHub token
rather than the exchanged runtime token, causing auth failures.

Now setRuntimeApiKeyForCompletion returns the resolved token and
prepareSimpleCompletionModel includes it in auth.apiKey, so both the
authStorage path and direct apiKey pass-through work correctly.

* fix(agents): catch auth lookup exceptions in completion model prep

getApiKeyForModel can throw for credential issues (missing profile, etc).
Wrap in try/catch to return { error } for fail-soft handling rather than
propagating rejected promises to callers like thread title generation.

* Discord: strip markdown wrappers from generated thread titles

* Discord/agents: align thread-title model and local no-auth completion headers

* Tests: import fresh modules for mocked thread-title/simple-completion suites

* Agents: apply exchanged Copilot baseUrl in simple completions

* Discord: route thread runtime imports through plugin SDK

* Lockfile: add Discord pi-ai runtime dependency

* Lockfile: regenerate Discord pi-ai runtime dependency entries

* Agents: use published Copilot token runtime module

* Discord: refresh config baseline and lockfile

* Tests: split extension runs by isolation

* Discord: add changelog for generated thread titles (#43366) (thanks @davidguttman)

---------

Co-authored-by: Onur Solmaz <onur@textcortex.com>
Co-authored-by: Onur Solmaz <2453968+osolmaz@users.noreply.github.com>
2026-03-24 16:27:19 +01:00
Tak Hoffman 3f99a30163
fix: clean up attachments when replacing subagent runs 2026-03-24 10:21:15 -05:00
Peter Steinberger d884676dd2 test: speed up whatsapp and shared test suites 2026-03-24 15:16:18 +00:00
Tak Hoffman df2f900677
fix: clean up attachments for orphaned subagent runs 2026-03-24 10:05:53 -05:00
Tak Hoffman 938f8f4d83
fix: clean up attachments for released subagent runs 2026-03-24 09:56:20 -05:00
Tak Hoffman 8754d8e330
fix: ci 2026-03-24 09:25:28 -05:00
Sally O'Malley 91adc5e718
feat(cli): support targeting running containerized openclaw instances (#52651)
Signed-off-by: sallyom <somalley@redhat.com>
2026-03-24 10:17:17 -04:00
Tak Hoffman dd11bdd003
fix: clean up attachments for killed subagent runs 2026-03-24 09:14:06 -05:00
Tak Hoffman 807daf54fe
fix: finalize killed delete-mode subagent cleanup 2026-03-24 09:01:55 -05:00
Tak Hoffman d7e48d4883
fix: ci 2026-03-24 08:40:55 -05:00
Neerav Makwana f56a79f838
fix: report qmd status counts from real qmd manager (#53683) (thanks @neeravmakwana)
* fix(memory): report qmd status counts from index

* fix(memory): reuse full qmd manager for status

* fix(memory): harden qmd status manager lifecycle
2026-03-24 19:10:20 +05:30
Tak Hoffman e6e2407cee
fix: initialize plugins before killed subagent hooks 2026-03-24 08:27:50 -05:00
Tak Hoffman b72d0c8459
fix: clean up failed non-thread subagent spawns 2026-03-24 08:26:59 -05:00
Ayaan Zaidi 0a04ef494d fix: merge explicit reply config overrides onto fresh config 2026-03-24 18:52:04 +05:30
Taras Lukavyi ac07d8814a fix(secrets): prevent unresolved SecretRef from crashing embedded agent runs
Root cause: Telegram channel monitor captures config at startup before secrets
are resolved and passes it as configOverride into the reply pipeline. Since
getReplyFromConfig() uses configOverride directly (skipping loadConfig() which
reads the resolved runtime snapshot), the unresolved SecretRef objects propagate
into FollowupRun.run.config and crash runEmbeddedPiAgent().

Fix (defense in depth):
- get-reply.ts: detect unresolved SecretRefs in configOverride and fall back to
  loadConfig() which returns the resolved runtime snapshot
- message-tool.ts: try-catch around schema/description building at tool creation
  time so channel discovery errors don't crash the agent
- message-tool.ts: detect unresolved SecretRefs in pre-bound config at tool
  execution time and fall back to gateway secret resolution

Fixes: https://github.com/openclaw/openclaw/issues/45838
2026-03-24 18:52:04 +05:30
Mariano 922f4e66ea
fix(agents): harden edit tool recovery (#52516)
Merged via squash.

Prepared head SHA: e23bde893a
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky
2026-03-24 13:19:16 +01:00
Peter Steinberger b1b162fcdb test: harden threaded channel follow-ups 2026-03-24 09:24:29 +00:00
Peter Steinberger 43131dcc08 test: harden threaded shared-worker suites 2026-03-24 08:37:00 +00:00
Peter Steinberger e7817ad12a test: continue vitest threads migration 2026-03-24 08:37:00 +00:00
Peter Steinberger 2833b27f52 test: continue vitest threads migration 2026-03-24 08:37:00 +00:00
Val Alexander b61a875d56
fix: widen installer regex allowlists and deduplicate safeExternalHref calls
- SAFE_GO_MODULE: allow uppercase in module paths (A-Z)
- SAFE_BREW_FORMULA: allow @ for versioned formulas (python@3.12)
- SAFE_UV_PACKAGE: allow extras [standard] and equality pins ==
- Cache safeExternalHref result in skills detail API key section
2026-03-24 01:46:33 -05:00
Val Alexander cb58e45130
fix(security): resolve Aisle findings — skill installer validation, terminal sanitization, URL scheme allowlisting (#53471) thanks @BunsDev
Co-authored-by: BunsDev <68980965+BunsDev@users.noreply.github.com>
Co-authored-by: Nova <nova@openknot.ai>
2026-03-24 01:43:48 -05:00
Val Alexander a710366e9e
feat(ui): Control UI polish — skills revamp, markdown preview, agent workspace, macOS config tree (#53411) thanks @BunsDev
Co-authored-by: BunsDev <68980965+BunsDev@users.noreply.github.com>
Co-authored-by: Nova <nova@openknot.ai>
2026-03-24 01:21:13 -05:00
Peter Steinberger ff2e9a52ff fix: preserve deferred TUI history sync (#53130) (thanks @joelnishanth) 2026-03-23 23:18:59 -07:00
joelnishanth cc8ed8d25b fix(tui): preserve user message during slow model responses (#53115)
When a local run ends with an empty final event while another run is active,
skip history reload to prevent clearing the user's pending message from the
chat log. This fixes the 'message disappears' issue with slow models like Ollama.
2026-03-23 23:18:59 -07:00
Tak Hoffman 5e9ea804d4
fix: finalize deferred subagent expiry cleanup 2026-03-24 01:12:54 -05:00
Peter Steinberger 5dc42dfb17 fix: format subagent registry test 2026-03-24 06:10:55 +00:00
Peter Steinberger fd0fa97952
refactor: centralize plugin install config policy 2026-03-23 23:07:40 -07:00
Tak Hoffman c3744fbfc4
fix: finalize resumed subagent cleanup give-ups 2026-03-24 01:06:39 -05:00
Peter Steinberger a2d3b9f317
fix: unblock live harness provider discovery 2026-03-23 23:02:44 -07:00
Tak Hoffman ab8c834aab
fix: report dropped subagent announce queue deliveries 2026-03-24 00:54:46 -05:00
Tak Hoffman 0fc27409c0
fix: preserve direct subagent dispatch failures on abort 2026-03-24 00:47:01 -05:00
Peter Steinberger da10b6026a test: prune low-signal live model sweeps 2026-03-24 05:43:07 +00:00
Tak Hoffman 3689a82494
fix: preserve subagent ended hooks until runtime init 2026-03-24 00:31:48 -05:00
Peter Steinberger 0f84aac487 fix: stabilize matrix and teams ci assertions 2026-03-24 05:29:05 +00:00
Peter Steinberger 013385e5c2
refactor: polish trigger and manifest seams 2026-03-23 22:22:48 -07:00
Tak Hoffman 535b792808
fix: delete subagent runs after announce give-up 2026-03-24 00:20:22 -05:00
Catalin Lupuleti cbb11b3662 fix(plugins): address review feedback for Matrix recovery paths (#52899) 2026-03-23 22:16:10 -07:00
Catalin Lupuleti 489797ceaf fix(plugins): address review feedback for Matrix recovery paths (#52899)
1. Narrow loadConfigForInstall() to catch only INVALID_CONFIG errors,
   letting real failures (fs permission, OOM) propagate.
2. Assert allow array is properly cleaned in stale-cleanup test.
3. Add comment clarifying version-resolution is already addressed via
   the shared VERSION constant.
4. Run cleanStaleMatrixPluginConfig() during install so
   persistPluginInstall() → writeConfigFile() does not fail validation
   on stale Matrix load paths.
2026-03-23 22:16:10 -07:00
Catalin Lupuleti 3ae100a8d7 fix(plugins): make Matrix recovery paths tolerate stale plugin config (#52899) 2026-03-23 22:16:10 -07:00
Peter Steinberger 5c9e4cd30a
refactor: clarify doctor repair flow 2026-03-23 22:12:56 -07:00
Tak Hoffman e8ba55adbb
test: add exact-stem subagent seam tests 2026-03-24 00:09:36 -05:00
Peter Steinberger 2e1c88b728
refactor: tighten embedded prompt and sidecar guards 2026-03-23 22:09:22 -07:00
Sid Uppal cd90130877
msteams: implement Teams AI agent UX best practices (#51808)
Migrates the Teams extension from @microsoft/agents-hosting to the official Teams SDK (@microsoft/teams.apps + @microsoft/teams.api) and implements Microsoft's AI UX best practices for Teams agents.

- AI-generated label on all bot messages (Teams native badge + thumbs up/down)
- Streaming responses in 1:1 chats via Teams streaminfo protocol
- Welcome card with configurable prompt starters on bot install
- Feedback with reflective learning (negative feedback triggers background reflection)
- Typing indicators for personal + group chats (disabled for channels)
- Informative status updates (progress bar while LLM processes)
- JWT validation via Teams SDK createServiceTokenValidator
- User-Agent: teams.ts[apps]/<sdk-version> OpenClaw/<version> on outbound requests
- Fix copy-pasted image downloads (smba.trafficmanager.net auth allowlist)
- Pre-parse auth gate (reject unauthenticated requests before body parsing)
- Reflection dispatcher lifecycle fix (prevent leaked dispatchers)
- Colon-safe session filenames (Windows compatibility)
- Cooldown cache eviction (prevent unbounded memory growth)

Closes #51806
2026-03-23 22:03:39 -07:00
Peter Steinberger ea62655e19 fix: land cron heartbeat prompt suppression (#53152) (thanks @Protocol-zero-0) 2026-03-23 21:55:34 -07:00
Protocol-zero-0 9f863140d5 test(agents): cover additional heartbeat prompt triggers
Document that default-agent heartbeat prompt injection still applies to memory-triggered and triggerless runs while cron remains excluded.

Made-with: Cursor
2026-03-23 21:55:34 -07:00
Protocol-zero-0 9d21be4193 fix(agents): suppress heartbeat prompt for cron-triggered embedded runs
Prevent cron-triggered embedded runs from inheriting the default heartbeat prompt so non-cron session targets stop reading HEARTBEAT.md and polluting scheduled turns.

Made-with: Cursor
2026-03-23 21:55:34 -07:00
Peter Steinberger 5ab3782215 fix: add config clobber forensics 2026-03-24 04:50:30 +00:00
giulio-leone 67c7f98c32 fix(doctor): skip service config repairs during updates
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-23 21:48:18 -07:00
giulio-leone d8aada9d45 Preserve no-restart during update doctor fixes
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-23 21:48:18 -07:00
giulio-leone 3359dcfdcf fix(doctor): honor --fix in non-interactive mode
Ensure repair-mode doctor prompts auto-accept recommended fixes even when running non-interactively, while still requiring --force for aggressive rewrites.

This restores the expected behavior for upgrade/doctor flows that rely on 'openclaw doctor --fix --non-interactive' to repair stale gateway service configuration such as entrypoint drift after global updates.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-23 21:48:18 -07:00
Tak Hoffman 8c89d0e7cd
tests: add boundary coverage for media delivery (#53361)
* tests: add boundary coverage for media delivery

* tests: isolate telegram outbound adapter transport

* tests: harden telegram webhook certificate assertion

* tests: fix guardrail false positives on rebased branch
2026-03-23 23:37:34 -05:00
Peter Steinberger e864421d83 fix: unify live model auth gating 2026-03-24 04:28:53 +00:00
Peter Steinberger e28e520379
refactor: simplify provider inference and zoned parsing helpers 2026-03-23 21:22:30 -07:00
Peter Steinberger 26365f7daf
fix: hash inline scripts with data-src attributes 2026-03-23 21:14:55 -07:00
Peter Steinberger 0857447a5d
fix: reject nonexistent zoned cron at-times 2026-03-23 21:14:55 -07:00
Peter Steinberger 69a317995d
fix: fail closed when provider inference drops errored allowlists 2026-03-23 21:14:55 -07:00
Peter Steinberger dc4d2ca263
build: prepare 2026.3.24 2026-03-23 21:05:59 -07:00
Peter Steinberger ce49d8bca9
fix: verify global npm correction installs 2026-03-23 21:04:08 -07:00
Tak Hoffman 50d996a6ec
tests: cron coverage and NO_REPLY delivery fixes (#53366)
* tools: extend seam audit inventory

* tools: audit cron seam coverage gaps

* test: add cron seam coverage tests

* fix: avoid marking NO_REPLY cron deliveries as delivered

* fix: clean up delete-after-run NO_REPLY cron sessions
2026-03-23 22:52:13 -05:00
Peter Steinberger 483dc90f05 test: harden linux runtime smoke guards 2026-03-24 03:23:52 +00:00
Ayaan Zaidi 17c1ee7716
fix: preserve command auth resolution errors on empty inferred allowlists 2026-03-24 08:38:27 +05:30
Peter Steinberger 38137b0cf8
refactor: split tracked ClawHub update flows 2026-03-23 20:01:51 -07:00
Taras Lukavyi 7ffe7e4822 fix: populate currentThreadTs in threading tool context fallback for Telegram DM topics (#52217)
When a channel plugin lacks a custom buildToolContext (e.g. Telegram),
the fallback path in buildThreadingToolContext did not set currentThreadTs
from the inbound MessageThreadId. This caused resolveTelegramAutoThreadId
to return undefined, so message tool sends without explicit threadId
would route to the main chat instead of the originating DM topic.

Fixes #52217
2026-03-24 08:27:03 +05:30
Peter Steinberger 3ae5d33799
refactor: extract cron schedule and test runner helpers 2026-03-23 19:53:43 -07:00
Taras Lukavyi d4e3babdcc
fix: command auth SecretRef resolution (#52791) (thanks @Lukavyi)
* fix(command-auth): handle unresolved SecretRef in resolveAllowFrom

* fix(command-auth): fall back to config allowlists

* fix(command-auth): avoid duplicate resolution fallback

* fix(command-auth): fail closed on invalid allowlists

* fix(command-auth): isolate fallback resolution errors

* fix: record command auth SecretRef landing notes (#52791) (thanks @Lukavyi)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-03-24 08:21:30 +05:30
Peter Steinberger 0cbf6d5fed fix: land cron tz one-shot handling and prerelease config warnings (#53224) (thanks @RolfHegr) 2026-03-23 19:38:04 -07:00
Rolfy 9aac5582d6 fix(cron): make --tz work with --at for one-shot jobs
Previously, `--at` with an offset-less ISO datetime (e.g. `2026-03-23T23:00:00`)
was always interpreted as UTC, even when `--tz` was provided. This caused one-shot
jobs to fire at the wrong time.

Changes:
- `parseAt()` now accepts an optional `tz` parameter
- When `--tz` is provided with `--at`, offset-less datetimes are interpreted in
  that IANA timezone using Intl.DateTimeFormat
- Datetimes with explicit offsets (e.g. `+01:00`, `Z`) are unaffected
- Removed the guard in cron-edit that blocked `--tz` with `--at`
- Updated `--at` help text to mention `--tz` support
- Added 2 tests verifying timezone resolution and offset preservation
2026-03-23 19:38:04 -07:00
Peter Steinberger 7f373823b0
refactor: separate exec policy and execution targets 2026-03-23 19:36:44 -07:00
Val Alexander a96eded4a0
feat(csp): support inline script hashes in Control UI CSP (#53307) thanks @BunsDev
Co-authored-by: BunsDev <68980965+BunsDev@users.noreply.github.com>
Co-authored-by: Nova <nova@openknot.ai>
2026-03-23 21:35:33 -05:00
Peter Steinberger e530865274 fix: preserve legacy clawhub skill updates (#53206) (thanks @drobison00) 2026-03-23 19:34:05 -07:00
Devin Robison 003752b9b3 Remove lower casing -- preserving prior behavior 2026-03-23 19:34:05 -07:00
Devin Robison a339d706c1 Formatting fixes and remove trailing dash acceptance 2026-03-23 19:34:05 -07:00
Devin Robison 40071ea23e fix: tighten skill slug validation to ASCII-only 2026-03-23 19:34:05 -07:00
Peter Steinberger 462a7a9ae6 test: allow realpath in shell planner assertions 2026-03-24 02:15:14 +00:00
Peter Steinberger d8cef14eb1 fix: split exec and policy resolution for wrapper trust (#53134) (thanks @vincentkoc) 2026-03-23 19:04:04 -07:00
Peter Steinberger 21d480ed92 fix(infra): preserve blocked dispatch policy target
# Conflicts:
#	CHANGELOG.md
2026-03-23 19:04:04 -07:00
Vincent Koc 32e89b4687 Infra: preserve wrapper executable for multiplexer trust 2026-03-23 19:04:04 -07:00
Peter Steinberger 2d5f822ca1 fix: warn on same-base prerelease configs 2026-03-24 02:02:31 +00:00
Peter Steinberger 85ed1a8986
refactor: clean up ClawHub compatibility validation 2026-03-23 18:52:37 -07:00
Peter Steinberger 5b4fd6bf31 fix: use runtime version for ClawHub plugin API checks (#53157) (thanks @futhgar) 2026-03-23 18:41:18 -07:00
futhgar 447e074bf4 fix(plugins): use runtime version for plugin API compatibility check
OPENCLAW_PLUGIN_API_VERSION was hardcoded to "1.2.0" while ClawHub-published
plugins require >=2026.3.22, making all plugin installs via ClawHub fail with
"requires plugin API >=2026.3.22, but this OpenClaw runtime exposes 1.2.0".

Use resolveRuntimeServiceVersion() (already imported) to read the actual
version from package.json at runtime.

Fixes #53038
2026-03-23 18:41:18 -07:00
Peter Steinberger d25ad66069
fix: resolve catalog-backed channel login 2026-03-23 18:25:44 -07:00
Peter Steinberger 69390daa51
test: cover config correction version warnings 2026-03-23 18:23:50 -07:00
Peter Steinberger b4bda479a4
fix: normalize bundled plugin version reporting 2026-03-23 18:23:50 -07:00
Peter Steinberger e9905fd696 fix: avoid fd warnings in lock exit cleanup 2026-03-24 01:01:59 +00:00
Val Alexander 6c44b2ea50
fix(cli): guard channel-auth against prototype-chain pollution and control-char injection
- Use hasOwnProperty + isBlockedObjectKey in isConfiguredAuthPlugin to
  prevent __proto__/constructor/prototype keys from matching config
- Sanitize plugin IDs with sanitizeForLog in ambiguity error messages
- Add regression test for __proto__ plugin ID
2026-03-23 19:58:16 -05:00
Val Alexander c8f4b8533d
fix(cli): auto-select login-capable auth channels (#53254) thanks @BunsDev
Co-authored-by: BunsDev <68980965+BunsDev@users.noreply.github.com>
Co-authored-by: Nova <nova@openknot.ai>
2026-03-23 19:54:46 -05:00
Peter Steinberger 00d586b2ce test: reduce flaky gemini live probe coverage 2026-03-24 00:40:17 +00:00
Peter Steinberger dc02a7520f test: stabilize moonshot and minimax live probes 2026-03-24 00:40:17 +00:00
Peter Steinberger 9334015262
fix: ship bundled plugin runtime sidecars 2026-03-23 17:38:08 -07:00
Peter Steinberger ce75f60ae9
fix: canonicalize malformed assistant replay content 2026-03-23 17:37:51 -07:00
Peter Steinberger 90fab48416 ci: stabilize sharded channel lanes 2026-03-24 00:21:50 +00:00
Peter Steinberger a921b5bdff test: fix update-cli default path assertion 2026-03-23 23:05:25 +00:00