mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-22 06:52:07 +08:00
Compare commits
1 Commits
shadow/a2u
...
codex/fix-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ace3068fe3 |
@@ -29,13 +29,7 @@ Use this skill for Parallels guest workflows and smoke interpretation. Do not lo
|
||||
## npm install then update
|
||||
|
||||
- Preferred entrypoint: `pnpm test:parallels:npm-update`
|
||||
- Required coverage: every release/update regression run must include both lanes:
|
||||
- fresh snapshot -> install requested package/baseline -> smoke
|
||||
- same guest baseline -> run the guest's installed `openclaw update ...` command -> smoke again
|
||||
- The update lane must exercise OpenClaw's internal updater. Do not count a direct `npm install -g <tgz-or-spec>` or harness-side package swap as update-flow coverage; those are install smokes only.
|
||||
- For published targets, install the old baseline package first (for example `openclaw@2026.4.9`), then run the installed guest CLI with the intended channel/tag (for example `openclaw update --channel beta --yes --json`) and verify `openclaw --version`, `openclaw update status --json`, gateway RPC, and an agent turn after the command.
|
||||
- For unpublished targets, pack the candidate on the host, serve the `.tgz` over the harness HTTP server, and point the guest updater at that served package. Prefer `openclaw update --tag http://<host-ip>:<port>/openclaw-<version>.tgz --yes --json`; when channel persistence also matters, pass `--channel <stable|beta>` and set `OPENCLAW_UPDATE_PACKAGE_SPEC` to the same served URL in the guest update environment. The command under test must still be `openclaw update`, not direct npm.
|
||||
- For unpublished local-fix validation, remember the old baseline updater code still controls the first hop. A fix that lives only in the new updater code cannot change that already-running old process; the served candidate must either keep package/plugin metadata compatible with the baseline host or the baseline itself must include the updater fix.
|
||||
- Flow: fresh snapshot -> install npm package baseline -> smoke -> install current main tgz on the same guest -> smoke again.
|
||||
- For beta/stable verification, resolve the tag immediately before the run (`npm view openclaw@beta version dist.tarball` or `npm view openclaw@latest ...`). Tags can move while a long VM matrix is already running; restart the matrix when the intended prerelease appears after an earlier registry 404/tag-lag check.
|
||||
- Source Peter's profile in the host shell (`set -a; source "$HOME/.profile"; set +a`) before OpenAI/Anthropic lanes. Do not print profile contents or env dumps; pass provider secrets through the guest exec environment.
|
||||
- Same-guest update verification should set the default model explicitly to `openai/gpt-5.4` before the agent turn and use a fresh explicit `--session-id` so old session model state does not leak into the check.
|
||||
|
||||
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -694,7 +694,7 @@ jobs:
|
||||
EOF
|
||||
|
||||
checks-node-core-test:
|
||||
name: checks-node-core
|
||||
name: checks-node-core-test
|
||||
needs: [preflight, checks-node-core-test-shard]
|
||||
if: always() && needs.preflight.outputs.run_checks == 'true'
|
||||
runs-on: blacksmith-16vcpu-ubuntu-2404
|
||||
|
||||
7
.github/workflows/install-smoke.yml
vendored
7
.github/workflows/install-smoke.yml
vendored
@@ -194,13 +194,6 @@ jobs:
|
||||
push: false
|
||||
provenance: false
|
||||
|
||||
- name: Setup Node environment for local pack smoke
|
||||
uses: ./.github/actions/setup-node-env
|
||||
with:
|
||||
install-bun: "false"
|
||||
install-deps: "true"
|
||||
use-sticky-disk: "false"
|
||||
|
||||
- name: Run installer docker tests
|
||||
env:
|
||||
OPENCLAW_INSTALL_URL: https://openclaw.ai/install.sh
|
||||
|
||||
1
.github/workflows/openclaw-npm-release.yml
vendored
1
.github/workflows/openclaw-npm-release.yml
vendored
@@ -493,7 +493,6 @@ jobs:
|
||||
RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
printf '//registry.npmjs.org/:_authToken=%s\n' "${NODE_AUTH_TOKEN}" > "${HOME}/.npmrc"
|
||||
npm whoami >/dev/null
|
||||
npm dist-tag add "openclaw@${RELEASE_VERSION}" latest
|
||||
promoted_latest="$(npm view openclaw dist-tags.latest)"
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
"pnpm-lock.yaml/",
|
||||
"src/gateway/server-methods/CLAUDE.md",
|
||||
"src/auto-reply/reply/export-html/",
|
||||
"src/canvas-host/a2ui/a2ui.bundle.js",
|
||||
"Swabble/",
|
||||
"vendor/",
|
||||
],
|
||||
|
||||
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -17,5 +17,6 @@
|
||||
"typescript.preferences.importModuleSpecifierEnding": "js",
|
||||
"typescript.reportStyleChecksAsWarnings": false,
|
||||
"typescript.updateImportsOnFileMove.enabled": "always",
|
||||
"typescript.tsdk": "node_modules/typescript/lib"
|
||||
"typescript.tsdk": "node_modules/typescript/lib",
|
||||
"typescript.experimental.useTsgo": true
|
||||
}
|
||||
|
||||
58
CHANGELOG.md
58
CHANGELOG.md
@@ -8,44 +8,6 @@ Docs: https://docs.openclaw.ai
|
||||
|
||||
### Fixes
|
||||
|
||||
- Memory/active-memory+dreaming: keep active-memory recall runs on the strongest resolved channel, consume managed dreaming heartbeat events exactly once, stop dreaming from re-ingesting its own narrative transcripts, and add explicit repair/dedupe recovery flows in CLI, doctor, and the Dreams UI.
|
||||
- Matrix/mentions: keep room mention gating strict while accepting visible `@displayName` Matrix URI labels, so `requireMention` works for non-OpenClaw Matrix clients again. (#64796) Thanks @hclsys.
|
||||
- Doctor: warn when on-disk agent directories still exist under `~/.openclaw/agents/<id>/agent` but the matching `agents.list[]` entries are missing from config. (#65113) Thanks @neeravmakwana.
|
||||
- Telegram: route approval button callback queries onto a separate sequentializer lane so plugin approval clicks can resolve immediately instead of deadlocking behind the blocked agent turn. (#64979) Thanks @nk3750.
|
||||
|
||||
## 2026.4.11
|
||||
|
||||
### Changes
|
||||
|
||||
- Dreaming/memory-wiki: add ChatGPT import ingestion plus new `Imported Insights` and `Memory Palace` diary subtabs so Dreaming can inspect imported source chats, compiled wiki pages, and full source pages directly from the UI. (#64505)
|
||||
- Control UI/webchat: render assistant media/reply/voice directives as structured chat bubbles, add the `[embed ...]` rich output tag, and gate external embed URLs behind config. (#64104)
|
||||
- Tools/video_generate: add URL-only generated asset delivery, typed `providerOptions`, reference audio inputs, per-asset role hints, `adaptive` aspect-ratio support, and a higher image-input cap so video providers can expose richer generation modes without forcing large files into memory. (#61987, #61988) Thanks @xieyongliang.
|
||||
- Feishu: improve document comment sessions with richer context parsing, comment reactions, and typing feedback so document-thread conversations behave more like chat conversations. (#63785)
|
||||
- Microsoft Teams: add reaction support, reaction listing, Graph pagination, and delegated OAuth setup for sending reactions while preserving application-auth read paths. (#51646)
|
||||
- Plugins: allow plugin manifests to declare activation and setup descriptors so plugin setup flows can describe required auth, pairing, and configuration steps without hardcoded core special cases. (#64780)
|
||||
- Ollama: cache `/api/show` context-window and capability metadata during model discovery so repeated picker refreshes stop refetching unchanged models, while still retrying after empty responses and invalidating on digest changes. (#64753) Thanks @ImLukeF.
|
||||
- Models/providers: surface how configured OpenAI-compatible endpoints are classified in embedded-agent debug logs, so local and proxy routing issues are easier to diagnose. (#64754) Thanks @ImLukeF.
|
||||
- QA/parity: add the GPT-5.4 vs Opus 4.6 agentic parity report gate with shared scenario coverage checks, stricter evidence heuristics, and skipped-scenario accounting for maintainer review. (#64441) Thanks @100yenadmin.
|
||||
|
||||
### Fixes
|
||||
|
||||
- OpenAI/Codex OAuth: stop rewriting the upstream authorize URL scopes so new Codex sign-ins do not fail with `invalid_scope` before returning an authorization code. (#64713) Thanks @fuller-stack-dev.
|
||||
- Audio transcription: disable pinned DNS only for OpenAI-compatible multipart requests, while still validating hostnames, so OpenAI, Groq, and Mistral transcription works again without weakening other request paths. (#64766) Thanks @GodsBoy.
|
||||
- macOS/Talk Mode: after granting microphone permission on first enable, continue starting Talk Mode instead of requiring a second toggle. (#62459) Thanks @ggarber.
|
||||
- Control UI/webchat: persist agent-run TTS audio replies into webchat history and preserve interleaved tool card pairing so generated audio and mixed tool output stay attached to the right messages. (#63514) Thanks @bittoby.
|
||||
- WhatsApp: honor the configured default account when the active listener helper is used without an explicit account id, so named default accounts do not get registered under `default`. (#53918) Thanks @yhyatt.
|
||||
- ACP/agents: suppress commentary-phase child assistant relay text in ACP parent stream updates, so spawned child runs stop leaking internal progress chatter into the parent session. Thanks @vincentkoc.
|
||||
- Agents/timeouts: honor explicit run timeouts in the LLM idle watchdog and align default timeout config so slow models can keep working until the configured limit instead of using the wrong idle window.
|
||||
- Config: include `asyncCompletion` in the generated zod schema so documented async completion config no longer fails with an unrecognized-key error. (#63618)
|
||||
- Google/Veo: stop sending the unsupported `numberOfVideos` request field so Gemini Developer API Veo runs do not fail before OpenClaw can complete the intended Google video generation path. (#64723) Thanks @velvet-shark.
|
||||
- QA/packaging: stop packaged CLI startup and completion cache generation from reading repo-only QA scenario markdown, ship the bundled QA scenario pack in npm releases, and keep `openclaw completion --write-state` working even if QA setup is broken. (#64648) Thanks @obviyus.
|
||||
- Codex/QA: keep Codex app-server coordination chatter out of visible replies, add a live QA leak scenario, and classify leaked harness meta text as a QA failure instead of a successful reply. Thanks @vincentkoc.
|
||||
- WhatsApp: route `message react` through the gateway-owned action path so reactions use the live WhatsApp listener in both DM and group chats, matching `message send` and `message poll`. Thanks @mcaxtr.
|
||||
- Auto-reply/WhatsApp: preserve inbound image attachment notes after media understanding so image edits keep the real saved media path instead of hallucinating a missing local path. (#64918) Thanks @ngutman.
|
||||
- Telegram/sessions: keep topic-scoped session initialization on the canonical topic transcript path when inbound turns omit `MessageThreadId`, so one topic session no longer alternates between bare and topic-qualified transcript files. (#64869) Thanks @jalehman.
|
||||
- Agents/failover: scope assistant-side fallback classification and surfaced provider errors to the current attempt instead of stale session history, so cross-provider fallback runs stop inheriting the previous provider's failure. (#62907) Thanks @stainlu.
|
||||
- MiniMax/OAuth: write `api: "anthropic-messages"` and `authHeader: true` into the `minimax-portal` config patch during `openclaw configure`, so re-authenticated portal setups keep Bearer auth routing working. (#64964) Thanks @ryanlee666.
|
||||
|
||||
## 2026.4.10
|
||||
|
||||
### Changes
|
||||
@@ -62,14 +24,11 @@ Docs: https://docs.openclaw.ai
|
||||
- Gateway: add a `commands.list` RPC so remote gateway clients can discover runtime-native, text, skill, and plugin commands with surface-aware naming and serialized argument metadata. (#62656) Thanks @samzong.
|
||||
- Models/providers: add per-provider `models.providers.*.request.allowPrivateNetwork` for trusted self-hosted OpenAI-compatible endpoints, keep the opt-in scoped to model request surfaces, and refresh cached WebSocket managers when request transport overrides change. (#63671) Thanks @qas.
|
||||
- Feishu: standardize request user agents and register the bot as an AI agent so Feishu deployments identify OpenClaw consistently. (#63835) Thanks @evandance.
|
||||
- Docs i18n: chunk raw doc translation, reject truncated tagged outputs, avoid ambiguous body-only wrapper unwrapping, and recover from terminated Pi translation sessions without changing the default `openai/gpt-5.4` path. (#62969, #63808) Thanks @hxy91819.
|
||||
- Gateway: split startup and runtime seams so gateway lifecycle sequencing, reload state, and shutdown behavior stay easier to maintain without changing observed behavior. (#63975) Thanks @gumadeiras.
|
||||
- Control UI/webchat: normalize assistant `MEDIA:`/reply/voice directives into structured bubble rendering, rename the unreleased rich web shortcode to `[embed ...]`, and surface session runtime roots so hosted web content is written to the correct document path instead of guessed local files.
|
||||
- Matrix/partial streaming: add MSC4357 live markers to draft preview sends and edits so supporting Matrix clients can render a live/typewriter animation and stop it when the final edit lands. (#63513) Thanks @TigerInYourDream.
|
||||
- Control UI/dreaming: simplify the Scene and Diary surfaces, preserve unknown phase state for partial status payloads, and stabilize waiting-entry recency ordering so Dreaming status and review lists stay clear and deterministic. (#64035) Thanks @davemorin.
|
||||
- Agents: add an opt-in strict-agentic embedded Pi execution contract for GPT-5-family runs so plan-only or filler turns keep acting until they hit a real blocker. (#64241) Thanks @100yenadmin.
|
||||
- Agents/OpenAI: add provider-owned OpenAI/Codex tool schema compatibility and surface embedded-run replay/liveness state for long-running runs. (#64300) Thanks @100yenadmin.
|
||||
- Dreaming/memory-wiki: add ChatGPT import ingestion plus new `Imported Insights` and `Memory Palace` diary subtabs so Dreaming can inspect imported source chats, compiled wiki pages, and full source pages directly from the UI. (#64505)
|
||||
- Docs i18n: chunk raw doc translation, reject truncated tagged outputs, avoid ambiguous body-only wrapper unwrapping, and recover from terminated Pi translation sessions without changing the default `openai/gpt-5.4` path. (#62969, #63808) Thanks @hxy91819.
|
||||
|
||||
### Fixes
|
||||
|
||||
@@ -156,20 +115,12 @@ Docs: https://docs.openclaw.ai
|
||||
- Daemon/gateway: prevent systemd restart storms on configuration errors by exiting with `EX_CONFIG` and adding generated unit restart-prevention guards. (#63913) Thanks @neo1027144-creator.
|
||||
- Agents/exec: prevent gateway crash ("Agent listener invoked outside active run") when a subagent exec tool produces stdout/stderr after the agent run has ended or been aborted. (#62821) Thanks @openperf.
|
||||
- Gateway/OpenAI compat: return real `usage` for non-stream `/v1/chat/completions` responses, emit the final usage chunk when `stream_options.include_usage=true`, and bound usage-gated stream finalization after lifecycle end. (#62986) Thanks @Lellansin.
|
||||
- Matrix/migration: keep packaged warning-only crypto migrations from being misclassified as actionable when only helper chunks are present, so startup and doctor stay on the warning-only path instead of creating unnecessary migration snapshots. (#64373) Thanks @gumadeiras.
|
||||
- Matrix/ACP thread bindings: preserve canonical room casing and parent conversation routing during ACP session spawn so mixed-case room ids bind correctly from top-level rooms and existing Matrix threads. (#64343) Thanks @gumadeiras.
|
||||
- Agents/subagents: deduplicate delivered completion announces so retry or re-entry cleanup does not inject duplicate internal-context completion turns into the parent session. (#61525) Thanks @100yenadmin.
|
||||
- Agents/exec: keep sandboxed `tools.exec.host=auto` sessions from honoring per-call `host=node` or `host=gateway` overrides while a sandbox runtime is active, and stop advertising node routing in that state so exec stays on the sandbox host. (#63880)
|
||||
- Agents/subagents: preserve archived delete-mode runs until `sessions.delete` succeeds and prevent overlapping archive sweeps from duplicating in-flight cleanup attempts. (#61801) Thanks @100yenadmin.
|
||||
- Cron/isolated agent: run scheduled agent turns as non-owner senders so owner-only tools stay unavailable during cron execution. (#63878)
|
||||
- Discord/sandbox: include `image` in sandbox media param normalization so Discord event cover images cannot bypass sandbox path rewriting. (#64377) Thanks @mmaps.
|
||||
- Agents/exec: extend exec completion detection to cover local background exec formats so the owner-downgrade fires correctly for all exec paths. (#64376) Thanks @mmaps.
|
||||
- Security/dependencies: pin axios to 1.15.0 and add a plugin install dependency denylist that blocks known malicious packages before install. (#63891) Thanks @mmaps.
|
||||
- Browser/security: apply three-phase interaction navigation guard to pressKey and type(submit) so delayed JS redirects from keypress cannot bypass SSRF policy. (#63889) Thanks @mmaps.
|
||||
|
||||
- Browser/security: guard existing-session Chrome MCP interaction routes with SSRF post-checks so delayed navigation from click, type, press, and evaluate cannot bypass the configured policy. (#64370) Thanks @eleqtrizit.
|
||||
- Browser/security: default browser SSRF policy to strict mode so unconfigured installs block private-network navigation, and align external-content marker span mapping so ZWS-injected boundary spoofs are fully sanitized. (#63885) Thanks @eleqtrizit.
|
||||
- Browser/security: apply SSRF navigation policy to subframe document navigations so iframe-targeted private-network hops are blocked without quarantining the parent page. (#64371) Thanks @eleqtrizit.
|
||||
- Hooks/security: mark agent hook system events as untrusted and sanitize hook display names before cron metadata reuse. (#64372) Thanks @eleqtrizit.
|
||||
- Daemon/launchd: keep `openclaw gateway stop` persistent without uninstalling the macOS LaunchAgent, re-enable it on explicit restart or repair, and harden launchd label handling. (#64447) Thanks @ngutman.
|
||||
- Plugins/context engines: preserve `plugins.slots.contextEngine` through normalization and keep explicitly selected workspace context-engine plugins enabled, so loader diagnostics and plugin activation stop dropping that slot selection. (#64192) Thanks @hclsys.
|
||||
@@ -180,9 +131,6 @@ Docs: https://docs.openclaw.ai
|
||||
- Media/security: honor sender-scoped `toolsBySender` policy for outbound host-media reads so denied senders cannot trigger host file disclosure via attachment hydration. (#64459) Thanks @eleqtrizit.
|
||||
- Browser/security: reject strict-policy hostname navigation unless the hostname is an explicit allowlist exception or IP literal, and route CDP HTTP discovery through the pinned SSRF fetch path. (#64367) Thanks @eleqtrizit.
|
||||
- Models/vLLM: ignore empty `tool_calls` arrays from reasoning-model OpenAI-compatible replies, reset false `toolUse` stop reasons when no actual tool calls were parsed, and stop sending `tool_choice` unless tools are present so vLLM reasoning responses no longer hang indefinitely. (#61197, #61534) Thanks @balajisiva.
|
||||
- Heartbeat/scheduling: spread interval heartbeats across stable per-agent phases derived from gateway identity, so provider traffic is distributed more uniformly across the configured interval instead of clustering around startup-relative times. (#64560) Thanks @odysseus0.
|
||||
- Config/media: accept `tools.media.asyncCompletion.directSend` in strict config validation so gateways no longer reject the generated-schema-backed async media completion setting at startup. (#63618) Thanks @qiziAI.
|
||||
- Telegram/exec: preserve delayed exec completion routing for forum topics by pinning background exec completions to the topic where the run started even if the session route later drifts. (#64580) thanks @jalehman.
|
||||
|
||||
## 2026.4.9
|
||||
|
||||
@@ -193,7 +141,6 @@ Docs: https://docs.openclaw.ai
|
||||
- QA/lab: add character-vibes evaluation reports with model selection and parallel runs so live QA can compare candidate behavior faster.
|
||||
- Plugins/provider-auth: let provider manifests declare `providerAuthAliases` so provider variants can share env vars, auth profiles, config-backed auth, and API-key onboarding choices without core-specific wiring.
|
||||
- iOS: pin release versioning to an explicit CalVer in `apps/ios/version.json`, keep TestFlight iteration on the same short version until maintainers intentionally promote the next gateway version, and add the documented `pnpm ios:version:pin -- --from-gateway` workflow for release trains. (#63001) Thanks @ngutman.
|
||||
- Tools/video_generate: extend the tool and the Plugin SDK with `providerOptions` (vendor-specific options forwarded as a JSON object), `inputAudios` / `audioRef` / `audioRefs` reference audio inputs, per-asset semantic role hints (`imageRoles` / `videoRoles` / `audioRoles`) using a typed `VideoGenerationAssetRole` union, a new `"adaptive"` aspect-ratio sentinel, and `maxInputAudios` provider capability declarations. Providers opt into `providerOptions` by declaring a typed `capabilities.providerOptions` schema (`{ seed: "number", draft: "boolean", ... }`); unknown keys and type mismatches cause the runtime fallback loop to skip the candidate with a visible warning and an `attempts` entry, so vendor-specific options never silently reach the wrong provider. Also raises the in-tool image input cap to 9 and updates the docs table to list all new parameters. (#61987) Thanks @xieyongliang.
|
||||
|
||||
### Fixes
|
||||
|
||||
@@ -355,9 +302,6 @@ Docs: https://docs.openclaw.ai
|
||||
- Reply execution: prefer the active runtime snapshot over stale queued reply config during embedded reply and follow-up execution so SecretRef-backed reply turns stop crashing after secrets have already resolved. (#62693) Thanks @mbelinky.
|
||||
- Android/manual connect: allow blank port input only for TLS manual gateway endpoints so standard HTTPS Tailscale hosts default to `443` without silently changing cleartext manual connects. (#63134) Thanks @Tyler-RNG.
|
||||
- Matrix/agents: hide owner-only `set-profile` from embedded agent channel-action discovery so non-owner runs stop advertising profile updates they cannot execute. (#62662) Thanks @eleqtrizit.
|
||||
- iOS/gateway: replace string-matched connection error UI with structured gateway connection problems, preserve actionable pairing/auth failures over later generic disconnect noise, and surface reusable problem banners and details across onboarding, settings, and root status surfaces. (#62650) Thanks @ngutman.
|
||||
- Git/env sanitization: block additional Git repository-plumbing env variables such as `GIT_DIR`, `GIT_WORK_TREE`, `GIT_COMMON_DIR`, `GIT_INDEX_FILE`, `GIT_OBJECT_DIRECTORY`, `GIT_ALTERNATE_OBJECT_DIRECTORIES`, and `GIT_NAMESPACE` so host-run Git commands cannot be redirected to attacker-chosen repository state through inherited or request-scoped env. (#62002) Thanks @eleqtrizit.
|
||||
- Host exec/env sanitization: block additional request-scoped credential and config-path overrides such as `KUBECONFIG`, cloud credential-path env, `CARGO_HOME`, and `HELM_HOME` so host-run tools can no longer be redirected to attacker-chosen config or state. (#59119) Thanks @eleqtrizit.
|
||||
|
||||
## 2026.4.5
|
||||
|
||||
|
||||
@@ -95,7 +95,6 @@ For coordinated change sets that genuinely need more than 10 PRs, join the **#cl
|
||||
|
||||
- Test locally with your OpenClaw instance
|
||||
- Run tests: `pnpm build && pnpm check && pnpm test`
|
||||
- For iterative local commits, `scripts/committer --fast "message" <files...>` passes `FAST_COMMIT=1` through to the pre-commit hook so it skips the repo-wide `pnpm check`. Only use it when you've already run equivalent targeted validation for the touched surface.
|
||||
- For extension/plugin changes, run the fast local lane first:
|
||||
- `pnpm test:extension <extension-name>`
|
||||
- `pnpm test:extension --list` to see valid extension ids
|
||||
|
||||
@@ -6,6 +6,7 @@ We monitor security signals from:
|
||||
|
||||
- GitHub Security Advisories (GHSA) and private vulnerability reports.
|
||||
- Public GitHub issues/discussions when reports are not sensitive.
|
||||
- Official plublic discussion groups and channels (i.e. Discord and X).
|
||||
- Automated signals (for example Dependabot, CodeQL, npm advisories, and secret scanning).
|
||||
|
||||
Initial triage:
|
||||
|
||||
317
appcast.xml
317
appcast.xml
@@ -2,193 +2,6 @@
|
||||
<rss xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" version="2.0">
|
||||
<channel>
|
||||
<title>OpenClaw</title>
|
||||
<item>
|
||||
<title>2026.4.11</title>
|
||||
<pubDate>Sun, 12 Apr 2026 00:37:09 +0000</pubDate>
|
||||
<link>https://raw.githubusercontent.com/openclaw/openclaw/main/appcast.xml</link>
|
||||
<sparkle:version>2026041190</sparkle:version>
|
||||
<sparkle:shortVersionString>2026.4.11</sparkle:shortVersionString>
|
||||
<sparkle:minimumSystemVersion>15.0</sparkle:minimumSystemVersion>
|
||||
<description><![CDATA[<h2>OpenClaw 2026.4.11</h2>
|
||||
<h3>Changes</h3>
|
||||
<ul>
|
||||
<li>Dreaming/memory-wiki: add ChatGPT import ingestion plus new <code>Imported Insights</code> and <code>Memory Palace</code> diary subtabs so Dreaming can inspect imported source chats, compiled wiki pages, and full source pages directly from the UI. (#64505)</li>
|
||||
<li>Control UI/webchat: render assistant media/reply/voice directives as structured chat bubbles, add the <code>[embed ...]</code> rich output tag, and gate external embed URLs behind config. (#64104)</li>
|
||||
<li>Tools/video_generate: add URL-only generated asset delivery, typed <code>providerOptions</code>, reference audio inputs, per-asset role hints, <code>adaptive</code> aspect-ratio support, and a higher image-input cap so video providers can expose richer generation modes without forcing large files into memory. (#61987, #61988) Thanks @xieyongliang.</li>
|
||||
<li>Feishu: improve document comment sessions with richer context parsing, comment reactions, and typing feedback so document-thread conversations behave more like chat conversations. (#63785)</li>
|
||||
<li>Microsoft Teams: add reaction support, reaction listing, Graph pagination, and delegated OAuth setup for sending reactions while preserving application-auth read paths. (#51646)</li>
|
||||
<li>Plugins: allow plugin manifests to declare activation and setup descriptors so plugin setup flows can describe required auth, pairing, and configuration steps without hardcoded core special cases. (#64780)</li>
|
||||
<li>Ollama: cache <code>/api/show</code> context-window and capability metadata during model discovery so repeated picker refreshes stop refetching unchanged models, while still retrying after empty responses and invalidating on digest changes. (#64753) Thanks @ImLukeF.</li>
|
||||
<li>Models/providers: surface how configured OpenAI-compatible endpoints are classified in embedded-agent debug logs, so local and proxy routing issues are easier to diagnose. (#64754) Thanks @ImLukeF.</li>
|
||||
<li>QA/parity: add the GPT-5.4 vs Opus 4.6 agentic parity report gate with shared scenario coverage checks, stricter evidence heuristics, and skipped-scenario accounting for maintainer review. (#64441) Thanks @100yenadmin.</li>
|
||||
</ul>
|
||||
<h3>Fixes</h3>
|
||||
<ul>
|
||||
<li>OpenAI/Codex OAuth: stop rewriting the upstream authorize URL scopes so new Codex sign-ins do not fail with <code>invalid_scope</code> before returning an authorization code. (#64713) Thanks @fuller-stack-dev.</li>
|
||||
<li>Audio transcription: disable pinned DNS only for OpenAI-compatible multipart requests, while still validating hostnames, so OpenAI, Groq, and Mistral transcription works again without weakening other request paths. (#64766) Thanks @GodsBoy.</li>
|
||||
<li>macOS/Talk Mode: after granting microphone permission on first enable, continue starting Talk Mode instead of requiring a second toggle. (#62459) Thanks @ggarber.</li>
|
||||
<li>Control UI/webchat: persist agent-run TTS audio replies into webchat history and preserve interleaved tool card pairing so generated audio and mixed tool output stay attached to the right messages. (#63514) Thanks @bittoby.</li>
|
||||
<li>WhatsApp: honor the configured default account when the active listener helper is used without an explicit account id, so named default accounts do not get registered under <code>default</code>. (#53918) Thanks @yhyatt.</li>
|
||||
<li>ACP/agents: suppress commentary-phase child assistant relay text in ACP parent stream updates, so spawned child runs stop leaking internal progress chatter into the parent session. Thanks @vincentkoc.</li>
|
||||
<li>Agents/timeouts: honor explicit run timeouts in the LLM idle watchdog and align default timeout config so slow models can keep working until the configured limit instead of using the wrong idle window.</li>
|
||||
<li>Config: include <code>asyncCompletion</code> in the generated zod schema so documented async completion config no longer fails with an unrecognized-key error. (#63618)</li>
|
||||
<li>Google/Veo: stop sending the unsupported <code>numberOfVideos</code> request field so Gemini Developer API Veo runs do not fail before OpenClaw can complete the intended Google video generation path. (#64723) Thanks @velvet-shark.</li>
|
||||
<li>QA/packaging: stop packaged CLI startup and completion cache generation from reading repo-only QA scenario markdown, ship the bundled QA scenario pack in npm releases, and keep <code>openclaw completion --write-state</code> working even if QA setup is broken. (#64648) Thanks @obviyus.</li>
|
||||
<li>Codex/QA: keep Codex app-server coordination chatter out of visible replies, add a live QA leak scenario, and classify leaked harness meta text as a QA failure instead of a successful reply. Thanks @vincentkoc.</li>
|
||||
<li>WhatsApp: route <code>message react</code> through the gateway-owned action path so reactions use the live WhatsApp listener in both DM and group chats, matching <code>message send</code> and <code>message poll</code>. Thanks @mcaxtr.</li>
|
||||
<li>Auto-reply/WhatsApp: preserve inbound image attachment notes after media understanding so image edits keep the real saved media path instead of hallucinating a missing local path. (#64918) Thanks @ngutman.</li>
|
||||
<li>Telegram/sessions: keep topic-scoped session initialization on the canonical topic transcript path when inbound turns omit <code>MessageThreadId</code>, so one topic session no longer alternates between bare and topic-qualified transcript files. (#64869) Thanks @jalehman.</li>
|
||||
<li>Agents/failover: scope assistant-side fallback classification and surfaced provider errors to the current attempt instead of stale session history, so cross-provider fallback runs stop inheriting the previous provider's failure. (#62907) Thanks @stainlu.</li>
|
||||
<li>MiniMax/OAuth: write <code>api: "anthropic-messages"</code> and <code>authHeader: true</code> into the <code>minimax-portal</code> config patch during <code>openclaw configure</code>, so re-authenticated portal setups keep Bearer auth routing working. (#64964) Thanks @ryanlee666.</li>
|
||||
</ul>
|
||||
<p><a href="https://github.com/openclaw/openclaw/blob/main/CHANGELOG.md">View full changelog</a></p>
|
||||
]]></description>
|
||||
<enclosure url="https://github.com/openclaw/openclaw/releases/download/v2026.4.11/OpenClaw-2026.4.11.zip" length="47317969" type="application/octet-stream" sparkle:edSignature="v9bUsh1mBBPtpMn7kKYAvO8MNJHAeMj7UkmkkuDSC8NvwPx2Fo3+NEeyAyA9s9Vax6L7i+eHSpwzAmtwpnHcCA=="/>
|
||||
</item>
|
||||
<item>
|
||||
<title>2026.4.10</title>
|
||||
<pubDate>Sat, 11 Apr 2026 03:17:02 +0000</pubDate>
|
||||
<link>https://raw.githubusercontent.com/openclaw/openclaw/main/appcast.xml</link>
|
||||
<sparkle:version>2026041090</sparkle:version>
|
||||
<sparkle:shortVersionString>2026.4.10</sparkle:shortVersionString>
|
||||
<sparkle:minimumSystemVersion>15.0</sparkle:minimumSystemVersion>
|
||||
<description><![CDATA[<h2>OpenClaw 2026.4.10</h2>
|
||||
<h3>Changes</h3>
|
||||
<ul>
|
||||
<li>Models/Codex: add the bundled Codex provider and plugin-owned app-server harness so <code>codex/gpt-*</code> models use Codex-managed auth, native threads, model discovery, and compaction while <code>openai/gpt-*</code> stays on the normal OpenAI provider path. (#64298)</li>
|
||||
<li>Memory/Active Memory: add a new optional Active Memory plugin that gives OpenClaw a dedicated memory sub-agent right before the main reply, so ongoing chats can automatically pull in relevant preferences, context, and past details without making users remember to manually say "remember this" or "search memory" first. Includes configurable message/recent/full context modes, live <code>/verbose</code> inspection, advanced prompt/thinking overrides for tuning, and opt-in transcript persistence for debugging. Docs: https://docs.openclaw.ai/concepts/active-memory. (#63286) Thanks @Takhoffman.</li>
|
||||
<li>macOS/Talk: add an experimental local MLX speech provider for Talk Mode, with explicit provider selection, local utterance playback, interruption handling, and system-voice fallback. (#63539) Thanks @ImLukeF.</li>
|
||||
<li>Tools/video generation: add Seedance 2.0 model refs to the bundled fal provider and submit the provider-specific duration, resolution, audio, and seed metadata fields needed for live Seedance 2.0 runs.</li>
|
||||
<li>Microsoft Teams: add message actions for pin, unpin, read, react, and listing reactions. (#53432) Thanks @sudie-codes.</li>
|
||||
<li>QA/Matrix: add a live <code>openclaw qa matrix</code> lane backed by a disposable Matrix homeserver, shared live-transport seams, and Matrix-specific transport coverage for threading, reactions, restart, and allowlist behavior. (#64489) Thanks @gumadeiras.</li>
|
||||
<li>QA/Telegram: add a live <code>openclaw qa telegram</code> lane for private-group bot-to-bot checks, harden its artifact handling, and preserve native Telegram command reply threading for QA verification. (#64303) Thanks @obviyus.</li>
|
||||
<li>QA/testing: add a <code>--runner multipass</code> lane for <code>openclaw qa suite</code> so repo-backed QA scenarios can run inside a disposable Linux VM and write back the usual report, summary, and VM logs. (#63426) Thanks @shakkernerd.</li>
|
||||
<li>CLI/exec policy: add a local <code>openclaw exec-policy</code> command with <code>show</code>, <code>preset</code>, and <code>set</code> subcommands for synchronizing requested <code>tools.exec.*</code> config with the local exec approvals file, plus follow-up hardening for node-host rejection, rollback safety, and sync conflict detection. (#64050)</li>
|
||||
<li>Gateway: add a <code>commands.list</code> RPC so remote gateway clients can discover runtime-native, text, skill, and plugin commands with surface-aware naming and serialized argument metadata. (#62656) Thanks @samzong.</li>
|
||||
<li>Models/providers: add per-provider <code>models.providers.*.request.allowPrivateNetwork</code> for trusted self-hosted OpenAI-compatible endpoints, keep the opt-in scoped to model request surfaces, and refresh cached WebSocket managers when request transport overrides change. (#63671) Thanks @qas.</li>
|
||||
<li>Feishu: standardize request user agents and register the bot as an AI agent so Feishu deployments identify OpenClaw consistently. (#63835) Thanks @evandance.</li>
|
||||
<li>Matrix/partial streaming: add MSC4357 live markers to draft preview sends and edits so supporting Matrix clients can render a live/typewriter animation and stop it when the final edit lands. (#63513) Thanks @TigerInYourDream.</li>
|
||||
<li>Control UI/dreaming: simplify the Scene and Diary surfaces, preserve unknown phase state for partial status payloads, and stabilize waiting-entry recency ordering so Dreaming status and review lists stay clear and deterministic. (#64035) Thanks @davemorin.</li>
|
||||
<li>Agents: add an opt-in strict-agentic embedded Pi execution contract for GPT-5-family runs so plan-only or filler turns keep acting until they hit a real blocker. (#64241) Thanks @100yenadmin.</li>
|
||||
<li>Agents/OpenAI: add provider-owned OpenAI/Codex tool schema compatibility and surface embedded-run replay/liveness state for long-running runs. (#64300) Thanks @100yenadmin.</li>
|
||||
<li>Docs i18n: chunk raw doc translation, reject truncated tagged outputs, avoid ambiguous body-only wrapper unwrapping, and recover from terminated Pi translation sessions without changing the default <code>openai/gpt-5.4</code> path. (#62969, #63808) Thanks @hxy91819.</li>
|
||||
</ul>
|
||||
<h3>Fixes</h3>
|
||||
<ul>
|
||||
<li>Browser/security: tighten browser and sandbox navigation defenses across strict SSRF defaults, hostname allowlists, interaction-driven redirects, subframes, CDP discovery, existing sessions, tab actions, noVNC, marker-span sanitization, and Docker CDP source-range enforcement. (#61404, #63332, #63882, #63885, #63889, #64367, #64370, #64371)</li>
|
||||
<li>Security/tools: harden exec preflight reads, host env denylisting, node output boundaries, outbound host-media reads, profile-mutation authorization, plugin install dependency scanning, ACPX tool hooks, Gmail watcher token redaction, and oversized realtime WebSocket frame handling. (#62333, #62661, #62662, #63277, #63551, #63553, #63886, #63890, #63891, #64459)</li>
|
||||
<li>OpenAI/Codex: add required Codex OAuth scopes, classify provider/runtime failures more clearly, stop suggesting <code>/elevated full</code> when auto-approved host exec is unavailable, add OpenAI/Codex tool-schema compatibility, and preserve embedded-run replay/liveness truth across compaction retries and mutating side effects. (#64300, #64439) Thanks @100yenadmin.</li>
|
||||
<li>CLI/WhatsApp media sends: route gateway-mode outbound sends with <code>--media</code> through the channel <code>sendMedia</code> path and preserve media access context, so WhatsApp document and attachment sends stop silently dropping the file while still delivering the caption. (#64478, #64492) Thanks @ShionEria.</li>
|
||||
<li>Microsoft Teams: restore media downloads for personal DMs, Bot Framework <code>a:</code> conversations, OneDrive/SharePoint shared files, and Graph-backed chat IDs; accept Bot Framework audience tokens; prevent feedback-learning filename collisions; keep long tool chains alive with typing indicators; add SSO sign-in callbacks; inject parent context for thread replies; and deliver cron announcements to Teams conversation IDs. (#54932, #55383, #55386, #58001, #58249, #58774, #59731, #60956, #62219, #62674, #63063, #63942, #63945, #63949, #63951, #63953, #64087, #64088, #64089)</li>
|
||||
<li>Gateway/tailscale: start Tailscale exposure and the gateway update check before awaiting channel and plugin sidecar startup so remote operators are not locked out when startup sidecars stall.</li>
|
||||
<li>Gateway/startup: keep WebSocket RPC available while channels and plugin sidecars start, hold <code>chat.history</code> unavailable until startup sidecars finish so synchronous history reads cannot stall startup (reported in #63450), refresh advertised gateway methods after deferred plugin reloads, and enforce the pre-auth WebSocket upgrade budget before the no-handler 503 path so upgrade floods cannot bypass connection limits during that window. (#63480) Thanks @neeravmakwana.</li>
|
||||
<li>WhatsApp: keep inbound replies, media, composing indicators, and queued outbound deliveries attached to the current socket across reconnect gaps, including fresh retry-eligible sends after the listener comes back. (#30806, #46299, #62892, #63916) Thanks @mcaxtr.</li>
|
||||
<li>Gateway/thread routing: preserve Slack, Telegram, Mattermost, Matrix, ACP, restart-sentinel, and agent announce delivery targets so subagent, cron, stream-relay, session fallback, and restart messages land back in the originating thread, topic, or room casing. (#54840, #57056, #63143, #63228, #63506, #64343, #64391)</li>
|
||||
<li>Models/fallback: preserve <code>/models</code> selection across transient primary-model failures and config reloads, allow timeout cooldown probes, classify OpenRouter no-endpoints responses, detect llama.cpp context overflows, and keep provider/runtime context metadata stable through reloads. (#61472, #64196, #64471)</li>
|
||||
<li>Agents/BTW: keep <code>/btw</code> side questions working after tool-use turns by stripping replayed tool blocks, hidden reasoning, and malformed image payloads, omitting empty tool arrays, allowing Bedrock <code>auth: "aws-sdk"</code>, and routing Feishu <code>/btw</code> plus <code>/stop</code> through bounded out-of-band lanes. (#64218, #64219, #64225, #64324) Thanks @ngutman.</li>
|
||||
<li>Control UI/BTW: render <code>/btw</code> side results as dismissible ephemeral cards in the browser, send <code>/btw</code> immediately during active runs, and clear stale BTW cards on reset flows so webchat matches the intended detached side-question behavior. (#64290) Thanks @ngutman.</li>
|
||||
<li>Commands/targeting: use the selected agent or session for command output, send policy, usage/cost, context reports, model lists, bash sandbox hints, BTW/compact working directories, plugin commands, and session exports so multi-agent commands describe and mutate the intended target instead of the requester.</li>
|
||||
<li>Conversation bindings: normalize focused/current conversation ids, preserve binding metadata on account and Discord rebinds, avoid stale Discord lifecycle windows, and keep generic activity touches persisted so reply routing survives rebinds and restarts.</li>
|
||||
<li>iMessage/self-chat: distinguish normal DM outbound rows from true self-chat using <code>destination_caller_id</code> plus chat participants, preserve multi-handle self-chat aliases, drop ambiguous reflected echoes, and strip wrapped imsg RPC text fields. (#61619, #63868, #63980, #63989, #64000) Thanks @neeravmakwana.</li>
|
||||
<li>Matrix: keep multi-account room scoping consistent, keep packaged crypto migrations warning-only when appropriate, preserve ordered block streaming, add explicit Matrix block-streaming opt-in, and resolve verification/bootstrap from the packaged runtime entry. (#58449, #59249, #59266, #64373) Thanks @gumadeiras.</li>
|
||||
<li>Telegram/security: tighten Telegram <code>allowFrom</code> sender validation and keep <code>/whoami</code> allowlist reporting in sync with command auth checks.</li>
|
||||
<li>Agents/timeouts: extend the default LLM idle window to 120s and keep silent no-token idle timeouts on recovery paths, so slow models can retry or fall back before users see an error.</li>
|
||||
<li>Gateway/agents: preserve configured model selection and richer <code>IDENTITY.md</code> content across agent create/update flows and workspace moves, and fail safely instead of silently overwriting unreadable identity files. (#61577) Thanks @samzong.</li>
|
||||
<li>Skills/TaskFlow: restore valid frontmatter fences for the bundled <code>taskflow</code> and <code>taskflow-inbox-triage</code> skills and copy bundled <code>SKILL.md</code> files as hard dist-runtime copies so skills stay discoverable and loadable after updates. (#64166, #64469) Thanks @extrasmall0.</li>
|
||||
<li>Skills: respect overridden home directories when loading personal skills so service, test, and custom launch environments read the intended user skill directory instead of the process home.</li>
|
||||
<li>Windows/exec: settle supervisor waits from child exit state after stdout and stderr drain even when <code>close</code> never arrives, so CLI commands stop hanging or dying with forced <code>SIGKILL</code> on Windows. (#64072) Thanks @obviyus.</li>
|
||||
<li>Browser/sandbox: prevent sandbox browser CDP startup hangs by recreating containers when the browser security hash changes and by waiting on the correct sandbox browser lifecycle. (#62873) Thanks @Syysean.</li>
|
||||
<li>QQBot/streaming: make block streaming configurable per QQ bot account via <code>streaming.mode</code> (<code>"partial"</code> | <code>"off"</code>, default <code>"partial"</code>) instead of hardcoding it off, so responses can be delivered incrementally. (#63746)</li>
|
||||
<li>QQBot/config: allow extra fields in <code>channels.qqbot</code> and <code>channels.qqbot.accounts.*</code> so extended qqbot builds can add new config options without gateway startup failing on schema validation. (#64075) Thanks @WideLee.</li>
|
||||
<li>Dreaming/gateway: require <code>operator.admin</code> for persistent <code>/dreaming on|off</code> changes and treat missing gateway client scopes as unprivileged instead of silently allowing config writes. (#63872) Thanks @mbelinky.</li>
|
||||
<li>Gateway/pairing: prefer explicit QR bootstrap auth over earlier Tailscale auth classification so iOS <code>/pair qr</code> silent bootstrap pairing does not fall through to <code>pairing required</code>. (#59232) Thanks @ngutman.</li>
|
||||
<li>Browser/control: auto-generate browser-control auth tokens for <code>none</code> and <code>trusted-proxy</code> modes, and route browser auth/profile/doctor helpers through the public browser plugin facades. (#63280, #63957) Thanks @pgondhi987.</li>
|
||||
<li>Browser/act: centralize <code>/act</code> request normalization and execution dispatch while adding stable machine-readable route-level error codes for invalid requests, selector misuse, evaluate-disabled gating, target mismatch, and existing-session unsupported actions. (#63977) Thanks @joshavant.</li>
|
||||
<li>Security/QQBot: enforce media storage boundaries for all outbound local file paths and route image-size probes through SSRF-guarded media fetching instead of raw <code>fetch()</code>. (#63271, #63495) Thanks @pgondhi987.</li>
|
||||
<li>Channel setup: ignore workspace plugin shadows when resolving trusted channel setup catalog entries so onboarding and setup flows keep using the bundled, trusted setup contract.</li>
|
||||
<li>Gateway/memory startup: load the explicitly selected memory-slot plugin during gateway startup, while keeping restrictive allowlists and implicit default memory slots from auto-starting unrelated memory plugins. (#64423) Thanks @EronFan.</li>
|
||||
<li>Config/plugins: let config writes keep disabled plugin entries without forcing required plugin config schemas or crashing raw plugin validation, and avoid re-activating plugin registry state during schema checks. (#54971, #63296) Thanks @fuller-stack-dev.</li>
|
||||
<li>Config validation: surface the actual offending field for strict-schema union failures in bindings, including top-level unexpected keys on the matching ACP branch. (#40841) Thanks @Hollychou924.</li>
|
||||
<li>Wizard/plugin config: coerce integer-typed plugin config fields from interactive text input so integer schema values persist as numbers instead of failing validation. (#63346) Thanks @jalehman.</li>
|
||||
<li>Daemon/gateway install: preserve safe custom service env vars on forced reinstall, merge prior custom PATH segments behind the managed service PATH, and stop removed managed env keys from persisting as custom carryover. (#63136) Thanks @WarrenJones.</li>
|
||||
<li>Cron/scheduling: treat <code>nextRunAtMs <= 0</code> as invalid across cron update, maintenance, timer, and stale-delivery paths so corrupted zero timestamps self-heal instead of causing immediate runs or skipped deliveries. (#63507) Thanks @WarrenJones.</li>
|
||||
<li>Cron/auth: resolve auth profiles consistently for isolated cron jobs so scheduled runs use the same configured provider credentials as interactive sessions. (#62797) Thanks @neeravmakwana.</li>
|
||||
<li>Tasks: let <code>openclaw tasks cancel</code> cancel stuck background tasks that never reached a normal terminal state. (#62506) Thanks @neeravmakwana.</li>
|
||||
<li>Sessions/model selection: preserve catalog-backed session model labels, provider-qualified context limits, and already-qualified session model refs when catalog metadata is unavailable, so model selection and memory/context budgets survive reloads without bogus provider prefixes. (#61382, #62493) Thanks @Mule-ME.</li>
|
||||
<li>Status: show configured fallback models in <code>/status</code> and shared session status cards so per-agent fallback configuration is visible before a live failover happens. (#33111) Thanks @AnCoSONG.</li>
|
||||
<li><code>/context detail</code> now compares the tracked prompt estimate with cached context usage and surfaces untracked provider/runtime overhead when present. (#28391) Thanks @ImLukeF.</li>
|
||||
<li>Gateway/sessions: scope bare <code>sessions.create</code> aliases like <code>main</code> to the requested agent while preserving the canonical <code>global</code> and <code>unknown</code> sentinel keys. (#58207) Thanks @jalehman.</li>
|
||||
<li>Gateway/session reset: emit the typed <code>before_reset</code> hook for gateway <code>/new</code> and <code>/reset</code>, preserving reset-hook behavior even when the previous transcript has already been archived. (#53872) Thanks @VACInc.</li>
|
||||
<li>Plugins/commands: pass the active host <code>sessionKey</code> into plugin command contexts, and include <code>sessionId</code> when it is already available from the active session entry, so bundled and third-party commands can resolve the current conversation reliably. (#59044) Thanks @jalehman.</li>
|
||||
<li>Agents/auth: honor <code>models.providers.*.authHeader</code> for pi embedded runner model requests by injecting <code>Authorization: Bearer <apiKey></code> when requested. (#54390) Thanks @lndyzwdxhs.</li>
|
||||
<li>Claude CLI: clear inherited Anthropic auth/header environment aliases before spawning Claude Code and add sanitized CLI backend auth-env diagnostics for debugging gateway-run provider selection.</li>
|
||||
<li>Agents/failover: classify AbortError and stream-abort messages as timeout so Ollama NDJSON stream aborts stop showing <code>reason=unknown</code> in model fallback logs. (#58324) Thanks @yelog.</li>
|
||||
<li>Fireworks/FirePass: disable Kimi K2.5 Turbo reasoning output by forcing thinking off on the FirePass path and hardening the provider wrapper so hidden reasoning no longer leaks into visible replies. (#63607) Thanks @frankekn.</li>
|
||||
<li>Discord: update Carbon to v0.15.0. Thanks @thewilloftheshadow.</li>
|
||||
<li>Config/Discord: coerce safe integer numeric Discord IDs to strings during config validation, keep unsafe or precision-losing numeric snowflakes rejected, and align <code>openclaw doctor</code> repair guidance with the same fail-closed behavior. (#45125) Thanks @moliendocode.</li>
|
||||
<li>BlueBubbles/config: accept <code>enrichGroupParticipantsFromContacts</code> in the core strict config schema so gateways no longer fail validation or startup when the BlueBubbles plugin writes that field. (#56889) Thanks @zqchris.</li>
|
||||
<li>Feishu/webhooks: read webhook bodies through the pre-auth guard so unauthenticated webhook traffic stays under the same body budget as other protected channel ingress paths.</li>
|
||||
<li>Tools/web_fetch: add an opt-in <code>tools.web.fetch.ssrfPolicy.allowRfc2544BenchmarkRange</code> config so fake-IP proxy environments that resolve public sites into <code>198.18.0.0/15</code> can use <code>web_fetch</code> without weakening the default SSRF block. (#61830) Thanks @xing-xing-coder.</li>
|
||||
<li>Dreaming/cron: reconcile managed dreaming cron from startup config and runtime lifecycle changes, but only recover managed dreaming cron state during heartbeat-triggered dreaming checks so ordinary chat traffic does not recreate removed jobs. (#63873, #63929, #63938) Thanks @mbelinky.</li>
|
||||
<li>Memory/lancedb: accept <code>dreaming</code> config when <code>memory-lancedb</code> owns the memory slot so Dreaming surfaces can read slot-owner settings without schema rejection. (#63874) Thanks @mbelinky.</li>
|
||||
<li>Control UI/dreaming: keep the Dreaming trace area contained and scrollable so overlays no longer cover tabs or blow out the page layout. (#63875) Thanks @mbelinky.</li>
|
||||
<li>Dreaming/narrative: harden request-scoped diary fallback so scheduled dreaming only falls back on the dedicated subagent-runtime error, stop trusting spoofable raw error-code objects, and avoid leaking workspace paths when local fallback writes fail. (#64156) Thanks @mbelinky.</li>
|
||||
<li>Dreaming/diary: add idempotent narrative subagent runs, preserve restrictive <code>DREAMS.md</code> permissions during atomic writes, and surface temp cleanup failures so repeated sweeps do not double-run the same narrative request or silently weaken diary safety. (#63876) Thanks @mbelinky.</li>
|
||||
<li>Heartbeats/sessions: remove stale accumulated isolated heartbeat session keys when the next tick converges them back to the canonical sibling, so repaired sessions stop showing orphaned <code>:heartbeat:heartbeat</code> variants in session listings. (#59606) Thanks @rogerdigital.</li>
|
||||
<li>Gateway/run cleanup: fix stale run-context TTL cleanup so the new maintenance sweep resets orphaned run sequence state and prevents unbounded run-context growth. (#52731) Thanks @artwalker.</li>
|
||||
<li>UI/compaction: keep the compaction indicator in a retry-pending state until the run actually finishes, so the UI does not show <code>Context compacted</code> before compaction actually finishes. (#55132) Thanks @mpz4life.</li>
|
||||
<li>Cron/tool schemas: keep cron tool schemas strict-model-friendly while still preserving <code>failureAlert=false</code>, nullable <code>agentId</code>/<code>sessionKey</code>, and flattened add/update recovery for the newly exposed cron job fields. (#55043) Thanks @brunolorente.</li>
|
||||
<li>Git metadata: read commit ids from packed refs as well as loose refs so version and status metadata stay accurate after repository maintenance. (#63943)</li>
|
||||
<li>Gateway: keep <code>commands.list</code> skill entries categorized under tools and include provider-aware plugin <code>nativeName</code> metadata even when <code>scope=text</code>, so remote clients can group skills correctly and map text-surface plugin commands back to native aliases. (#64147)</li>
|
||||
<li>TUI: reset footer activity to idle when switching sessions so a stale streaming indicator cannot persist after the selection changes. (#63988) Thanks @neeravmakwana.</li>
|
||||
<li>Claude CLI: stop marking spawned Claude Code runs as host-managed so they keep using normal CLI subscription behavior. (#64023) Thanks @Alex-Alaniz.</li>
|
||||
<li>Codex auth: brand Codex OAuth flows as OpenClaw in user-visible auth prompts and diagnostics.</li>
|
||||
<li>Gateway/pairing: fail closed for paired device records that have no device tokens, and reject pairing approvals whose requested scopes do not match the requested device roles.</li>
|
||||
<li>ACP/gateway chat: classify lifecycle errors before forwarding them to ACP clients so refusals use ACP's refusal stop reason while transient backend errors continue to finish as normal turns.</li>
|
||||
<li>Claude CLI/skills: pass eligible OpenClaw skills into CLI runs, including native Claude Code skill resolution via a temporary plugin plus per-run skill env/API key injection. (#62686, #62723) Thanks @zomars.</li>
|
||||
<li>Discord: keep generated auto-thread names working with reasoning models by giving title generation enough output budget for thinking plus visible title text. (#64172) Thanks @hanamizuki.</li>
|
||||
<li>Heartbeat: ignore doc-only Markdown fence markers in the default <code>HEARTBEAT.md</code> template so comment-only heartbeat scaffolds skip API calls again. (#61690, #63434) Thanks @ravyg.</li>
|
||||
<li>Reply/skills: keep resolved skill and memory secret config stable through embedded reply runs so raw SecretRefs in secondary skill settings no longer crash replies when the gateway already has the live env. (#64249) Thanks @mbelinky.</li>
|
||||
<li>Dreaming/startup: keep plugin-registered startup hooks alive across workspace hook reloads and include dreaming startup owners in the gateway startup plugin scope, so managed Dreaming cron registration comes back reliably after gateway boot. (#62327, #64258) Thanks @mbelinky.</li>
|
||||
<li>Plugins: treat duplicate <code>registerService</code> calls from the same plugin id as idempotent so snapshot and activation loads no longer emit spurious <code>service already registered</code> diagnostics. (#62033, #64128) Thanks @ly85206559.</li>
|
||||
<li>Discord/TTS: route auto voice replies through the native voice-note path so Discord receives Opus voice messages instead of regular audio attachments. (#64096) Thanks @LiuHuaize.</li>
|
||||
<li>Config/plugins: use plugin-owned command alias metadata when <code>plugins.allow</code> contains runtime command names like <code>dreaming</code>, and point users at the owning plugin instead of stale plugin-not-found guidance. (#64191, #64242) Thanks @feiskyer.</li>
|
||||
<li>Agents/Gemini: strip orphaned <code>required</code> entries from Gemini tool schemas so provider validation no longer rejects tools after schema cleanup or union flattening. (#64284) Thanks @xxxxxmax.</li>
|
||||
<li>Assistant text: strip Qwen-style XML tool call payloads from visible replies so web and channel messages no longer show raw <code><tool_call><function=...></code> output. (#63999, #64214) Thanks @MoerAI.</li>
|
||||
<li>Daemon/gateway: prevent systemd restart storms on configuration errors by exiting with <code>EX_CONFIG</code> and adding generated unit restart-prevention guards. (#63913) Thanks @neo1027144-creator.</li>
|
||||
<li>Agents/exec: prevent gateway crash ("Agent listener invoked outside active run") when a subagent exec tool produces stdout/stderr after the agent run has ended or been aborted. (#62821) Thanks @openperf.</li>
|
||||
<li>Gateway/OpenAI compat: return real <code>usage</code> for non-stream <code>/v1/chat/completions</code> responses, emit the final usage chunk when <code>stream_options.include_usage=true</code>, and bound usage-gated stream finalization after lifecycle end. (#62986) Thanks @Lellansin.</li>
|
||||
<li>Matrix/migration: keep packaged warning-only crypto migrations from being misclassified as actionable when only helper chunks are present, so startup and doctor stay on the warning-only path instead of creating unnecessary migration snapshots. (#64373) Thanks @gumadeiras.</li>
|
||||
<li>Matrix/ACP thread bindings: preserve canonical room casing and parent conversation routing during ACP session spawn so mixed-case room ids bind correctly from top-level rooms and existing Matrix threads. (#64343) Thanks @gumadeiras.</li>
|
||||
<li>Agents/subagents: deduplicate delivered completion announces so retry or re-entry cleanup does not inject duplicate internal-context completion turns into the parent session. (#61525) Thanks @100yenadmin.</li>
|
||||
<li>Agents/exec: keep sandboxed <code>tools.exec.host=auto</code> sessions from honoring per-call <code>host=node</code> or <code>host=gateway</code> overrides while a sandbox runtime is active, and stop advertising node routing in that state so exec stays on the sandbox host. (#63880)</li>
|
||||
<li>Agents/subagents: preserve archived delete-mode runs until <code>sessions.delete</code> succeeds and prevent overlapping archive sweeps from duplicating in-flight cleanup attempts. (#61801) Thanks @100yenadmin.</li>
|
||||
<li>Cron/isolated agent: run scheduled agent turns as non-owner senders so owner-only tools stay unavailable during cron execution. (#63878)</li>
|
||||
<li>Discord/sandbox: include <code>image</code> in sandbox media param normalization so Discord event cover images cannot bypass sandbox path rewriting. (#64377) Thanks @mmaps.</li>
|
||||
<li>Agents/exec: extend exec completion detection to cover local background exec formats so the owner-downgrade fires correctly for all exec paths. (#64376) Thanks @mmaps.</li>
|
||||
<li>Security/dependencies: pin axios to 1.15.0 and add a plugin install dependency denylist that blocks known malicious packages before install. (#63891) Thanks @mmaps.</li>
|
||||
<li>Browser/security: apply three-phase interaction navigation guard to pressKey and type(submit) so delayed JS redirects from keypress cannot bypass SSRF policy. (#63889) Thanks @mmaps.</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>Browser/security: guard existing-session Chrome MCP interaction routes with SSRF post-checks so delayed navigation from click, type, press, and evaluate cannot bypass the configured policy. (#64370) Thanks @eleqtrizit.</li>
|
||||
<li>Browser/security: default browser SSRF policy to strict mode so unconfigured installs block private-network navigation, and align external-content marker span mapping so ZWS-injected boundary spoofs are fully sanitized. (#63885) Thanks @eleqtrizit.</li>
|
||||
<li>Browser/security: apply SSRF navigation policy to subframe document navigations so iframe-targeted private-network hops are blocked without quarantining the parent page. (#64371) Thanks @eleqtrizit.</li>
|
||||
<li>Hooks/security: mark agent hook system events as untrusted and sanitize hook display names before cron metadata reuse. (#64372) Thanks @eleqtrizit.</li>
|
||||
<li>Daemon/launchd: keep <code>openclaw gateway stop</code> persistent without uninstalling the macOS LaunchAgent, re-enable it on explicit restart or repair, and harden launchd label handling. (#64447) Thanks @ngutman.</li>
|
||||
<li>Plugins/context engines: preserve <code>plugins.slots.contextEngine</code> through normalization and keep explicitly selected workspace context-engine plugins enabled, so loader diagnostics and plugin activation stop dropping that slot selection. (#64192) Thanks @hclsys.</li>
|
||||
<li>Heartbeat: stop top-level <code>interval:</code> and <code>prompt:</code> fields outside the <code>tasks:</code> block from bleeding into the last parsed heartbeat task. (#64488) Thanks @Rahulkumar070.</li>
|
||||
<li>Agents/OpenAI replay: preserve malformed function-call arguments in stored assistant history, avoid double-encoding preserved raw strings on replay, and coerce replayed string args back to objects at Anthropic and Google provider boundaries. (#61956) Thanks @100yenadmin.</li>
|
||||
<li>Heartbeat/config: accept and honor <code>agents.defaults.heartbeat.timeoutSeconds</code> and per-agent heartbeat timeout overrides for heartbeat agent turns. (#64491) Thanks @cedillarack.</li>
|
||||
<li>CLI/devices: make implicit <code>openclaw devices approve</code> selection preview-only and require approving the exact request ID, preventing latest-request races during device pairing. (#64160) Thanks @coygeek.</li>
|
||||
<li>Media/security: honor sender-scoped <code>toolsBySender</code> policy for outbound host-media reads so denied senders cannot trigger host file disclosure via attachment hydration. (#64459) Thanks @eleqtrizit.</li>
|
||||
<li>Browser/security: reject strict-policy hostname navigation unless the hostname is an explicit allowlist exception or IP literal, and route CDP HTTP discovery through the pinned SSRF fetch path. (#64367) Thanks @eleqtrizit.</li>
|
||||
<li>Models/vLLM: ignore empty <code>tool_calls</code> arrays from reasoning-model OpenAI-compatible replies, reset false <code>toolUse</code> stop reasons when no actual tool calls were parsed, and stop sending <code>tool_choice</code> unless tools are present so vLLM reasoning responses no longer hang indefinitely. (#61197, #61534) Thanks @balajisiva.</li>
|
||||
<li>Heartbeat/scheduling: spread interval heartbeats across stable per-agent phases derived from gateway identity, so provider traffic is distributed more uniformly across the configured interval instead of clustering around startup-relative times. (#64560) Thanks @odysseus0.</li>
|
||||
</ul>
|
||||
<p><a href="https://github.com/openclaw/openclaw/blob/main/CHANGELOG.md">View full changelog</a></p>
|
||||
]]></description>
|
||||
<enclosure url="https://github.com/openclaw/openclaw/releases/download/v2026.4.10/OpenClaw-2026.4.10.zip" length="47259509" type="application/octet-stream" sparkle:edSignature="XY9FHxx09r2O9rlFs3t5UV9Zk2rGXSpWw5InazJhb661kgp6OKiOrrNTV631b2StWze5tnSEPXakkOCXq7O6DQ=="/>
|
||||
</item>
|
||||
<item>
|
||||
<title>2026.4.9</title>
|
||||
<pubDate>Thu, 09 Apr 2026 02:38:08 +0000</pubDate>
|
||||
@@ -246,5 +59,135 @@
|
||||
]]></description>
|
||||
<enclosure url="https://github.com/openclaw/openclaw/releases/download/v2026.4.9/OpenClaw-2026.4.9.zip" length="25336730" type="application/octet-stream" sparkle:edSignature="zFKTcKpejPyGEHj6Bdop3EBDfRrHyQMtJzrpVKsIkBq3I/jbTNvsxQveKEy9r7dqkZVsldFYv7eSunP3SUmaAw=="/>
|
||||
</item>
|
||||
<item>
|
||||
<title>2026.4.8</title>
|
||||
<pubDate>Wed, 08 Apr 2026 06:12:50 +0000</pubDate>
|
||||
<link>https://raw.githubusercontent.com/openclaw/openclaw/main/appcast.xml</link>
|
||||
<sparkle:version>2026040890</sparkle:version>
|
||||
<sparkle:shortVersionString>2026.4.8</sparkle:shortVersionString>
|
||||
<sparkle:minimumSystemVersion>15.0</sparkle:minimumSystemVersion>
|
||||
<description><![CDATA[<h2>OpenClaw 2026.4.8</h2>
|
||||
<h3>Fixes</h3>
|
||||
<ul>
|
||||
<li>Telegram/setup: load setup and secret contracts through packaged top-level sidecars so installed npm builds no longer try to import missing <code>dist/extensions/telegram/src/*</code> files during gateway startup.</li>
|
||||
<li>Bundled channels/setup: load shared secret contracts through packaged top-level sidecars across BlueBubbles, Feishu, Google Chat, IRC, Matrix, Mattermost, Microsoft Teams, Nextcloud Talk, Slack, and Zalo so installed npm builds no longer rely on missing <code>dist/extensions/*/src/*</code> files during gateway startup.</li>
|
||||
<li>Bundled plugins: align packaged plugin compatibility metadata with the release version so bundled channels and providers load on OpenClaw 2026.4.8.</li>
|
||||
<li>Agents/progress: keep <code>update_plan</code> available for OpenAI-family runs while returning compact success payloads and allowing <code>tools.experimental.planTool=false</code> to opt out.</li>
|
||||
<li>Agents/exec: keep <code>/exec</code> current-default reporting aligned with real runtime behavior so <code>host=auto</code> sessions surface the correct host-aware fallback policy (<code>full/off</code> on gateway or node, <code>deny/off</code> on sandbox) instead of stale stricter defaults.</li>
|
||||
<li>Slack: honor ambient HTTP(S) proxy settings for Socket Mode WebSocket connections, including NO_PROXY exclusions, so proxy-only deployments can connect without a monkey patch. (#62878) Thanks @mjamiv.</li>
|
||||
<li>Slack/actions: pass the already resolved read token into <code>downloadFile</code> so SecretRef-backed bot tokens no longer fail after a raw config re-read. (#62097) Thanks @martingarramon.</li>
|
||||
<li>Network/fetch guard: skip target DNS pinning when trusted env-proxy mode is active so proxy-only sandboxes can let the trusted proxy resolve outbound hosts. (#59007) Thanks @cluster2600.</li>
|
||||
</ul>
|
||||
<p><a href="https://github.com/openclaw/openclaw/blob/main/CHANGELOG.md">View full changelog</a></p>
|
||||
]]></description>
|
||||
<enclosure url="https://github.com/openclaw/openclaw/releases/download/v2026.4.8/OpenClaw-2026.4.8.zip" length="25324810" type="application/octet-stream" sparkle:edSignature="aogl3hJf+FeRvQj0W4WDGMQnIRPpxXPQam50U7SBT3ljA1CeSbIGsnaj20aLF0Qc9DikPEXt5AEg7LMOen4+BQ=="/>
|
||||
</item>
|
||||
<item>
|
||||
<title>2026.4.7</title>
|
||||
<pubDate>Wed, 08 Apr 2026 02:54:26 +0000</pubDate>
|
||||
<link>https://raw.githubusercontent.com/openclaw/openclaw/main/appcast.xml</link>
|
||||
<sparkle:version>2026040790</sparkle:version>
|
||||
<sparkle:shortVersionString>2026.4.7</sparkle:shortVersionString>
|
||||
<sparkle:minimumSystemVersion>15.0</sparkle:minimumSystemVersion>
|
||||
<description><![CDATA[<h2>OpenClaw 2026.4.7</h2>
|
||||
<h3>Changes</h3>
|
||||
<ul>
|
||||
<li>CLI/infer: add a first-class <code>openclaw infer ...</code> hub for provider-backed inference workflows across model, media, web, and embedding tasks. Thanks @Takhoffman.</li>
|
||||
<li>Tools/media generation: auto-fallback across auth-backed image, music, and video providers by default, preserve intent during provider switches, remap size/aspect/resolution/duration hints to the closest supported option, and surface provider capabilities plus mode-aware video-to-video support.</li>
|
||||
<li>Memory/wiki: restore the bundled <code>memory-wiki</code> stack with plugin, CLI, sync/query/apply tooling, memory-host integration, structured claim/evidence fields, compiled digest retrieval, claim-health linting, contradiction clustering, staleness dashboards, and freshness-weighted search. Thanks @vincentkoc.</li>
|
||||
<li>Plugins/webhooks: add a bundled webhook ingress plugin so external automation can create and drive bound TaskFlows through per-route shared-secret endpoints. (#61892) Thanks @mbelinky.</li>
|
||||
<li>Gateway/sessions: add persisted compaction checkpoints plus Sessions UI branch/restore actions so operators can inspect and recover pre-compaction session state. (#62146) Thanks @scoootscooob.</li>
|
||||
<li>Compaction: add pluggable compaction provider registry so plugins can replace the built-in summarization pipeline. Configure via <code>agents.defaults.compaction.provider</code>; falls back to LLM summarization on provider failure. (#56224) Thanks @DhruvBhatia0.</li>
|
||||
<li>Agents/system prompt: add <code>agents.defaults.systemPromptOverride</code> for controlled prompt experiments plus heartbeat prompt-section controls so heartbeat runtime behavior can stay enabled without injecting heartbeat instructions every turn.</li>
|
||||
<li>Providers/Google: add Gemma 4 model support and keep Google fallback resolution on the requested provider path so native Google Gemma routes work again. (#61507) Thanks @eyjohn.</li>
|
||||
<li>Providers/Google: preserve explicit thinking-off semantics for Gemma 4 while still enabling Gemma reasoning support in compatibility wrappers. (#62127) Thanks @romgenie.</li>
|
||||
<li>Providers/Arcee AI: add a bundled Arcee AI provider plugin with Trinity catalog entries, OpenRouter support, and updated onboarding/auth guidance. (#62068) Thanks @arthurbr11.</li>
|
||||
<li>Providers/Anthropic: restore Claude CLI as the preferred local Anthropic path in onboarding, model-auth guidance, doctor flows, and Docker Claude CLI live lanes again.</li>
|
||||
<li>Providers/Ollama: detect vision capability from the <code>/api/show</code> response and set image input on models that support it so Ollama vision models accept image attachments. (#62193) Thanks @BruceMacD.</li>
|
||||
<li>Memory/dreaming: ingest redacted session transcripts into the dreaming corpus with per-day session-corpus notes, cursor checkpointing, and promotion/doctor support. (#62227) Thanks @vignesh07.</li>
|
||||
<li>Providers/inferrs: add string-content compatibility for stricter OpenAI-compatible chat backends, document <code>inferrs</code> setup with a full config example, and add troubleshooting guidance for local backends that pass direct probes but fail on full agent-runtime prompts.</li>
|
||||
<li>Agents/context engine: expose prompt-cache runtime context to context engines and keep current-turn prompt-cache usage aligned with the active attempt instead of stale prior-turn assistant state. (#62179) Thanks @jalehman.</li>
|
||||
<li>Plugin SDK/context engines: pass <code>availableTools</code> and <code>citationsMode</code> into <code>assemble()</code>, and expose memory-artifact and memory-prompt seams so companion plugins and non-legacy context engines can consume active memory state without reaching into internals. Thanks @vincentkoc.</li>
|
||||
<li>ACP/ACPX plugin: bump the bundled <code>acpx</code> pin to <code>0.5.1</code> so plugin-local installs and strict version checks pick up the latest published runtime release. (#62148) Thanks @onutc.</li>
|
||||
<li>Discord/events: allow <code>event-create</code> to accept a cover image URL or local file path, load and validate PNG/JPG/GIF event cover media, and pass the encoded image payload through Discord admin action/runtime paths. (#60883) Thanks @bittoby.</li>
|
||||
</ul>
|
||||
<h3>Fixes</h3>
|
||||
<ul>
|
||||
<li>CLI/infer: keep provider-backed infer behavior aligned with actual runtime execution by fixing explicit TTS override handling, profile-aware gateway TTS prefs resolution, per-request transcription <code>prompt</code>/<code>language</code> overrides, image output MIME/extension mismatches, configured web-search fallback behavior, and agent-vs-CLI web-search execution drift.</li>
|
||||
<li>Plugins/media: when <code>plugins.allow</code> is set, capability fallback now merges bundled capability plugin ids into the allowlist (not only <code>plugins.entries</code>), so media understanding providers such as OpenAI-compatible STT load for voice transcription without requiring <code>openai</code> in <code>plugins.allow</code>. (#62205) Thanks @neeravmakwana.</li>
|
||||
<li>Agents/history and replies: buffer phaseless OpenAI WS text until a real assistant phase arrives, keep replay and SSE history sequence tracking aligned, hide commentary and leaked tool XML from user-visible history, and keep history-based follow-up replies on <code>final_answer</code> text only. (#61729, #61747, #61829, #61855, #61954) Thanks @100yenadmin and contributors.</li>
|
||||
<li>Control UI: show <code>/tts</code> audio replies in webchat, detect mistaken <code>?token=</code> auth links with the correct <code>#token=</code> hint, and keep Copy, Canvas, and mobile exec-approval UI from covering chat content on narrow screens. (#54842, #61514, #61598) Thanks @neeravmakwana.</li>
|
||||
<li>iOS/gateway: replace string-matched connection error UI with structured gateway connection problems, preserve actionable pairing/auth failures over later generic disconnect noise, and surface reusable problem banners and details across onboarding, settings, and root status surfaces. (#62650) Thanks @ngutman.</li>
|
||||
<li>TUI: route <code>/status</code> through the shared session-status command, keep commentary hidden in history, strip raw envelope metadata from async command notices, preserve fallback streaming before per-attempt failures finalize, and restore Kitty keyboard state on exit or fatal crashes. (#49130, #59985, #60043, #61463) Thanks @biefan and contributors.</li>
|
||||
<li>iOS/Watch exec approvals: keep Apple Watch review and approval recovery working while the iPhone is locked or backgrounded, including reconnect recovery, pending approval persistence, notification cleanup, and APNs-backed watch refresh recovery. (#61757) Thanks @ngutman.</li>
|
||||
<li>Agents/context overflow: combine oversized and aggregate tool-result recovery in one pass and restore a total-context overflow backstop so recoverable sessions retry instead of failing early. (#61651) Thanks @Takhoffman.</li>
|
||||
<li>Auth/OpenAI Codex OAuth: reload fresh on-disk credentials inside the locked refresh path and retry once after <code>refresh_token_reused</code> rotates only the stored refresh token, so relogin/restart recovery stops getting stuck on stale cached auth state. Thanks @owen-ever.</li>
|
||||
<li>Auth/OpenAI Codex OAuth: keep native <code>/model ...@profile</code> selections on the target session and honor explicit user-locked auth profiles even when per-agent auth order excludes them. (#62744) Thanks @jalehman.</li>
|
||||
<li>Providers/Anthropic: preserve thinking blocks for Claude Opus 4.5+, Sonnet 4.5+, and newer Claude 4-family models so prompt-cache prefixes keep matching, and skip <code>service_tier</code> injection on OAuth-authenticated stream wrapper requests so Claude OAuth streaming stops failing with HTTP 401. (#60356, #61793)</li>
|
||||
<li>Agents/Claude CLI: surface nested API error messages from structured CLI output so billing/auth/provider failures show the real provider error instead of an opaque CLI failure.</li>
|
||||
<li>Agents/exec: preserve explicit <code>host=node</code> routing under elevated defaults when <code>tools.exec.host=auto</code>, fail loud on invalid elevated cross-host overrides, and keep <code>strictInlineEval</code> commands blocked after approval timeouts instead of falling through to automatic execution. (#61739) Thanks @obviyus.</li>
|
||||
<li>Nodes/exec approvals: keep <code>host=node</code> POSIX transport shell wrappers (<code>/bin/sh -lc ...</code>) aligned with inner-command allowlist analysis so allowlisted scripts stop prompting unnecessarily, while Windows <code>cmd.exe</code> wrapper runs stay approval-gated. (#62401) Thanks @ngutman.</li>
|
||||
<li>Nodes/exec approvals: keep Windows <code>cmd.exe /c</code> wrapper runs approval-gated even when <code>env</code> carriers, including env-assignment carriers, wrap the shell invocation. (#62439) Thanks @ngutman.</li>
|
||||
<li>Gateway tool/exec config: block model-facing <code>gateway config.apply</code> and <code>config.patch</code> writes from changing exec approval paths such as <code>safeBins</code>, <code>safeBinProfiles</code>, <code>safeBinTrustedDirs</code>, and <code>strictInlineEval</code>, while still allowing unchanged structured values through. (#62001) Thanks @eleqtrizit.</li>
|
||||
<li>Host exec/env sanitization: block dangerous Java, Rust, Cargo, Git, Kubernetes, cloud credential, config-path, and Helm env overrides so host-run tools cannot be redirected to attacker-chosen code, config, credentials, or repository state. (#59119, #62002, #62291) Thanks @eleqtrizit and contributors.</li>
|
||||
<li>Commands/allowlist: require owner authorization for <code>/allowlist add</code> and <code>/allowlist remove</code> before channel resolution, so non-owner but command-authorized senders can no longer persistently rewrite allowlist policy state. (#62383) Thanks @pgondhi987.</li>
|
||||
<li>Feishu/docx uploads: honor <code>tools.fs.workspaceOnly</code> for local <code>upload_file</code> and <code>upload_image</code> paths by forwarding workspace-constrained <code>localRoots</code> into the media loader, so docx uploads can no longer read host-local files outside the workspace when workspace-only mode is active. (#62369) Thanks @pgondhi987.</li>
|
||||
<li>Network/fetch guard: drop request bodies and body-describing headers on cross-origin <code>307</code> and <code>308</code> redirects by default, so attacker-controlled redirect hops cannot receive secret-bearing POST payloads from SSRF-guarded fetch flows unless a caller explicitly opts in. (#62357) Thanks @pgondhi987.</li>
|
||||
<li>Browser/SSRF: treat main-frame <code>document</code> redirect hops as navigations even when Playwright does not flag them as <code>isNavigationRequest()</code>, so strict private-network blocking still stops forbidden redirect pivots before the browser reaches the internal target. (#62355) Thanks @pgondhi987.</li>
|
||||
<li>Browser/node invoke: block persistent browser profile create, reset, and delete mutations through <code>browser.proxy</code> on both gateway-forwarded <code>node.invoke</code> and the node-host proxy path, even when no profile allowlist is configured. (#60489)</li>
|
||||
<li>Gateway/node pairing: require a fresh pairing request when a previously paired node reconnects with additional declared commands, and keep the live session pinned to the earlier approved command set until the upgrade is approved. (#62658) Thanks @eleqtrizit.</li>
|
||||
<li>Gateway/auth: invalidate existing shared-token and password WebSocket sessions when the configured secret rotates, so stale authenticated sockets cannot stay attached after token or password changes. (#62350) Thanks @pgondhi987.</li>
|
||||
<li>MS Teams/security: validate file-consent upload URLs against HTTPS, Microsoft/SharePoint host allowlists, and private-IP DNS checks before uploading attachments, blocking SSRF-style consent-upload abuse. (#23596)</li>
|
||||
<li>Media/base64 decode guards: enforce byte limits before decoding missed base64-backed Teams, Signal, QQ Bot, and image-tool payloads so oversized inbound media and data URLs no longer bypass pre-decode size checks. (#62007) Thanks @eleqtrizit.</li>
|
||||
<li>Runtime event trust: mark background <code>notifyOnExit</code> summaries, ACP parent-stream relays, and wake-hook payloads as untrusted system events so lower-trust runtime output no longer re-enters later turns as trusted <code>System:</code> text. (#62003)</li>
|
||||
<li>Auto-reply/media: allow managed generated-media <code>MEDIA:</code> paths from normal reply text again while still blocking arbitrary host-local media and document paths, so generated media keep delivering without reopening host-path injection holes.</li>
|
||||
<li>Gateway/status and containers: auto-bind to <code>0.0.0.0</code> inside Docker and Podman environments, and probe local TLS gateways over <code>wss://</code> with self-signed fingerprint forwarding so container startup and loopback TLS status checks work again. (#61818, #61935) Thanks @openperf and contributors.</li>
|
||||
<li>Gateway/OpenAI-compatible HTTP: abort in-flight <code>/v1/chat/completions</code> and <code>/v1/responses</code> turns when clients disconnect so abandoned HTTP requests stop wasting agent runtime. (#54388) Thanks @Lellansin.</li>
|
||||
<li>macOS/gateway version: strip trailing commit metadata from CLI version output before semver parsing so the Mac app recognizes installed gateway versions like <code>OpenClaw 2026.4.2 (d74a122)</code> again. (#61111) Thanks @oliviareid-svg.</li>
|
||||
<li>Sessions/model selection: resolve the explicitly selected session model separately from runtime fallback resolution so session status and live model switching stay aligned with the chosen model.</li>
|
||||
<li>Discord/ACP bindings: canonicalize DM conversation identity across inbound messages, component interactions, native commands, and current-conversation binding resolution so <code>--bind here</code> in Discord DMs keeps routing follow-up replies to the bound agent instead of falling back to the default agent.</li>
|
||||
<li>Discord: recover forwarded referenced message text and attachments when snapshots are missing, use <code>ws://</code> again for gateway monitor sockets, stop forcing a hardcoded temperature for Codex-backed auto-thread titles, and harden voice receive recovery so rapid speaker restarts keep their next utterance. (#41536, #61670) Thanks @artwalker and contributors.</li>
|
||||
<li>Slack/thread mentions: add <code>channels.slack.thread.requireExplicitMention</code> so Slack channels that already require mentions can also require explicit <code>@bot</code> mentions inside bot-participated threads. (#58276) Thanks @praktika-engineer.</li>
|
||||
<li>Slack/threading: keep legacy thread stickiness for real replies when older callers omit <code>isThreadReply</code>, while still honoring <code>replyToMode</code> for Slack's auto-created top-level <code>thread_ts</code>. (#61835) Thanks @kaonash.</li>
|
||||
<li>Slack/media: keep attachment downloads on the SSRF-guarded dispatcher path so Slack media fetching works on Node 22 without dropping pinned transport enforcement. (#62239) Thanks @openperf.</li>
|
||||
<li>Matrix/onboarding: add an invite auto-join setup step with explicit off warnings and strict stable-target validation so new Matrix accounts stop silently ignoring invited rooms and fresh DM-style invites unless operators opt in. (#62168) Thanks @gumadeiras.</li>
|
||||
<li>Matrix/formatting: preserve multi-paragraph and loose-list rendering in Element so numbered and bulleted Markdown keeps their content attached to the correct list item. (#60997) Thanks @gucasbrg.</li>
|
||||
<li>Telegram/doctor: keep top-level access-control fallback in place during multi-account normalization while still promoting legacy default auth into <code>accounts.default</code>, so existing named bots keep inherited allowlists without dropping the legacy default bot. (#62263) Thanks @obviyus.</li>
|
||||
<li>Plugins/loaders: centralize bundled <code>dist/**</code> Jiti native-load policy and keep channel, public-surface, facade, and config-metadata loader seams off native Jiti on Windows so onboarding and configure flows stop tripping <code>ERR_UNSUPPORTED_ESM_URL_SCHEME</code>. (#62286) Thanks @chen-zhang-cs-code.</li>
|
||||
<li>Plugins/channels: keep bundled channel artifact and secret-contract loading stable under lazy loading, preserve plugin-schema defaults during install, and fix Windows <code>file://</code> plus native-Jiti plugin loader paths so onboarding, doctor, <code>openclaw secret</code>, and bundled plugin installs work again. (#61832, #61836, #61853, #61856) Thanks @Zeesejo and contributors.</li>
|
||||
<li>Plugins/ClawHub: verify downloaded plugin archives against version metadata SHA-256, fail closed when archive integrity metadata is missing or malformed, and tighten fallback ZIP verification so plugin installs cannot proceed on mismatched or incomplete ClawHub package metadata. (#60517) Thanks @mappel-nv.</li>
|
||||
<li>Plugins/provider hooks: stop recursive provider snapshot loads from overflowing the stack during plugin initialization, while still preserving cached nested provider-hook results. (#61922, #61938, #61946, #61951)</li>
|
||||
<li>Docker/plugins: stop forcing bundled plugin discovery to <code>/app/extensions</code> in runtime images so packaged installs use compiled <code>dist/extensions</code> artifacts again and Node 24 containers do not boot through source-only plugin entry paths. Fixes #62044. (#62316) Thanks @gumadeiras.</li>
|
||||
<li>Providers/Ollama: honor the selected provider's <code>baseUrl</code> during streaming so multi-Ollama setups stop routing every stream to the first configured Ollama endpoint. (#61678)</li>
|
||||
<li>Providers/Ollama: stop warning that Ollama could not be reached when discovery only sees empty default local stubs, while still keeping real explicit Ollama overrides loud when the endpoint is unreachable.</li>
|
||||
<li>Providers/xAI: recognize <code>api.grok.x.ai</code> as an xAI-native endpoint again and keep legacy <code>x_search</code> auth resolution working so older xAI web-search configs continue to load. (#61377) Thanks @jjjojoj.</li>
|
||||
<li>Providers/Mistral: send <code>reasoning_effort</code> for <code>mistral/mistral-small-latest</code> (Mistral Small 4) with thinking-level mapping, and mark the catalog entry as reasoning-capable so adjustable reasoning matches Mistral’s Chat Completions API. (#62162) Thanks @neeravmakwana.</li>
|
||||
<li>OpenAI TTS/Groq: send <code>wav</code> to Groq-compatible speech endpoints, honor explicit <code>responseFormat</code> overrides on OpenAI-compatible paths, and only mark voice-note output as voice-compatible when the actual format is <code>opus</code>. (#62233) Thanks @neeravmakwana.</li>
|
||||
<li>Tools/web_fetch and web_search: fix <code>TypeError: fetch failed</code> caused by undici 8.0 enabling HTTP/2 by default; pinned SSRF-guard dispatchers now explicitly set <code>allowH2: false</code> to restore HTTP/1.1 behavior and keep the custom DNS-pinning lookup compatible. (#61738, #61777) Thanks @zozo123.</li>
|
||||
<li>Tools/web search/Exa: show Exa Search in onboarding and configure provider pickers again by marking the bundled Exa provider as setup-visible. Thanks @vincentkoc.</li>
|
||||
<li>Memory/vector recall: surface explicit warnings when <code>sqlite-vec</code> is unavailable or vector writes are degraded, and strip managed Light Sleep and REM blocks before daily-note ingestion so memory indexing and dreaming stop reporting false-success or re-ingesting staged output. (#61720) Thanks @MonkeyLeeT.</li>
|
||||
<li>Memory/dreaming: make Dreams config reads and writes respect the selected memory slot plugin instead of always targeting <code>memory-core</code>. (#62275) Thanks @SnowSky1.</li>
|
||||
<li>QQ Bot/media: route gateway-side attachment and fallback downloads through guarded QQ/Tencent HTTPS fetches so QQ media handling no longer follows arbitrary remote hosts.</li>
|
||||
<li>Browser/remote CDP: retry the DevTools websocket once after remote browser restarts so healthy remote browser profiles do not fail availability checks during CDP warm-up. (#57397) Thanks @ThanhNguyxn07.</li>
|
||||
<li>UI/light mode: target both root and nested WebKit scrollbar thumbs in the light theme so page-level and container scrollbars stay visible on light backgrounds. (#61753) Thanks @chziyue.</li>
|
||||
<li>Agents/subagents: honor <code>sessions_spawn(lightContext: true)</code> for spawned subagent runs by preserving lightweight bootstrap context through the gateway and embedded runner instead of silently falling back to full workspace bootstrap injection. (#62264) Thanks @theSamPadilla.</li>
|
||||
<li>Cron: load <code>jobId</code> into <code>id</code> when the on-disk store omits <code>id</code>, matching doctor migration and fixing <code>unknown cron job id</code> for hand-edited <code>jobs.json</code>. (#62246) Thanks @neeravmakwana.</li>
|
||||
<li>Agents/model fallback: classify minimal HTTP 404 API errors (for example <code>404 status code (no body)</code>) as <code>model_not_found</code> so assistant failures throw into the fallback chain instead of stopping at the first fallback candidate. (#62119) Thanks @neeravmakwana.</li>
|
||||
<li>BlueBubbles/network: respect explicit private-network opt-out for loopback and private <code>serverUrl</code> values across account resolution, status probes, monitor startup, and attachment downloads, while keeping public-host attachment hostname pinning intact. (#59373) Thanks @jpreagan.</li>
|
||||
<li>Agents/heartbeat: keep heartbeat runs pinned to the main session so active subagent transcripts are not overwritten by heartbeat status messages. (#61803) Thanks @100yenadmin.</li>
|
||||
<li>Agents/heartbeat: respect disabled heartbeat prompt guidance so operators can suppress heartbeat prompt instructions without disabling heartbeat runtime behavior.</li>
|
||||
<li>Agents/compaction: stop compaction-wait aborts from re-entering prompt failover and replaying completed tool turns. (#62600) Thanks @i-dentifier.</li>
|
||||
<li>Approvals/runtime: move native approval lifecycle assembly into shared core bootstrap/runtime seams driven by channel capabilities and runtime contexts, and remove the legacy bundled approval fallback wiring. (#62135) Thanks @gumadeiras.</li>
|
||||
<li>Security/fetch-guard: stop rejecting operator-configured proxy hostnames against the target-scoped hostname allowlist in SSRF-guarded fetches, restoring proxy-based media downloads for Telegram and other channels. (#62312) Thanks @ademczuk.</li>
|
||||
<li>Logging: make <code>logging.level</code> and <code>logging.consoleLevel</code> honor the documented severity threshold ordering again, and keep child loggers inheriting the parent <code>minLevel</code>. (#44646) Thanks @zhumengzhu.</li>
|
||||
<li>Agents/sessions_send: pass <code>threadId</code> through announce delivery so cross-session notifications land in the correct Telegram forum topic instead of the group's general thread. (#62758) Thanks @jalehman.</li>
|
||||
<li>Daemon/systemd: keep sudo systemctl calls scoped to the invoking user when machine-scoped systemctl fails, while still avoiding machine fallback for permission-denied user bus errors. (#62337) Thanks @Aftabbs.</li>
|
||||
<li>Docs/i18n: relocalize final localized-page links after translation and remove the zh-CN homepage redirect override so localized Mintlify pages resolve to the correct language roots again. (#61796) Thanks @hxy91819.</li>
|
||||
<li>Agents/exec: keep timed-out shell-backgrounded commands on the failed path and point long-running jobs to exec background/yield sessions so process polling is only suggested for registered sessions.</li>
|
||||
</ul>
|
||||
<p><a href="https://github.com/openclaw/openclaw/blob/main/CHANGELOG.md">View full changelog</a></p>
|
||||
]]></description>
|
||||
<enclosure url="https://github.com/openclaw/openclaw/releases/download/v2026.4.7/OpenClaw-2026.4.7.zip" length="25324827" type="application/octet-stream" sparkle:edSignature="RyFWRz1trE/qvOiInD4vR6je9wx7fUTtHpZ94W8rMlZDByux9CyXOm/Anai96b9KyjTeQyC7YnJp5SRnYY3iCg=="/>
|
||||
</item>
|
||||
</channel>
|
||||
</rss>
|
||||
@@ -65,8 +65,8 @@ android {
|
||||
applicationId = "ai.openclaw.app"
|
||||
minSdk = 31
|
||||
targetSdk = 36
|
||||
versionCode = 2026041101
|
||||
versionName = "2026.4.11"
|
||||
versionCode = 2026041001
|
||||
versionName = "2026.4.10"
|
||||
ndk {
|
||||
// Support all major ABIs — native libs are tiny (~47 KB per ABI)
|
||||
abiFilters += listOf("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
# OpenClaw iOS Changelog
|
||||
|
||||
## 2026.4.11 - 2026-04-11
|
||||
## Unreleased
|
||||
|
||||
Maintenance update for the current OpenClaw release.
|
||||
### Added
|
||||
|
||||
### Changed
|
||||
|
||||
### Fixed
|
||||
|
||||
## 2026.4.10 - 2026-04-10
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Source of truth: apps/ios/version.json
|
||||
// Generated by scripts/ios-sync-versioning.ts.
|
||||
|
||||
OPENCLAW_IOS_VERSION = 2026.4.11
|
||||
OPENCLAW_MARKETING_VERSION = 2026.4.11
|
||||
OPENCLAW_IOS_VERSION = 2026.4.10
|
||||
OPENCLAW_MARKETING_VERSION = 2026.4.10
|
||||
OPENCLAW_BUILD_VERSION = 1
|
||||
|
||||
#include? "../build/Version.xcconfig"
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"version": "2026.4.11"
|
||||
"version": "2026.4.10"
|
||||
}
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>2026.4.11</string>
|
||||
<string>2026.4.10</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>2026041101</string>
|
||||
<string>2026041001</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>OpenClaw</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
|
||||
@@ -11,40 +11,6 @@ enum ShellExecutor {
|
||||
var errorMessage: String?
|
||||
}
|
||||
|
||||
private final class CompletionBox: @unchecked Sendable {
|
||||
private let lock = NSLock()
|
||||
private var finished = false
|
||||
private let continuation: CheckedContinuation<ShellResult, Never>
|
||||
|
||||
init(continuation: CheckedContinuation<ShellResult, Never>) {
|
||||
self.continuation = continuation
|
||||
}
|
||||
|
||||
func finish(_ result: ShellResult) {
|
||||
self.lock.lock()
|
||||
defer { self.lock.unlock() }
|
||||
guard !self.finished else { return }
|
||||
self.finished = true
|
||||
self.continuation.resume(returning: result)
|
||||
}
|
||||
}
|
||||
|
||||
private static func completedResult(
|
||||
status: Int,
|
||||
outTask: Task<Data, Never>,
|
||||
errTask: Task<Data, Never>) async -> ShellResult
|
||||
{
|
||||
let out = await outTask.value
|
||||
let err = await errTask.value
|
||||
return ShellResult(
|
||||
stdout: String(bytes: out, encoding: .utf8) ?? "",
|
||||
stderr: String(bytes: err, encoding: .utf8) ?? "",
|
||||
exitCode: status,
|
||||
timedOut: false,
|
||||
success: status == 0,
|
||||
errorMessage: status == 0 ? nil : "exit \(status)")
|
||||
}
|
||||
|
||||
static func runDetailed(
|
||||
command: [String],
|
||||
cwd: String?,
|
||||
@@ -72,53 +38,6 @@ enum ShellExecutor {
|
||||
process.standardOutput = stdoutPipe
|
||||
process.standardError = stderrPipe
|
||||
|
||||
let outTask = Task { stdoutPipe.fileHandleForReading.readToEndSafely() }
|
||||
let errTask = Task { stderrPipe.fileHandleForReading.readToEndSafely() }
|
||||
|
||||
if let timeout, timeout > 0 {
|
||||
return await withCheckedContinuation { continuation in
|
||||
let completion = CompletionBox(continuation: continuation)
|
||||
|
||||
process.terminationHandler = { terminatedProcess in
|
||||
let status = Int(terminatedProcess.terminationStatus)
|
||||
Task {
|
||||
let result = await self.completedResult(
|
||||
status: status,
|
||||
outTask: outTask,
|
||||
errTask: errTask)
|
||||
completion.finish(result)
|
||||
}
|
||||
}
|
||||
|
||||
do {
|
||||
try process.run()
|
||||
} catch {
|
||||
completion.finish(
|
||||
ShellResult(
|
||||
stdout: "",
|
||||
stderr: "",
|
||||
exitCode: nil,
|
||||
timedOut: false,
|
||||
success: false,
|
||||
errorMessage: "failed to start: \(error.localizedDescription)"))
|
||||
return
|
||||
}
|
||||
|
||||
DispatchQueue.global(qos: .userInitiated).asyncAfter(deadline: .now() + timeout) {
|
||||
guard process.isRunning else { return }
|
||||
process.terminate()
|
||||
completion.finish(
|
||||
ShellResult(
|
||||
stdout: "",
|
||||
stderr: "",
|
||||
exitCode: nil,
|
||||
timedOut: true,
|
||||
success: false,
|
||||
errorMessage: "timeout"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
do {
|
||||
try process.run()
|
||||
} catch {
|
||||
@@ -131,11 +50,48 @@ enum ShellExecutor {
|
||||
errorMessage: "failed to start: \(error.localizedDescription)")
|
||||
}
|
||||
|
||||
process.waitUntilExit()
|
||||
return await self.completedResult(
|
||||
status: Int(process.terminationStatus),
|
||||
outTask: outTask,
|
||||
errTask: errTask)
|
||||
let outTask = Task { stdoutPipe.fileHandleForReading.readToEndSafely() }
|
||||
let errTask = Task { stderrPipe.fileHandleForReading.readToEndSafely() }
|
||||
|
||||
let waitTask = Task { () -> ShellResult in
|
||||
process.waitUntilExit()
|
||||
let out = await outTask.value
|
||||
let err = await errTask.value
|
||||
let status = Int(process.terminationStatus)
|
||||
return ShellResult(
|
||||
stdout: String(bytes: out, encoding: .utf8) ?? "",
|
||||
stderr: String(bytes: err, encoding: .utf8) ?? "",
|
||||
exitCode: status,
|
||||
timedOut: false,
|
||||
success: status == 0,
|
||||
errorMessage: status == 0 ? nil : "exit \(status)")
|
||||
}
|
||||
|
||||
if let timeout, timeout > 0 {
|
||||
let nanos = UInt64(timeout * 1_000_000_000)
|
||||
return await withTaskGroup(of: ShellResult.self) { group in
|
||||
group.addTask { await waitTask.value }
|
||||
group.addTask {
|
||||
try? await Task.sleep(nanoseconds: nanos)
|
||||
guard process.isRunning else {
|
||||
return await waitTask.value
|
||||
}
|
||||
process.terminate()
|
||||
return ShellResult(
|
||||
stdout: "",
|
||||
stderr: "",
|
||||
exitCode: nil,
|
||||
timedOut: true,
|
||||
success: false,
|
||||
errorMessage: "timeout")
|
||||
}
|
||||
let first = await group.next()!
|
||||
group.cancelAll()
|
||||
return first
|
||||
}
|
||||
}
|
||||
|
||||
return await waitTask.value
|
||||
}
|
||||
|
||||
static func run(command: [String], cwd: String?, env: [String: String]?, timeout: Double?) async -> Response {
|
||||
|
||||
@@ -128,9 +128,8 @@ actor TalkModeRuntime {
|
||||
private func start() async {
|
||||
let gen = self.lifecycleGeneration
|
||||
guard voiceWakeSupported else { return }
|
||||
|
||||
guard await PermissionManager.ensureVoiceWakePermissions(interactive: true) else {
|
||||
self.logger.error("talk runtime not starting: permissions missing")
|
||||
guard PermissionManager.voiceWakePermissionsGranted() else {
|
||||
self.logger.debug("talk runtime not starting: permissions missing")
|
||||
return
|
||||
}
|
||||
await self.reloadConfig()
|
||||
|
||||
@@ -401,60 +401,6 @@ public struct AgentEvent: Codable, Sendable {
|
||||
}
|
||||
}
|
||||
|
||||
public struct MessageActionParams: Codable, Sendable {
|
||||
public let channel: String
|
||||
public let action: String
|
||||
public let params: [String: AnyCodable]
|
||||
public let accountid: String?
|
||||
public let requestersenderid: String?
|
||||
public let senderisowner: Bool?
|
||||
public let sessionkey: String?
|
||||
public let sessionid: String?
|
||||
public let agentid: String?
|
||||
public let toolcontext: [String: AnyCodable]?
|
||||
public let idempotencykey: String
|
||||
|
||||
public init(
|
||||
channel: String,
|
||||
action: String,
|
||||
params: [String: AnyCodable],
|
||||
accountid: String?,
|
||||
requestersenderid: String?,
|
||||
senderisowner: Bool?,
|
||||
sessionkey: String?,
|
||||
sessionid: String?,
|
||||
agentid: String?,
|
||||
toolcontext: [String: AnyCodable]?,
|
||||
idempotencykey: String)
|
||||
{
|
||||
self.channel = channel
|
||||
self.action = action
|
||||
self.params = params
|
||||
self.accountid = accountid
|
||||
self.requestersenderid = requestersenderid
|
||||
self.senderisowner = senderisowner
|
||||
self.sessionkey = sessionkey
|
||||
self.sessionid = sessionid
|
||||
self.agentid = agentid
|
||||
self.toolcontext = toolcontext
|
||||
self.idempotencykey = idempotencykey
|
||||
}
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
case channel
|
||||
case action
|
||||
case params
|
||||
case accountid = "accountId"
|
||||
case requestersenderid = "requesterSenderId"
|
||||
case senderisowner = "senderIsOwner"
|
||||
case sessionkey = "sessionKey"
|
||||
case sessionid = "sessionId"
|
||||
case agentid = "agentId"
|
||||
case toolcontext = "toolContext"
|
||||
case idempotencykey = "idempotencyKey"
|
||||
}
|
||||
}
|
||||
|
||||
public struct SendParams: Codable, Sendable {
|
||||
public let to: String
|
||||
public let message: String?
|
||||
|
||||
@@ -401,60 +401,6 @@ public struct AgentEvent: Codable, Sendable {
|
||||
}
|
||||
}
|
||||
|
||||
public struct MessageActionParams: Codable, Sendable {
|
||||
public let channel: String
|
||||
public let action: String
|
||||
public let params: [String: AnyCodable]
|
||||
public let accountid: String?
|
||||
public let requestersenderid: String?
|
||||
public let senderisowner: Bool?
|
||||
public let sessionkey: String?
|
||||
public let sessionid: String?
|
||||
public let agentid: String?
|
||||
public let toolcontext: [String: AnyCodable]?
|
||||
public let idempotencykey: String
|
||||
|
||||
public init(
|
||||
channel: String,
|
||||
action: String,
|
||||
params: [String: AnyCodable],
|
||||
accountid: String?,
|
||||
requestersenderid: String?,
|
||||
senderisowner: Bool?,
|
||||
sessionkey: String?,
|
||||
sessionid: String?,
|
||||
agentid: String?,
|
||||
toolcontext: [String: AnyCodable]?,
|
||||
idempotencykey: String)
|
||||
{
|
||||
self.channel = channel
|
||||
self.action = action
|
||||
self.params = params
|
||||
self.accountid = accountid
|
||||
self.requestersenderid = requestersenderid
|
||||
self.senderisowner = senderisowner
|
||||
self.sessionkey = sessionkey
|
||||
self.sessionid = sessionid
|
||||
self.agentid = agentid
|
||||
self.toolcontext = toolcontext
|
||||
self.idempotencykey = idempotencykey
|
||||
}
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
case channel
|
||||
case action
|
||||
case params
|
||||
case accountid = "accountId"
|
||||
case requestersenderid = "requesterSenderId"
|
||||
case senderisowner = "senderIsOwner"
|
||||
case sessionkey = "sessionKey"
|
||||
case sessionid = "sessionId"
|
||||
case agentid = "agentId"
|
||||
case toolcontext = "toolContext"
|
||||
case idempotencykey = "idempotencyKey"
|
||||
}
|
||||
}
|
||||
|
||||
public struct SendParams: Codable, Sendable {
|
||||
public let to: String
|
||||
public let message: String?
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
614f0fc957a944978989de9b98429d2540e8f1b33b925a0148acd265490922ed config-baseline.json
|
||||
fb6f0ef881fb591d2791d2adca43c7e88d48f8b562457683092ab6e767aece78 config-baseline.core.json
|
||||
228031f16ad06580bfd137f092d70d03f2796515e723b8b6618ed69d285465fa config-baseline.json
|
||||
bad0a5bb247a62b8fb9ed9fc2b2720eacf3e0913077ac351b5d26ae2723335ad config-baseline.core.json
|
||||
e1f94346a8507ce3dec763b598e79f3bb89ff2e33189ce977cc87d3b05e71c1d config-baseline.channel.json
|
||||
6c19997f1fb2aff4315f2cb9c7d9e299b403fbc0f9e78e3412cc7fe1c655f222 config-baseline.plugin.json
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
f0d71b70eb54d67fdc35dde8a5051e527c8a910b7b981f5075d78a5160dd08fa plugin-sdk-api-baseline.json
|
||||
e305bb63072efa680951babd1eb1f419e9965d8a4bdabfc9bf3cafe24a8551df plugin-sdk-api-baseline.jsonl
|
||||
ee16273fa5ad8c5408e9dad8d96fde86dfa666ef8eb44840b78135814ff97173 plugin-sdk-api-baseline.json
|
||||
2bd0d5edf23e6a889d6bedb74d0d06411dd7750dac6ebf24971c789f8a69253a plugin-sdk-api-baseline.jsonl
|
||||
|
||||
@@ -62,18 +62,6 @@ Timestamps without a timezone are treated as UTC. Add `--tz America/New_York` fo
|
||||
|
||||
Recurring top-of-hour expressions are automatically staggered by up to 5 minutes to reduce load spikes. Use `--exact` to force precise timing or `--stagger 30s` for an explicit window.
|
||||
|
||||
### Day-of-month and day-of-week use OR logic
|
||||
|
||||
Cron expressions are parsed by [croner](https://github.com/Hexagon/croner). When both the day-of-month and day-of-week fields are non-wildcard, croner matches when **either** field matches — not both. This is standard Vixie cron behavior.
|
||||
|
||||
```
|
||||
# Intended: "9 AM on the 15th, only if it's a Monday"
|
||||
# Actual: "9 AM on every 15th, AND 9 AM on every Monday"
|
||||
0 9 15 * 1
|
||||
```
|
||||
|
||||
This fires ~5–6 times per month instead of 0–1 times per month. OpenClaw uses Croner's default OR behavior here. To require both conditions, use Croner's `+` day-of-week modifier (`0 9 15 * +1`) or schedule on one field and guard the other in your job's prompt or command.
|
||||
|
||||
## Execution styles
|
||||
|
||||
| Style | `--session` value | Runs in | Best for |
|
||||
|
||||
@@ -1,216 +0,0 @@
|
||||
---
|
||||
summary: "Configure Discord Activities to launch the OpenClaw Canvas surface"
|
||||
read_when:
|
||||
- Discord plugin setup is already working and you want Activities
|
||||
- You need exact Discord Developer Portal URL mapping values
|
||||
title: "Discord Activities"
|
||||
---
|
||||
|
||||
# Discord Activities
|
||||
|
||||
Status: ready for Activity-hosted Canvas (`/__openclaw__/canvas/`).
|
||||
|
||||
This page assumes your [Discord](/channels/discord) channel setup is already complete.
|
||||
|
||||
## Public HTTPS requirement
|
||||
|
||||
Discord Activities must load from a **public HTTPS URL**.
|
||||
|
||||
Not supported for Activity launch:
|
||||
|
||||
- `http://localhost:...`
|
||||
- `http://192.168.x.x:...`
|
||||
- `http://10.x.x.x:...`
|
||||
- hostnames that are only reachable inside your home/LAN
|
||||
|
||||
Use an internet-reachable HTTPS host for your gateway.
|
||||
|
||||
Where this is documented elsewhere:
|
||||
|
||||
- [Tailscale (Serve and Funnel)](/gateway/tailscale)
|
||||
- [Web bind and security modes](/web)
|
||||
- [Google Chat public URL examples (Serve/Funnel + proxy patterns)](/channels/googlechat#public-url-webhook-only)
|
||||
|
||||
## Quick setup
|
||||
|
||||
<Steps>
|
||||
<Step title="Open your existing Discord app">
|
||||
Go to [Discord Developer Portal](https://discord.com/developers/applications) and open the same app you already use for OpenClaw Discord.
|
||||
</Step>
|
||||
|
||||
<Step title="Enable Activities">
|
||||
Open **Activities > Settings** and turn on **Enable Activities**.
|
||||
|
||||
Under **Supported Platforms**, enable the platforms you plan to test:
|
||||
|
||||
- Web
|
||||
- Desktop
|
||||
- iOS
|
||||
- Android
|
||||
|
||||
</Step>
|
||||
|
||||
<Step title="Configure URL mappings">
|
||||
Open **Activities > URL Mappings** and add:
|
||||
|
||||
| PREFIX | TARGET |
|
||||
| --- | --- |
|
||||
| `/` | `<your-gateway-host>/__openclaw__/canvas` |
|
||||
|
||||
Example:
|
||||
|
||||
| PREFIX | TARGET |
|
||||
| --- | --- |
|
||||
| `/` | `gateway.example.com/__openclaw__/canvas` |
|
||||
|
||||
Rules:
|
||||
|
||||
- TARGET must not include protocol.
|
||||
- Correct: `gateway.example.com/__openclaw__/canvas`
|
||||
- Wrong: `https://gateway.example.com/__openclaw__/canvas`
|
||||
- Keep `/` as the fallback mapping.
|
||||
- If you add more mappings, place longer prefixes before `/`.
|
||||
- Do not point `/` at gateway root alone, or Discord Activity launch will open the Control UI path instead of Canvas.
|
||||
|
||||
</Step>
|
||||
|
||||
<Step title="Enable Activity-scoped auth in OpenClaw (required)">
|
||||
Discord Activity iframes cannot send your normal Gateway bearer token.
|
||||
|
||||
In your OpenClaw config, set:
|
||||
|
||||
```json5
|
||||
{
|
||||
canvasHost: {
|
||||
activity: {
|
||||
enabled: true,
|
||||
// Optional shared token gate for activity requests.
|
||||
token: "<long-random-token>",
|
||||
// Optional override. Default is true; set false only for legacy/manual testing flows.
|
||||
requireLaunchContext: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
This keeps normal Gateway auth in place while allowing Activity-scoped Canvas access.
|
||||
|
||||
</Step>
|
||||
|
||||
<Step title="Set Activity launch URL">
|
||||
Use this Activity URL:
|
||||
|
||||
- `https://<your-gateway-host>/`
|
||||
|
||||
Discord launches at `/`, and URL mapping should rewrite that path to `/__openclaw__/canvas`.
|
||||
|
||||
If `canvasHost.activity.token` is set, include `activityToken=<token>` in your mapped target or preserve it through your edge rewrite.
|
||||
|
||||
Agents can still render A2UI experiences inside Canvas when needed.
|
||||
|
||||
</Step>
|
||||
|
||||
<Step title="Optional: add a launch button in Discord messages">
|
||||
Discord component buttons support:
|
||||
|
||||
- `action: "launch-activity"`
|
||||
|
||||
Example:
|
||||
|
||||
```json
|
||||
{
|
||||
"label": "Open Activity",
|
||||
"style": "primary",
|
||||
"action": "launch-activity"
|
||||
}
|
||||
```
|
||||
|
||||
Notes:
|
||||
|
||||
- `launch-activity` works from guild channels.
|
||||
- It is not valid on link-style buttons.
|
||||
- In OpenClaw agent replies, prefer `message` tool helper `activityLaunchButton=true` for this action.
|
||||
|
||||
</Step>
|
||||
|
||||
<Step title="Optional: use OpenClaw Discord SDK helpers inside Canvas pages">
|
||||
Hosted Canvas pages auto-inject a Discord helper in Activity context:
|
||||
|
||||
- `window.OpenClaw.discord` (alias: `window.openclawDiscord`)
|
||||
|
||||
Common usage:
|
||||
|
||||
```js
|
||||
await OpenClaw.discord.load();
|
||||
await OpenClaw.discord.commands.openShareMomentDialog({ mediaUrl: "https://..." });
|
||||
await OpenClaw.discord.commands.openExternalLink("https://docs.openclaw.ai");
|
||||
|
||||
const auth = await OpenClaw.discord.oauth.authorize({
|
||||
client_id: "<discord-app-id>",
|
||||
response_type: "code",
|
||||
scope: ["identify", "guilds"],
|
||||
prompt: "none",
|
||||
state: "example-state",
|
||||
});
|
||||
// exchange auth.code on your backend, then:
|
||||
await OpenClaw.discord.oauth.authenticate({ access_token: "<app-access-token>" });
|
||||
```
|
||||
|
||||
</Step>
|
||||
|
||||
<Step title="Verify before debugging client behavior">
|
||||
|
||||
```bash
|
||||
curl -I "https://<your-gateway-host>/__openclaw__/canvas/"
|
||||
```
|
||||
|
||||
Expected:
|
||||
|
||||
- HTTP `200`
|
||||
- `text/html` response
|
||||
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Activity does not appear in the shelf
|
||||
|
||||
- Confirm **Enable Activities** is on.
|
||||
- Confirm current platform is enabled in **Supported Platforms**.
|
||||
- Confirm app is installed in the context you are testing (guild/user install).
|
||||
|
||||
### Activity opens but shows 404 or blank page
|
||||
|
||||
- Confirm URL mapping is `PREFIX /` -> `TARGET <gateway-host>/__openclaw__/canvas`.
|
||||
- Confirm TARGET has no protocol.
|
||||
- Confirm gateway host is publicly reachable over HTTPS.
|
||||
- Confirm you are not using an internal-only address.
|
||||
- Confirm reverse proxy preserves `/__openclaw__/canvas/` path.
|
||||
|
||||
### Launch button says Activities are unavailable
|
||||
|
||||
- Confirm interaction came from a guild channel (not DM/group DM).
|
||||
- Confirm Activities are enabled in the Developer Portal app.
|
||||
|
||||
### Activity opens but immediately fails auth
|
||||
|
||||
- Confirm `canvasHost.activity.enabled` is `true`.
|
||||
- If `canvasHost.activity.token` is set, confirm the request carries `activityToken=<token>` and the token matches exactly.
|
||||
- `canvasHost.activity.requireLaunchContext` is enabled by default; confirm launch context params (for example `instance_id`) are present on initial launch. Set it to `false` only if you intentionally allow direct/manual opens.
|
||||
|
||||
## Developer Portal quick links
|
||||
|
||||
- Applications: `https://discord.com/developers/applications`
|
||||
- Activities settings: `https://discord.com/developers/applications/<app-id>/embedded/settings`
|
||||
- Activities URL mappings: `https://discord.com/developers/applications/<app-id>/embedded/url-mappings`
|
||||
- Installation: `https://discord.com/developers/applications/<app-id>/installation`
|
||||
|
||||
## Related
|
||||
|
||||
- [Discord](/channels/discord)
|
||||
- [Chat Channels](/channels)
|
||||
- [Nodes and Canvas A2UI](/nodes)
|
||||
- [Tailscale](/gateway/tailscale)
|
||||
- [Web](/web)
|
||||
- Discord docs: [Activities Overview](https://docs.discord.com/developers/activities/overview)
|
||||
@@ -9,16 +9,13 @@ title: "Discord"
|
||||
|
||||
Status: ready for DMs and guild channels via the official Discord gateway.
|
||||
|
||||
<CardGroup cols={4}>
|
||||
<CardGroup cols={3}>
|
||||
<Card title="Pairing" icon="link" href="/channels/pairing">
|
||||
Discord DMs default to pairing mode.
|
||||
</Card>
|
||||
<Card title="Slash commands" icon="terminal" href="/tools/slash-commands">
|
||||
Native command behavior and command catalog.
|
||||
</Card>
|
||||
<Card title="Discord Activities" icon="gamepad-2" href="/channels/discord-activities">
|
||||
Host OpenClaw Canvas in a Discord Activity iframe.
|
||||
</Card>
|
||||
<Card title="Channel troubleshooting" icon="wrench" href="/channels/troubleshooting">
|
||||
Cross-channel diagnostics and repair flow.
|
||||
</Card>
|
||||
@@ -546,18 +543,6 @@ Use `bindings[].match.roles` to route Discord guild members to different agents
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## Discord Activities
|
||||
|
||||
OpenClaw uses a single Canvas entrypoint for Discord Activities:
|
||||
|
||||
- `/__openclaw__/canvas/`
|
||||
|
||||
Use a public HTTPS host (not internal-only LAN URLs), and enable Activity-scoped auth (`canvasHost.activity.*`) so Activity iframe traffic is authorized without exposing normal Gateway auth.
|
||||
|
||||
Agents can still render A2UI experiences inside Canvas when needed.
|
||||
|
||||
See the full guide: [Discord Activities](/channels/discord-activities).
|
||||
|
||||
## Native commands and command auth
|
||||
|
||||
- `commands.native` defaults to `"auto"` and is enabled for Discord.
|
||||
@@ -1269,7 +1254,6 @@ High-signal Discord fields:
|
||||
## Related
|
||||
|
||||
- [Pairing](/channels/pairing)
|
||||
- [Discord Activities](/channels/discord-activities)
|
||||
- [Groups](/channels/groups)
|
||||
- [Channel routing](/channels/channel-routing)
|
||||
- [Security](/gateway/security)
|
||||
|
||||
@@ -14,7 +14,7 @@ Text is supported everywhere; media and reactions vary by channel.
|
||||
## Supported channels
|
||||
|
||||
- [BlueBubbles](/channels/bluebubbles) — **Recommended for iMessage**; uses the BlueBubbles macOS server REST API with full feature support (bundled plugin; edit, unsend, effects, reactions, group management — edit currently broken on macOS 26 Tahoe).
|
||||
- [Discord](/channels/discord) — Discord Bot API + Gateway; supports servers, channels, DMs, and an Activity-hosted Canvas surface.
|
||||
- [Discord](/channels/discord) — Discord Bot API + Gateway; supports servers, channels, and DMs.
|
||||
- [Feishu](/channels/feishu) — Feishu/Lark bot via WebSocket (bundled plugin).
|
||||
- [Google Chat](/channels/googlechat) — Google Chat API app via HTTP webhook.
|
||||
- [iMessage (legacy)](/channels/imessage) — Legacy macOS integration via imsg CLI (deprecated, use BlueBubbles for new setups).
|
||||
|
||||
@@ -9,7 +9,7 @@ title: "Microsoft Teams"
|
||||
|
||||
> "Abandon all hope, ye who enter here."
|
||||
|
||||
Updated: 2026-03-25
|
||||
Updated: 2026-01-21
|
||||
|
||||
Status: text + DM attachments are supported; channel/group file sending requires `sharePointSiteId` + Graph permissions (see [Sending files in group chats](#sending-files-in-group-chats)). Polls are sent via Adaptive Cards. Message actions expose explicit `upload-file` for file-first sends.
|
||||
|
||||
@@ -43,7 +43,7 @@ Details: [Plugins](/tools/plugin)
|
||||
4. Expose `/api/messages` (port 3978 by default) via a public URL or tunnel.
|
||||
5. Install the Teams app package and start the gateway.
|
||||
|
||||
Minimal config (client secret):
|
||||
Minimal config:
|
||||
|
||||
```json5
|
||||
{
|
||||
@@ -59,8 +59,6 @@ Minimal config (client secret):
|
||||
}
|
||||
```
|
||||
|
||||
For production deployments, consider using [federated authentication](#federated-authentication-certificate--managed-identity) (certificate or managed identity) instead of client secrets.
|
||||
|
||||
Note: group chats are blocked by default (`channels.msteams.groupPolicy: "allowlist"`). To allow group replies, set `channels.msteams.groupAllowFrom` (or use `groupPolicy: "open"` to allow any member, mention-gated).
|
||||
|
||||
## Goals
|
||||
@@ -192,148 +190,6 @@ Before configuring OpenClaw, you need to create an Azure Bot resource.
|
||||
2. Click **Microsoft Teams** → Configure → Save
|
||||
3. Accept the Terms of Service
|
||||
|
||||
## Federated Authentication (Certificate + Managed Identity)
|
||||
|
||||
> Added in 2026.3.24
|
||||
|
||||
For production deployments, OpenClaw supports **federated authentication** as a more secure alternative to client secrets. Two methods are available:
|
||||
|
||||
### Option A: Certificate-based authentication
|
||||
|
||||
Use a PEM certificate registered with your Entra ID app registration.
|
||||
|
||||
**Setup:**
|
||||
|
||||
1. Generate or obtain a certificate (PEM format with private key).
|
||||
2. In Entra ID → App Registration → **Certificates & secrets** → **Certificates** → Upload the public certificate.
|
||||
|
||||
**Config:**
|
||||
|
||||
```json5
|
||||
{
|
||||
channels: {
|
||||
msteams: {
|
||||
enabled: true,
|
||||
appId: "<APP_ID>",
|
||||
tenantId: "<TENANT_ID>",
|
||||
authType: "federated",
|
||||
certificatePath: "/path/to/cert.pem",
|
||||
webhook: { port: 3978, path: "/api/messages" },
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
**Env vars:**
|
||||
|
||||
- `MSTEAMS_AUTH_TYPE=federated`
|
||||
- `MSTEAMS_CERTIFICATE_PATH=/path/to/cert.pem`
|
||||
|
||||
### Option B: Azure Managed Identity
|
||||
|
||||
Use Azure Managed Identity for passwordless authentication. This is ideal for deployments on Azure infrastructure (AKS, App Service, Azure VMs) where a managed identity is available.
|
||||
|
||||
**How it works:**
|
||||
|
||||
1. The bot pod/VM has a managed identity (system-assigned or user-assigned).
|
||||
2. A **federated identity credential** links the managed identity to the Entra ID app registration.
|
||||
3. At runtime, OpenClaw uses `@azure/identity` to acquire tokens from the Azure IMDS endpoint (`169.254.169.254`).
|
||||
4. The token is passed to the Teams SDK for bot authentication.
|
||||
|
||||
**Prerequisites:**
|
||||
|
||||
- Azure infrastructure with managed identity enabled (AKS workload identity, App Service, VM)
|
||||
- Federated identity credential created on the Entra ID app registration
|
||||
- Network access to IMDS (`169.254.169.254:80`) from the pod/VM
|
||||
|
||||
**Config (system-assigned managed identity):**
|
||||
|
||||
```json5
|
||||
{
|
||||
channels: {
|
||||
msteams: {
|
||||
enabled: true,
|
||||
appId: "<APP_ID>",
|
||||
tenantId: "<TENANT_ID>",
|
||||
authType: "federated",
|
||||
useManagedIdentity: true,
|
||||
webhook: { port: 3978, path: "/api/messages" },
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
**Config (user-assigned managed identity):**
|
||||
|
||||
```json5
|
||||
{
|
||||
channels: {
|
||||
msteams: {
|
||||
enabled: true,
|
||||
appId: "<APP_ID>",
|
||||
tenantId: "<TENANT_ID>",
|
||||
authType: "federated",
|
||||
useManagedIdentity: true,
|
||||
managedIdentityClientId: "<MI_CLIENT_ID>",
|
||||
webhook: { port: 3978, path: "/api/messages" },
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
**Env vars:**
|
||||
|
||||
- `MSTEAMS_AUTH_TYPE=federated`
|
||||
- `MSTEAMS_USE_MANAGED_IDENTITY=true`
|
||||
- `MSTEAMS_MANAGED_IDENTITY_CLIENT_ID=<client-id>` (only for user-assigned)
|
||||
|
||||
### AKS Workload Identity Setup
|
||||
|
||||
For AKS deployments using workload identity:
|
||||
|
||||
1. **Enable workload identity** on your AKS cluster.
|
||||
2. **Create a federated identity credential** on the Entra ID app registration:
|
||||
|
||||
```bash
|
||||
az ad app federated-credential create --id <APP_OBJECT_ID> --parameters '{
|
||||
"name": "my-bot-workload-identity",
|
||||
"issuer": "<AKS_OIDC_ISSUER_URL>",
|
||||
"subject": "system:serviceaccount:<NAMESPACE>:<SERVICE_ACCOUNT>",
|
||||
"audiences": ["api://AzureADTokenExchange"]
|
||||
}'
|
||||
```
|
||||
|
||||
3. **Annotate the Kubernetes service account** with the app client ID:
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: my-bot-sa
|
||||
annotations:
|
||||
azure.workload.identity/client-id: "<APP_CLIENT_ID>"
|
||||
```
|
||||
|
||||
4. **Label the pod** for workload identity injection:
|
||||
|
||||
```yaml
|
||||
metadata:
|
||||
labels:
|
||||
azure.workload.identity/use: "true"
|
||||
```
|
||||
|
||||
5. **Ensure network access** to IMDS (`169.254.169.254`) — if using NetworkPolicy, add an egress rule allowing traffic to `169.254.169.254/32` on port 80.
|
||||
|
||||
### Auth type comparison
|
||||
|
||||
| Method | Config | Pros | Cons |
|
||||
| -------------------- | ---------------------------------------------- | ---------------------------------- | ------------------------------------- |
|
||||
| **Client secret** | `appPassword` | Simple setup | Secret rotation required, less secure |
|
||||
| **Certificate** | `authType: "federated"` + `certificatePath` | No shared secret over network | Certificate management overhead |
|
||||
| **Managed Identity** | `authType: "federated"` + `useManagedIdentity` | Passwordless, no secrets to manage | Azure infrastructure required |
|
||||
|
||||
**Default behavior:** When `authType` is not set, OpenClaw defaults to client secret authentication. Existing configurations continue to work without changes.
|
||||
|
||||
## Local Development (Tunneling)
|
||||
|
||||
Teams can't reach `localhost`. Use a tunnel for local development:
|
||||
@@ -423,11 +279,6 @@ This is often easier than hand-editing JSON manifests.
|
||||
- `MSTEAMS_APP_ID`
|
||||
- `MSTEAMS_APP_PASSWORD`
|
||||
- `MSTEAMS_TENANT_ID`
|
||||
- `MSTEAMS_AUTH_TYPE` (optional: `"secret"` or `"federated"`)
|
||||
- `MSTEAMS_CERTIFICATE_PATH` (federated + certificate)
|
||||
- `MSTEAMS_CERTIFICATE_THUMBPRINT` (optional, not required for auth)
|
||||
- `MSTEAMS_USE_MANAGED_IDENTITY` (federated + managed identity)
|
||||
- `MSTEAMS_MANAGED_IDENTITY_CLIENT_ID` (user-assigned MI only)
|
||||
|
||||
5. **Bot endpoint**
|
||||
- Set the Azure Bot Messaging Endpoint to:
|
||||
@@ -641,11 +492,6 @@ Key settings (see `/gateway/configuration` for shared channel patterns):
|
||||
- `toolsBySender` keys should use explicit prefixes:
|
||||
`id:`, `e164:`, `username:`, `name:` (legacy unprefixed keys still map to `id:` only).
|
||||
- `channels.msteams.actions.memberInfo`: enable or disable the Graph-backed member info action (default: enabled when Graph credentials are available).
|
||||
- `channels.msteams.authType`: authentication type — `"secret"` (default) or `"federated"`.
|
||||
- `channels.msteams.certificatePath`: path to PEM certificate file (federated + certificate auth).
|
||||
- `channels.msteams.certificateThumbprint`: certificate thumbprint (optional, not required for auth).
|
||||
- `channels.msteams.useManagedIdentity`: enable managed identity auth (federated mode).
|
||||
- `channels.msteams.managedIdentityClientId`: client ID for user-assigned managed identity.
|
||||
- `channels.msteams.sharePointSiteId`: SharePoint site ID for file uploads in group chats/channels (see [Sending files in group chats](#sending-files-in-group-chats)).
|
||||
|
||||
## Routing & Sessions
|
||||
|
||||
@@ -283,274 +283,6 @@ openclaw gateway
|
||||
</Tabs>
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="Optional native slash commands">
|
||||
|
||||
Multiple [native slash commands](#commands-and-slash-behavior) can be used instead of a single configured command with nuance:
|
||||
|
||||
- Use `/agentstatus` instead of `/status` because the `/status` command is reserved.
|
||||
- No more than 25 slash commands can be made available at once.
|
||||
|
||||
Replace your existing `features.slash_commands` section with a subset of [available commands](/tools/slash-commands#command-list):
|
||||
|
||||
<Tabs>
|
||||
<Tab title="Socket Mode (default)">
|
||||
|
||||
```json
|
||||
"slash_commands": [
|
||||
{
|
||||
"command": "/new",
|
||||
"description": "Start a new session",
|
||||
"usage_hint": "[model]"
|
||||
},
|
||||
{
|
||||
"command": "/reset",
|
||||
"description": "Reset the current session"
|
||||
},
|
||||
{
|
||||
"command": "/compact",
|
||||
"description": "Compact the session context",
|
||||
"usage_hint": "[instructions]"
|
||||
},
|
||||
{
|
||||
"command": "/stop",
|
||||
"description": "Stop the current run"
|
||||
},
|
||||
{
|
||||
"command": "/session",
|
||||
"description": "Manage thread-binding expiry",
|
||||
"usage_hint": "idle <duration|off> or max-age <duration|off>"
|
||||
},
|
||||
{
|
||||
"command": "/think",
|
||||
"description": "Set the thinking level",
|
||||
"usage_hint": "<off|minimal|low|medium|high|xhigh>"
|
||||
},
|
||||
{
|
||||
"command": "/verbose",
|
||||
"description": "Toggle verbose output",
|
||||
"usage_hint": "on|off|full"
|
||||
},
|
||||
{
|
||||
"command": "/fast",
|
||||
"description": "Show or set fast mode",
|
||||
"usage_hint": "[status|on|off]"
|
||||
},
|
||||
{
|
||||
"command": "/reasoning",
|
||||
"description": "Toggle reasoning visibility",
|
||||
"usage_hint": "[on|off|stream]"
|
||||
},
|
||||
{
|
||||
"command": "/elevated",
|
||||
"description": "Toggle elevated mode",
|
||||
"usage_hint": "[on|off|ask|full]"
|
||||
},
|
||||
{
|
||||
"command": "/exec",
|
||||
"description": "Show or set exec defaults",
|
||||
"usage_hint": "host=<auto|sandbox|gateway|node> security=<deny|allowlist|full> ask=<off|on-miss|always> node=<id>"
|
||||
},
|
||||
{
|
||||
"command": "/model",
|
||||
"description": "Show or set the model",
|
||||
"usage_hint": "[name|#|status]"
|
||||
},
|
||||
{
|
||||
"command": "/models",
|
||||
"description": "List providers or models for a provider",
|
||||
"usage_hint": "[provider] [page] [limit=<n>|size=<n>|all]"
|
||||
},
|
||||
{
|
||||
"command": "/help",
|
||||
"description": "Show the short help summary"
|
||||
},
|
||||
{
|
||||
"command": "/commands",
|
||||
"description": "Show the generated command catalog"
|
||||
},
|
||||
{
|
||||
"command": "/tools",
|
||||
"description": "Show what the current agent can use right now",
|
||||
"usage_hint": "[compact|verbose]"
|
||||
},
|
||||
{
|
||||
"command": "/agentstatus",
|
||||
"description": "Show runtime status, including provider usage/quota when available"
|
||||
},
|
||||
{
|
||||
"command": "/tasks",
|
||||
"description": "List active/recent background tasks for the current session"
|
||||
},
|
||||
{
|
||||
"command": "/context",
|
||||
"description": "Explain how context is assembled",
|
||||
"usage_hint": "[list|detail|json]"
|
||||
},
|
||||
{
|
||||
"command": "/whoami",
|
||||
"description": "Show your sender identity"
|
||||
},
|
||||
{
|
||||
"command": "/skill",
|
||||
"description": "Run a skill by name",
|
||||
"usage_hint": "<name> [input]"
|
||||
},
|
||||
{
|
||||
"command": "/btw",
|
||||
"description": "Ask a side question without changing session context",
|
||||
"usage_hint": "<question>"
|
||||
},
|
||||
{
|
||||
"command": "/usage",
|
||||
"description": "Control the usage footer or show cost summary",
|
||||
"usage_hint": "off|tokens|full|cost"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab title="HTTP Request URLs">
|
||||
|
||||
```json
|
||||
"slash_commands": [
|
||||
{
|
||||
"command": "/new",
|
||||
"description": "Start a new session",
|
||||
"usage_hint": "[model]",
|
||||
"url": "https://gateway-host.example.com/slack/events"
|
||||
},
|
||||
{
|
||||
"command": "/reset",
|
||||
"description": "Reset the current session",
|
||||
"url": "https://gateway-host.example.com/slack/events"
|
||||
},
|
||||
{
|
||||
"command": "/compact",
|
||||
"description": "Compact the session context",
|
||||
"usage_hint": "[instructions]",
|
||||
"url": "https://gateway-host.example.com/slack/events"
|
||||
},
|
||||
{
|
||||
"command": "/stop",
|
||||
"description": "Stop the current run",
|
||||
"url": "https://gateway-host.example.com/slack/events"
|
||||
},
|
||||
{
|
||||
"command": "/session",
|
||||
"description": "Manage thread-binding expiry",
|
||||
"usage_hint": "idle <duration|off> or max-age <duration|off>",
|
||||
"url": "https://gateway-host.example.com/slack/events"
|
||||
},
|
||||
{
|
||||
"command": "/think",
|
||||
"description": "Set the thinking level",
|
||||
"usage_hint": "<off|minimal|low|medium|high|xhigh>",
|
||||
"url": "https://gateway-host.example.com/slack/events"
|
||||
},
|
||||
{
|
||||
"command": "/verbose",
|
||||
"description": "Toggle verbose output",
|
||||
"usage_hint": "on|off|full",
|
||||
"url": "https://gateway-host.example.com/slack/events"
|
||||
},
|
||||
{
|
||||
"command": "/fast",
|
||||
"description": "Show or set fast mode",
|
||||
"usage_hint": "[status|on|off]",
|
||||
"url": "https://gateway-host.example.com/slack/events"
|
||||
},
|
||||
{
|
||||
"command": "/reasoning",
|
||||
"description": "Toggle reasoning visibility",
|
||||
"usage_hint": "[on|off|stream]",
|
||||
"url": "https://gateway-host.example.com/slack/events"
|
||||
},
|
||||
{
|
||||
"command": "/elevated",
|
||||
"description": "Toggle elevated mode",
|
||||
"usage_hint": "[on|off|ask|full]",
|
||||
"url": "https://gateway-host.example.com/slack/events"
|
||||
},
|
||||
{
|
||||
"command": "/exec",
|
||||
"description": "Show or set exec defaults",
|
||||
"usage_hint": "host=<auto|sandbox|gateway|node> security=<deny|allowlist|full> ask=<off|on-miss|always> node=<id>",
|
||||
"url": "https://gateway-host.example.com/slack/events"
|
||||
},
|
||||
{
|
||||
"command": "/model",
|
||||
"description": "Show or set the model",
|
||||
"usage_hint": "[name|#|status]",
|
||||
"url": "https://gateway-host.example.com/slack/events"
|
||||
},
|
||||
{
|
||||
"command": "/models",
|
||||
"description": "List providers or models for a provider",
|
||||
"usage_hint": "[provider] [page] [limit=<n>|size=<n>|all]",
|
||||
"url": "https://gateway-host.example.com/slack/events"
|
||||
},
|
||||
{
|
||||
"command": "/help",
|
||||
"description": "Show the short help summary",
|
||||
"url": "https://gateway-host.example.com/slack/events"
|
||||
},
|
||||
{
|
||||
"command": "/commands",
|
||||
"description": "Show the generated command catalog",
|
||||
"url": "https://gateway-host.example.com/slack/events"
|
||||
},
|
||||
{
|
||||
"command": "/tools",
|
||||
"description": "Show what the current agent can use right now",
|
||||
"usage_hint": "[compact|verbose]",
|
||||
"url": "https://gateway-host.example.com/slack/events"
|
||||
},
|
||||
{
|
||||
"command": "/agentstatus",
|
||||
"description": "Show runtime status, including provider usage/quota when available",
|
||||
"url": "https://gateway-host.example.com/slack/events"
|
||||
},
|
||||
{
|
||||
"command": "/tasks",
|
||||
"description": "List active/recent background tasks for the current session",
|
||||
"url": "https://gateway-host.example.com/slack/events"
|
||||
},
|
||||
{
|
||||
"command": "/context",
|
||||
"description": "Explain how context is assembled",
|
||||
"usage_hint": "[list|detail|json]",
|
||||
"url": "https://gateway-host.example.com/slack/events"
|
||||
},
|
||||
{
|
||||
"command": "/whoami",
|
||||
"description": "Show your sender identity",
|
||||
"url": "https://gateway-host.example.com/slack/events"
|
||||
},
|
||||
{
|
||||
"command": "/skill",
|
||||
"description": "Run a skill by name",
|
||||
"usage_hint": "<name> [input]",
|
||||
"url": "https://gateway-host.example.com/slack/events"
|
||||
},
|
||||
{
|
||||
"command": "/btw",
|
||||
"description": "Ask a side question without changing session context",
|
||||
"usage_hint": "<question>",
|
||||
"url": "https://gateway-host.example.com/slack/events"
|
||||
},
|
||||
{
|
||||
"command": "/usage",
|
||||
"description": "Control the usage footer or show cost summary",
|
||||
"usage_hint": "off|tokens|full|cost",
|
||||
"url": "https://gateway-host.example.com/slack/events"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
</Accordion>
|
||||
<Accordion title="Optional authorship scopes (write operations)">
|
||||
Add the `chat:write.customize` bot scope if you want outgoing messages to use the active agent identity (custom username and icon) instead of the default Slack app identity.
|
||||
|
||||
@@ -804,37 +536,30 @@ Notes:
|
||||
|
||||
## Commands and slash behavior
|
||||
|
||||
Slash commands appear in Slack as either a single configured command or multiple native commands. Configure `channels.slack.slashCommand` to change command defaults:
|
||||
- Native command auto-mode is **off** for Slack (`commands.native: "auto"` does not enable Slack native commands).
|
||||
- Enable native Slack command handlers with `channels.slack.commands.native: true` (or global `commands.native: true`).
|
||||
- When native commands are enabled, register matching slash commands in Slack (`/<command>` names), with one exception:
|
||||
- register `/agentstatus` for the status command (Slack reserves `/status`)
|
||||
- If native commands are not enabled, you can run a single configured slash command via `channels.slack.slashCommand`.
|
||||
- Native arg menus now adapt their rendering strategy:
|
||||
- up to 5 options: button blocks
|
||||
- 6-100 options: static select menu
|
||||
- more than 100 options: external select with async option filtering when interactivity options handlers are available
|
||||
- if encoded option values exceed Slack limits, the flow falls back to buttons
|
||||
- For long option payloads, Slash command argument menus use a confirm dialog before dispatching a selected value.
|
||||
|
||||
Default slash command settings:
|
||||
|
||||
- `enabled: false`
|
||||
- `name: "openclaw"`
|
||||
- `sessionPrefix: "slack:slash"`
|
||||
- `ephemeral: true`
|
||||
|
||||
```txt
|
||||
/openclaw /help
|
||||
```
|
||||
Slash sessions use isolated keys:
|
||||
|
||||
Native commands require [manifest changes](#optional-native-slash-commands) to your Slack app and are enabled with `channels.slack.commands.native: true` or `commands.native: true` in global configurations instead.
|
||||
- `agent:<agentId>:slack:slash:<userId>`
|
||||
|
||||
- Native command auto-mode is **off** for Slack so `commands.native: "auto"` does not enable Slack native commands.
|
||||
|
||||
```txt
|
||||
/help
|
||||
```
|
||||
|
||||
Native argument menus use an adaptive rendering strategy that shows a confirmation modal before dispatching a selected option value:
|
||||
|
||||
- up to 5 options: button blocks
|
||||
- 6-100 options: static select menu
|
||||
- more than 100 options: external select with async option filtering when interactivity options handlers are available
|
||||
- exceeded Slack limits: encoded option values fall back to buttons
|
||||
|
||||
```txt
|
||||
/think
|
||||
```
|
||||
|
||||
Slash sessions use isolated keys like `agent:<agentId>:slack:slash:<userId>` and still route command executions to the target conversation session using `CommandTargetSessionKey`.
|
||||
and still route command execution against the target conversation session (`CommandTargetSessionKey`).
|
||||
|
||||
## Interactive replies
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ self-contained, safe-default setup:
|
||||
enabled: true,
|
||||
agents: ["main"],
|
||||
allowedChatTypes: ["direct"],
|
||||
modelFallback: "google/gemini-3-flash",
|
||||
modelFallbackPolicy: "default-remote",
|
||||
queryMode: "recent",
|
||||
promptStyle: "balanced",
|
||||
timeoutMs: 15000,
|
||||
@@ -51,7 +51,7 @@ self-contained, safe-default setup:
|
||||
|
||||
This turns the plugin on for the `main` agent, keeps it limited to direct-message
|
||||
style sessions by default, lets it inherit the current session model first, and
|
||||
uses the configured fallback model only if no explicit or inherited model is
|
||||
still allows the built-in remote fallback if no explicit or inherited model is
|
||||
available.
|
||||
|
||||
After that, restart the gateway:
|
||||
@@ -85,7 +85,7 @@ Start with this in `openclaw.json`:
|
||||
config: {
|
||||
agents: ["main"],
|
||||
allowedChatTypes: ["direct"],
|
||||
modelFallback: "google/gemini-3-flash",
|
||||
modelFallbackPolicy: "default-remote",
|
||||
queryMode: "recent",
|
||||
promptStyle: "balanced",
|
||||
timeoutMs: 15000,
|
||||
@@ -111,7 +111,7 @@ What this means:
|
||||
- `config.agents: ["main"]` opts only the `main` agent into active memory
|
||||
- `config.allowedChatTypes: ["direct"]` keeps active memory on for direct-message style sessions only by default
|
||||
- if `config.model` is unset, active memory inherits the current session model first
|
||||
- `config.modelFallback` optionally provides your own fallback provider/model for recall
|
||||
- `config.modelFallbackPolicy: "default-remote"` keeps the built-in remote fallback as the default when no explicit or inherited model is available
|
||||
- `config.promptStyle: "balanced"` uses the default general-purpose prompt style for `recent` mode
|
||||
- active memory still runs only on eligible interactive persistent chat sessions
|
||||
|
||||
@@ -335,22 +335,26 @@ If `config.model` is unset, Active Memory tries to resolve a model in this order
|
||||
explicit plugin model
|
||||
-> current session model
|
||||
-> agent primary model
|
||||
-> optional configured fallback model
|
||||
-> optional built-in remote fallback
|
||||
```
|
||||
|
||||
`config.modelFallback` controls the configured fallback step.
|
||||
`config.modelFallbackPolicy` controls the last step.
|
||||
|
||||
Optional custom fallback:
|
||||
Default:
|
||||
|
||||
```json5
|
||||
modelFallback: "google/gemini-3-flash"
|
||||
modelFallbackPolicy: "default-remote"
|
||||
```
|
||||
|
||||
If no explicit, inherited, or configured fallback model resolves, Active Memory
|
||||
skips recall for that turn.
|
||||
Other option:
|
||||
|
||||
`config.modelFallbackPolicy` is retained only as a deprecated compatibility
|
||||
field for older configs. It no longer changes runtime behavior.
|
||||
```json5
|
||||
modelFallbackPolicy: "resolved-only"
|
||||
```
|
||||
|
||||
Use `resolved-only` if you want Active Memory to skip recall instead of falling
|
||||
back to the built-in remote default when no explicit or inherited model is
|
||||
available.
|
||||
|
||||
## Advanced escape hatches
|
||||
|
||||
|
||||
@@ -110,12 +110,9 @@ heartbeats are disabled for the default agent or
|
||||
files concise — especially `MEMORY.md`, which can grow over time and lead to
|
||||
unexpectedly high context usage and more frequent compaction.
|
||||
|
||||
> **Note:** `memory/*.md` daily files are **not** part of the normal bootstrap
|
||||
> Project Context. On ordinary turns they are accessed on demand via the
|
||||
> `memory_search` and `memory_get` tools, so they do not count against the
|
||||
> context window unless the model explicitly reads them. Bare `/new` and
|
||||
> `/reset` turns are the exception: the runtime can prepend recent daily memory
|
||||
> as a one-shot startup-context block for that first turn.
|
||||
> **Note:** `memory/*.md` daily files are **not** injected automatically. They
|
||||
> are accessed on demand via the `memory_search` and `memory_get` tools, so they
|
||||
> do not count against the context window unless the model explicitly reads them.
|
||||
|
||||
Large files are truncated with a marker. The max per-file size is controlled by
|
||||
`agents.defaults.bootstrapMaxChars` (default: 20000). Total injected bootstrap
|
||||
|
||||
@@ -1006,7 +1006,6 @@
|
||||
"pages": [
|
||||
"channels/bluebubbles",
|
||||
"channels/discord",
|
||||
"channels/discord-activities",
|
||||
"channels/feishu",
|
||||
"channels/googlechat",
|
||||
"channels/imessage",
|
||||
|
||||
@@ -2895,8 +2895,6 @@ See [Plugins](/tools/plugin).
|
||||
enabled: true,
|
||||
basePath: "/openclaw",
|
||||
// root: "dist/control-ui",
|
||||
// embedSandbox: "scripts", // strict | scripts | trusted
|
||||
// allowExternalEmbedUrls: false, // dangerous: allow absolute external http(s) embed URLs
|
||||
// allowedOrigins: ["https://control.example.com"], // required for non-loopback Control UI
|
||||
// dangerouslyAllowHostHeaderOriginFallback: false, // dangerous Host-header origin fallback mode
|
||||
// allowInsecureAuth: false,
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
# GPT-5.4 / Codex Parity Maintainer Notes
|
||||
|
||||
This note explains how to review the GPT-5.4 / Codex parity program as four merge units without losing the original six-contract architecture.
|
||||
|
||||
## Merge units
|
||||
|
||||
### PR A: strict-agentic execution
|
||||
|
||||
Owns:
|
||||
|
||||
- `executionContract`
|
||||
- GPT-5-first same-turn follow-through
|
||||
- `update_plan` as non-terminal progress tracking
|
||||
- explicit blocked states instead of plan-only silent stops
|
||||
|
||||
Does not own:
|
||||
|
||||
- auth/runtime failure classification
|
||||
- permission truthfulness
|
||||
- replay/continuation redesign
|
||||
- parity benchmarking
|
||||
|
||||
### PR B: runtime truthfulness
|
||||
|
||||
Owns:
|
||||
|
||||
- Codex OAuth scope correctness
|
||||
- typed provider/runtime failure classification
|
||||
- truthful `/elevated full` availability and blocked reasons
|
||||
|
||||
Does not own:
|
||||
|
||||
- tool schema normalization
|
||||
- replay/liveness state
|
||||
- benchmark gating
|
||||
|
||||
### PR C: execution correctness
|
||||
|
||||
Owns:
|
||||
|
||||
- provider-owned OpenAI/Codex tool compatibility
|
||||
- parameter-free strict schema handling
|
||||
- replay-invalid surfacing
|
||||
- paused, blocked, and abandoned long-task state visibility
|
||||
|
||||
Does not own:
|
||||
|
||||
- self-elected continuation
|
||||
- generic Codex dialect behavior outside provider hooks
|
||||
- benchmark gating
|
||||
|
||||
### PR D: parity harness
|
||||
|
||||
Owns:
|
||||
|
||||
- first-wave GPT-5.4 vs Opus 4.6 scenario pack
|
||||
- parity documentation
|
||||
- parity report and release-gate mechanics
|
||||
|
||||
Does not own:
|
||||
|
||||
- runtime behavior changes outside QA-lab
|
||||
- auth/proxy/DNS simulation inside the harness
|
||||
|
||||
## Mapping back to the original six contracts
|
||||
|
||||
| Original contract | Merge unit |
|
||||
| ---------------------------------------- | ---------- |
|
||||
| Provider transport/auth correctness | PR B |
|
||||
| Tool contract/schema compatibility | PR C |
|
||||
| Same-turn execution | PR A |
|
||||
| Permission truthfulness | PR B |
|
||||
| Replay/continuation/liveness correctness | PR C |
|
||||
| Benchmark/release gate | PR D |
|
||||
|
||||
## Review order
|
||||
|
||||
1. PR A
|
||||
2. PR B
|
||||
3. PR C
|
||||
4. PR D
|
||||
|
||||
PR D is the proof layer. It should not be the reason runtime-correctness PRs are delayed.
|
||||
|
||||
## What to look for
|
||||
|
||||
### PR A
|
||||
|
||||
- GPT-5 runs act or fail closed instead of stopping at commentary
|
||||
- `update_plan` no longer looks like progress by itself
|
||||
- behavior stays GPT-5-first and embedded-Pi scoped
|
||||
|
||||
### PR B
|
||||
|
||||
- auth/proxy/runtime failures stop collapsing into generic “model failed” handling
|
||||
- `/elevated full` is only described as available when it is actually available
|
||||
- blocked reasons are visible to both the model and the user-facing runtime
|
||||
|
||||
### PR C
|
||||
|
||||
- strict OpenAI/Codex tool registration behaves predictably
|
||||
- parameter-free tools do not fail strict schema checks
|
||||
- replay and compaction outcomes preserve truthful liveness state
|
||||
|
||||
### PR D
|
||||
|
||||
- the scenario pack is understandable and reproducible
|
||||
- the pack includes a mutating replay-safety lane, not only read-only flows
|
||||
- reports are readable by humans and automation
|
||||
- parity claims are evidence-backed, not anecdotal
|
||||
|
||||
Expected artifacts from PR D:
|
||||
|
||||
- `qa-suite-report.md` / `qa-suite-summary.json` for each model run
|
||||
- `qa-agentic-parity-report.md` with aggregate and scenario-level comparison
|
||||
- `qa-agentic-parity-summary.json` with a machine-readable verdict
|
||||
|
||||
## Release gate
|
||||
|
||||
Do not claim GPT-5.4 parity or superiority over Opus 4.6 until:
|
||||
|
||||
- PR A, PR B, and PR C are merged
|
||||
- PR D runs the first-wave parity pack cleanly
|
||||
- runtime-truthfulness regression suites remain green
|
||||
- the parity report shows no fake-success cases and no regression in stop behavior
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
A["PR A-C merged"] --> B["Run GPT-5.4 parity pack"]
|
||||
A --> C["Run Opus 4.6 parity pack"]
|
||||
B --> D["qa-suite-summary.json"]
|
||||
C --> E["qa-suite-summary.json"]
|
||||
D --> F["qa parity-report"]
|
||||
E --> F
|
||||
F --> G["Markdown report + JSON verdict"]
|
||||
G --> H{"Pass?"}
|
||||
H -- "yes" --> I["Parity claim allowed"]
|
||||
H -- "no" --> J["Keep runtime fixes / review loop open"]
|
||||
```
|
||||
|
||||
The parity harness is not the only evidence source. Keep this split explicit in review:
|
||||
|
||||
- PR D owns the scenario-based GPT-5.4 vs Opus 4.6 comparison
|
||||
- PR B deterministic suites still own auth/proxy/DNS and full-access truthfulness evidence
|
||||
|
||||
## Goal-to-evidence map
|
||||
|
||||
| Completion gate item | Primary owner | Review artifact |
|
||||
| ---------------------------------------- | ------------- | ------------------------------------------------------------------- |
|
||||
| No plan-only stalls | PR A | strict-agentic runtime tests and `approval-turn-tool-followthrough` |
|
||||
| No fake progress or fake tool completion | PR A + PR D | parity fake-success count plus scenario-level report details |
|
||||
| No false `/elevated full` guidance | PR B | deterministic runtime-truthfulness suites |
|
||||
| Replay/liveness failures remain explicit | PR C + PR D | lifecycle/replay suites plus `compaction-retry-mutating-tool` |
|
||||
| GPT-5.4 matches or beats Opus 4.6 | PR D | `qa-agentic-parity-report.md` and `qa-agentic-parity-summary.json` |
|
||||
|
||||
## Reviewer shorthand: before vs after
|
||||
|
||||
| User-visible problem before | Review signal after |
|
||||
| ----------------------------------------------------------- | --------------------------------------------------------------------------------------- |
|
||||
| GPT-5.4 stopped after planning | PR A shows act-or-block behavior instead of commentary-only completion |
|
||||
| Tool use felt brittle with strict OpenAI/Codex schemas | PR C keeps tool registration and parameter-free invocation predictable |
|
||||
| `/elevated full` hints were sometimes misleading | PR B ties guidance to actual runtime capability and blocked reasons |
|
||||
| Long tasks could disappear into replay/compaction ambiguity | PR C emits explicit paused, blocked, abandoned, and replay-invalid state |
|
||||
| Parity claims were anecdotal | PR D produces a report plus JSON verdict with the same scenario coverage on both models |
|
||||
@@ -1,219 +0,0 @@
|
||||
# GPT-5.4 / Codex Agentic Parity in OpenClaw
|
||||
|
||||
OpenClaw already worked well with tool-using frontier models, but GPT-5.4 and Codex-style models were still underperforming in a few practical ways:
|
||||
|
||||
- they could stop after planning instead of doing the work
|
||||
- they could use strict OpenAI/Codex tool schemas incorrectly
|
||||
- they could ask for `/elevated full` even when full access was impossible
|
||||
- they could lose long-running task state during replay or compaction
|
||||
- parity claims against Claude Opus 4.6 were based on anecdotes instead of repeatable scenarios
|
||||
|
||||
This parity program fixes those gaps in four reviewable slices.
|
||||
|
||||
## What changed
|
||||
|
||||
### PR A: strict-agentic execution
|
||||
|
||||
This slice adds an opt-in `strict-agentic` execution contract for embedded Pi GPT-5 runs.
|
||||
|
||||
When enabled, OpenClaw stops accepting plan-only turns as “good enough” completion. If the model only says what it intends to do and does not actually use tools or make progress, OpenClaw retries with an act-now steer and then fails closed with an explicit blocked state instead of silently ending the task.
|
||||
|
||||
This improves the GPT-5.4 experience most on:
|
||||
|
||||
- short “ok do it” follow-ups
|
||||
- code tasks where the first step is obvious
|
||||
- flows where `update_plan` should be progress tracking rather than filler text
|
||||
|
||||
### PR B: runtime truthfulness
|
||||
|
||||
This slice makes OpenClaw tell the truth about two things:
|
||||
|
||||
- why the provider/runtime call failed
|
||||
- whether `/elevated full` is actually available
|
||||
|
||||
That means GPT-5.4 gets better runtime signals for missing scope, auth refresh failures, HTML 403 auth failures, proxy issues, DNS or timeout failures, and blocked full-access modes. The model is less likely to hallucinate the wrong remediation or keep asking for a permission mode the runtime cannot provide.
|
||||
|
||||
### PR C: execution correctness
|
||||
|
||||
This slice improves two kinds of correctness:
|
||||
|
||||
- provider-owned OpenAI/Codex tool-schema compatibility
|
||||
- replay and long-task liveness surfacing
|
||||
|
||||
The tool-compat work reduces schema friction for strict OpenAI/Codex tool registration, especially around parameter-free tools and strict object-root expectations. The replay/liveness work makes long-running tasks more observable, so paused, blocked, and abandoned states are visible instead of disappearing into generic failure text.
|
||||
|
||||
### PR D: parity harness
|
||||
|
||||
This slice adds the first-wave QA-lab parity pack so GPT-5.4 and Opus 4.6 can be exercised through the same scenarios and compared using shared evidence.
|
||||
|
||||
The parity pack is the proof layer. It does not change runtime behavior by itself.
|
||||
|
||||
After you have two `qa-suite-summary.json` artifacts, generate the release-gate comparison with:
|
||||
|
||||
```bash
|
||||
pnpm openclaw qa parity-report \
|
||||
--repo-root . \
|
||||
--candidate-summary .artifacts/qa-e2e/gpt54/qa-suite-summary.json \
|
||||
--baseline-summary .artifacts/qa-e2e/opus46/qa-suite-summary.json \
|
||||
--output-dir .artifacts/qa-e2e/parity
|
||||
```
|
||||
|
||||
That command writes:
|
||||
|
||||
- a human-readable Markdown report
|
||||
- a machine-readable JSON verdict
|
||||
- an explicit `pass` / `fail` gate result
|
||||
|
||||
## Why this improves GPT-5.4 in practice
|
||||
|
||||
Before this work, GPT-5.4 on OpenClaw could feel less agentic than Opus in real coding sessions because the runtime tolerated behaviors that are especially harmful for GPT-5-style models:
|
||||
|
||||
- commentary-only turns
|
||||
- schema friction around tools
|
||||
- vague permission feedback
|
||||
- silent replay or compaction breakage
|
||||
|
||||
The goal is not to make GPT-5.4 imitate Opus. The goal is to give GPT-5.4 a runtime contract that rewards real progress, supplies cleaner tool and permission semantics, and turns failure modes into explicit machine- and human-readable states.
|
||||
|
||||
That changes the user experience from:
|
||||
|
||||
- “the model had a good plan but stopped”
|
||||
|
||||
to:
|
||||
|
||||
- “the model either acted, or OpenClaw surfaced the exact reason it could not”
|
||||
|
||||
## Before vs after for GPT-5.4 users
|
||||
|
||||
| Before this program | After PR A-D |
|
||||
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
|
||||
| GPT-5.4 could stop after a reasonable plan without taking the next tool step | PR A turns “plan only” into “act now or surface a blocked state” |
|
||||
| Strict tool schemas could reject parameter-free or OpenAI/Codex-shaped tools in confusing ways | PR C makes provider-owned tool registration and invocation more predictable |
|
||||
| `/elevated full` guidance could be vague or wrong in blocked runtimes | PR B gives GPT-5.4 and the user truthful runtime and permission hints |
|
||||
| Replay or compaction failures could feel like the task silently disappeared | PR C surfaces paused, blocked, abandoned, and replay-invalid outcomes explicitly |
|
||||
| “GPT-5.4 feels worse than Opus” was mostly anecdotal | PR D turns that into the same scenario pack, the same metrics, and a hard pass/fail gate |
|
||||
|
||||
## Architecture
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
A["User request"] --> B["Embedded Pi runtime"]
|
||||
B --> C["Strict-agentic execution contract"]
|
||||
B --> D["Provider-owned tool compatibility"]
|
||||
B --> E["Runtime truthfulness"]
|
||||
B --> F["Replay and liveness state"]
|
||||
C --> G["Tool call or explicit blocked state"]
|
||||
D --> G
|
||||
E --> G
|
||||
F --> G
|
||||
G --> H["QA-lab parity pack"]
|
||||
H --> I["Scenario report and parity gate"]
|
||||
```
|
||||
|
||||
## Release flow
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
A["Merged runtime slices (PR A-C)"] --> B["Run GPT-5.4 parity pack"]
|
||||
A --> C["Run Opus 4.6 parity pack"]
|
||||
B --> D["qa-suite-summary.json"]
|
||||
C --> E["qa-suite-summary.json"]
|
||||
D --> F["openclaw qa parity-report"]
|
||||
E --> F
|
||||
F --> G["qa-agentic-parity-report.md"]
|
||||
F --> H["qa-agentic-parity-summary.json"]
|
||||
H --> I{"Gate pass?"}
|
||||
I -- "yes" --> J["Evidence-backed parity claim"]
|
||||
I -- "no" --> K["Keep runtime/review loop open"]
|
||||
```
|
||||
|
||||
## Scenario pack
|
||||
|
||||
The first-wave parity pack currently covers five scenarios:
|
||||
|
||||
### `approval-turn-tool-followthrough`
|
||||
|
||||
Checks that the model does not stop at “I’ll do that” after a short approval. It should take the first concrete action in the same turn.
|
||||
|
||||
### `model-switch-tool-continuity`
|
||||
|
||||
Checks that tool-using work remains coherent across model/runtime switching boundaries instead of resetting into commentary or losing execution context.
|
||||
|
||||
### `source-docs-discovery-report`
|
||||
|
||||
Checks that the model can read source and docs, synthesize findings, and continue the task agentically rather than producing a thin summary and stopping early.
|
||||
|
||||
### `image-understanding-attachment`
|
||||
|
||||
Checks that mixed-mode tasks involving attachments remain actionable and do not collapse into vague narration.
|
||||
|
||||
### `compaction-retry-mutating-tool`
|
||||
|
||||
Checks that a task with a real mutating write keeps replay-unsafety explicit instead of quietly looking replay-safe if the run compacts, retries, or loses reply state under pressure.
|
||||
|
||||
## Scenario matrix
|
||||
|
||||
| Scenario | What it tests | Good GPT-5.4 behavior | Failure signal |
|
||||
| ---------------------------------- | --------------------------------------- | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
|
||||
| `approval-turn-tool-followthrough` | Short approval turns after a plan | Starts the first concrete tool action immediately instead of restating intent | plan-only follow-up, no tool activity, or blocked turn without a real blocker |
|
||||
| `model-switch-tool-continuity` | Runtime/model switching under tool use | Preserves task context and continues acting coherently | resets into commentary, loses tool context, or stops after switch |
|
||||
| `source-docs-discovery-report` | Source reading + synthesis + action | Finds sources, uses tools, and produces a useful report without stalling | thin summary, missing tool work, or incomplete-turn stop |
|
||||
| `image-understanding-attachment` | Attachment-driven agentic work | Interprets the attachment, connects it to tools, and continues the task | vague narration, attachment ignored, or no concrete next action |
|
||||
| `compaction-retry-mutating-tool` | Mutating work under compaction pressure | Performs a real write and keeps replay-unsafety explicit after the side effect | mutating write happens but replay safety is implied, missing, or contradictory |
|
||||
|
||||
## Release gate
|
||||
|
||||
GPT-5.4 can only be considered at parity or better when the merged runtime passes the parity pack and the runtime-truthfulness regressions at the same time.
|
||||
|
||||
Required outcomes:
|
||||
|
||||
- no plan-only stall when the next tool action is clear
|
||||
- no fake completion without real execution
|
||||
- no incorrect `/elevated full` guidance
|
||||
- no silent replay or compaction abandonment
|
||||
- parity-pack metrics that are at least as strong as the agreed Opus 4.6 baseline
|
||||
|
||||
For the first-wave harness, the gate compares:
|
||||
|
||||
- completion rate
|
||||
- unintended-stop rate
|
||||
- valid-tool-call rate
|
||||
- fake-success count
|
||||
|
||||
Parity evidence is intentionally split across two layers:
|
||||
|
||||
- PR D proves same-scenario GPT-5.4 vs Opus 4.6 behavior with QA-lab
|
||||
- PR B deterministic suites prove auth, proxy, DNS, and `/elevated full` truthfulness outside the harness
|
||||
|
||||
## Goal-to-evidence matrix
|
||||
|
||||
| Completion gate item | Owning PR | Evidence source | Pass signal |
|
||||
| -------------------------------------------------------- | ----------- | ------------------------------------------------------------------ | ---------------------------------------------------------------------------------------- |
|
||||
| GPT-5.4 no longer stalls after planning | PR A | `approval-turn-tool-followthrough` plus PR A runtime suites | approval turns trigger real work or an explicit blocked state |
|
||||
| GPT-5.4 no longer fakes progress or fake tool completion | PR A + PR D | parity report scenario outcomes and fake-success count | no suspicious pass results and no commentary-only completion |
|
||||
| GPT-5.4 no longer gives false `/elevated full` guidance | PR B | deterministic truthfulness suites | blocked reasons and full-access hints stay runtime-accurate |
|
||||
| Replay/liveness failures stay explicit | PR C + PR D | PR C lifecycle/replay suites plus `compaction-retry-mutating-tool` | mutating work keeps replay-unsafety explicit instead of silently disappearing |
|
||||
| GPT-5.4 matches or beats Opus 4.6 on the agreed metrics | PR D | `qa-agentic-parity-report.md` and `qa-agentic-parity-summary.json` | same scenario coverage and no regression on completion, stop behavior, or valid tool use |
|
||||
|
||||
## How to read the parity verdict
|
||||
|
||||
Use the verdict in `qa-agentic-parity-summary.json` as the final machine-readable decision for the first-wave parity pack.
|
||||
|
||||
- `pass` means GPT-5.4 covered the same scenarios as Opus 4.6 and did not regress on the agreed aggregate metrics.
|
||||
- `fail` means at least one hard gate tripped: weaker completion, worse unintended stops, weaker valid tool use, any fake-success case, or mismatched scenario coverage.
|
||||
- “shared/base CI issue” is not itself a parity result. If CI noise outside PR D blocks a run, the verdict should wait for a clean merged-runtime execution instead of being inferred from branch-era logs.
|
||||
- Auth, proxy, DNS, and `/elevated full` truthfulness still come from PR B’s deterministic suites, so the final release claim needs both: a passing PR D parity verdict and green PR B truthfulness coverage.
|
||||
|
||||
## Who should enable `strict-agentic`
|
||||
|
||||
Use `strict-agentic` when:
|
||||
|
||||
- the agent is expected to act immediately when a next step is obvious
|
||||
- GPT-5.4 or Codex-family models are the primary runtime
|
||||
- you prefer explicit blocked states over “helpful” recap-only replies
|
||||
|
||||
Keep the default contract when:
|
||||
|
||||
- you want the existing looser behavior
|
||||
- you are not using GPT-5-family models
|
||||
- you are testing prompts rather than runtime enforcement
|
||||
@@ -519,22 +519,10 @@ The manifest is the control-plane source of truth. OpenClaw uses it to:
|
||||
- validate `plugins.entries.<id>.config`
|
||||
- augment Control UI labels/placeholders
|
||||
- show install/catalog metadata
|
||||
- preserve cheap activation and setup descriptors without loading plugin runtime
|
||||
|
||||
For native plugins, the runtime module is the data-plane part. It registers
|
||||
actual behavior such as hooks, tools, commands, or provider flows.
|
||||
|
||||
Optional manifest `activation` and `setup` blocks stay on the control plane.
|
||||
They are metadata-only descriptors for activation planning and setup discovery;
|
||||
they do not replace runtime registration, `register(...)`, or `setupEntry`.
|
||||
|
||||
Setup discovery now prefers descriptor-owned ids such as `setup.providers` and
|
||||
`setup.cliBackends` to narrow candidate plugins before it falls back to
|
||||
`setup-api` for plugins that still need setup-time runtime hooks. If more than
|
||||
one discovered plugin claims the same normalized setup provider or CLI backend
|
||||
id, setup lookup refuses the ambiguous owner instead of relying on discovery
|
||||
order.
|
||||
|
||||
### What the loader caches
|
||||
|
||||
OpenClaw keeps short in-process caches for:
|
||||
|
||||
@@ -47,10 +47,6 @@ Use it for:
|
||||
- config validation
|
||||
- auth and onboarding metadata that should be available without booting plugin
|
||||
runtime
|
||||
- cheap activation hints that control-plane surfaces can inspect before runtime
|
||||
loads
|
||||
- cheap setup descriptors that setup/onboarding surfaces can inspect before
|
||||
runtime loads
|
||||
- alias and auto-enable metadata that should resolve before plugin runtime loads
|
||||
- shorthand model-family ownership metadata that should auto-activate the
|
||||
plugin before runtime loads
|
||||
@@ -156,8 +152,6 @@ Those belong in your plugin code and `package.json`.
|
||||
| `providerAuthAliases` | No | `Record<string, string>` | Provider ids that should reuse another provider id for auth lookup, for example a coding provider that shares the base provider API key and auth profiles. |
|
||||
| `channelEnvVars` | No | `Record<string, string[]>` | Cheap channel env metadata that OpenClaw can inspect without loading plugin code. Use this for env-driven channel setup or auth surfaces that generic startup/config helpers should see. |
|
||||
| `providerAuthChoices` | No | `object[]` | Cheap auth-choice metadata for onboarding pickers, preferred-provider resolution, and simple CLI flag wiring. |
|
||||
| `activation` | No | `object` | Cheap activation hints for provider, command, channel, route, and capability-triggered loading. Metadata only; plugin runtime still owns actual behavior. |
|
||||
| `setup` | No | `object` | Cheap setup/onboarding descriptors that discovery and setup surfaces can inspect without loading plugin runtime. |
|
||||
| `contracts` | No | `object` | Static bundled capability snapshot for speech, realtime transcription, realtime voice, media-understanding, image-generation, music-generation, video-generation, web-fetch, web search, and tool ownership. |
|
||||
| `channelConfigs` | No | `Record<string, object>` | Manifest-owned channel config metadata merged into discovery and validation surfaces before runtime loads. |
|
||||
| `skills` | No | `string[]` | Skill directories to load, relative to the plugin root. |
|
||||
@@ -214,88 +208,6 @@ uses this metadata for diagnostics without importing plugin runtime code.
|
||||
| `kind` | No | `"runtime-slash"` | Marks the alias as a chat slash command rather than a root CLI command. |
|
||||
| `cliCommand` | No | `string` | Related root CLI command to suggest for CLI operations, if one exists. |
|
||||
|
||||
## activation reference
|
||||
|
||||
Use `activation` when the plugin can cheaply declare which control-plane events
|
||||
should activate it later.
|
||||
|
||||
This block is metadata only. It does not register runtime behavior, and it does
|
||||
not replace `register(...)`, `setupEntry`, or other runtime/plugin entrypoints.
|
||||
|
||||
```json
|
||||
{
|
||||
"activation": {
|
||||
"onProviders": ["openai"],
|
||||
"onCommands": ["models"],
|
||||
"onChannels": ["web"],
|
||||
"onRoutes": ["gateway-webhook"],
|
||||
"onCapabilities": ["provider", "tool"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| Field | Required | Type | What it means |
|
||||
| ---------------- | -------- | ---------------------------------------------------- | ----------------------------------------------------------------- |
|
||||
| `onProviders` | No | `string[]` | Provider ids that should activate this plugin when requested. |
|
||||
| `onCommands` | No | `string[]` | Command ids that should activate this plugin. |
|
||||
| `onChannels` | No | `string[]` | Channel ids that should activate this plugin. |
|
||||
| `onRoutes` | No | `string[]` | Route kinds that should activate this plugin. |
|
||||
| `onCapabilities` | No | `Array<"provider" \| "channel" \| "tool" \| "hook">` | Broad capability hints used by control-plane activation planning. |
|
||||
|
||||
## setup reference
|
||||
|
||||
Use `setup` when setup and onboarding surfaces need cheap plugin-owned metadata
|
||||
before runtime loads.
|
||||
|
||||
```json
|
||||
{
|
||||
"setup": {
|
||||
"providers": [
|
||||
{
|
||||
"id": "openai",
|
||||
"authMethods": ["api-key"],
|
||||
"envVars": ["OPENAI_API_KEY"]
|
||||
}
|
||||
],
|
||||
"cliBackends": ["openai-cli"],
|
||||
"configMigrations": ["legacy-openai-auth"],
|
||||
"requiresRuntime": false
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Top-level `cliBackends` stays valid and continues to describe CLI inference
|
||||
backends. `setup.cliBackends` is the setup-specific descriptor surface for
|
||||
control-plane/setup flows that should stay metadata-only.
|
||||
|
||||
When present, `setup.providers` and `setup.cliBackends` are the preferred
|
||||
descriptor-first lookup surface for setup discovery. If the descriptor only
|
||||
narrows the candidate plugin and setup still needs richer setup-time runtime
|
||||
hooks, set `requiresRuntime: true` and keep `setup-api` in place as the
|
||||
fallback execution path.
|
||||
|
||||
Because setup lookup can execute plugin-owned `setup-api` code, normalized
|
||||
`setup.providers[].id` and `setup.cliBackends[]` values must stay unique across
|
||||
discovered plugins. Ambiguous ownership fails closed instead of picking a
|
||||
winner from discovery order.
|
||||
|
||||
### setup.providers reference
|
||||
|
||||
| Field | Required | Type | What it means |
|
||||
| ------------- | -------- | ---------- | ------------------------------------------------------------------------------------ |
|
||||
| `id` | Yes | `string` | Provider id exposed during setup or onboarding. Keep normalized ids globally unique. |
|
||||
| `authMethods` | No | `string[]` | Setup/auth method ids this provider supports without loading full runtime. |
|
||||
| `envVars` | No | `string[]` | Env vars that generic setup/status surfaces can check before plugin runtime loads. |
|
||||
|
||||
### setup fields
|
||||
|
||||
| Field | Required | Type | What it means |
|
||||
| ------------------ | -------- | ---------- | --------------------------------------------------------------------------------------------------- |
|
||||
| `providers` | No | `object[]` | Provider setup descriptors exposed during setup and onboarding. |
|
||||
| `cliBackends` | No | `string[]` | Setup-time backend ids used for descriptor-first setup lookup. Keep normalized ids globally unique. |
|
||||
| `configMigrations` | No | `string[]` | Config migration ids owned by this plugin's setup surface. |
|
||||
| `requiresRuntime` | No | `boolean` | Whether setup still needs `setup-api` execution after descriptor lookup. |
|
||||
|
||||
## uiHints reference
|
||||
|
||||
`uiHints` is a map from config field names to small rendering hints.
|
||||
|
||||
@@ -133,25 +133,6 @@ OpenClaw requires Codex app-server `0.118.0` or newer. The Codex plugin checks
|
||||
the app-server initialize handshake and blocks older or unversioned servers so
|
||||
OpenClaw only runs against the protocol surface it has been tested with.
|
||||
|
||||
### Native Codex harness mode
|
||||
|
||||
The bundled `codex` harness is the native Codex mode for embedded OpenClaw
|
||||
agent turns. Enable the bundled `codex` plugin first, and include `codex` in
|
||||
`plugins.allow` if your config uses a restrictive allowlist. It is different
|
||||
from `openai-codex/*`:
|
||||
|
||||
- `openai-codex/*` uses ChatGPT/Codex OAuth through the normal OpenClaw provider
|
||||
path.
|
||||
- `codex/*` uses the bundled Codex provider and routes the turn through Codex
|
||||
app-server.
|
||||
|
||||
When this mode runs, Codex owns the native thread id, resume behavior,
|
||||
compaction, and app-server execution. OpenClaw still owns the chat channel,
|
||||
visible transcript mirror, tool policy, approvals, media delivery, and session
|
||||
selection. Use `embeddedHarness.runtime: "codex"` with
|
||||
`embeddedHarness.fallback: "none"` when you need to prove that the Codex
|
||||
app-server path is used and PI fallback is not hiding a broken native harness.
|
||||
|
||||
## Disable PI fallback
|
||||
|
||||
By default, OpenClaw runs embedded agents with `agents.defaults.embeddedHarness`
|
||||
|
||||
@@ -3,7 +3,6 @@ summary: "Use OpenAI via API keys or Codex subscription in OpenClaw"
|
||||
read_when:
|
||||
- You want to use OpenAI models in OpenClaw
|
||||
- You want Codex subscription auth instead of API keys
|
||||
- You need stricter GPT-5 agent execution behavior
|
||||
title: "OpenAI"
|
||||
---
|
||||
|
||||
@@ -478,33 +477,6 @@ behavior, but it does not receive the hidden OpenAI/Codex attribution headers.
|
||||
This preserves current native OpenAI Responses behavior without forcing older
|
||||
OpenAI-compatible shims onto third-party `/v1` backends.
|
||||
|
||||
### Strict-agentic GPT mode
|
||||
|
||||
For `openai/*` and `openai-codex/*` GPT-5-family runs, OpenClaw can use a
|
||||
stricter embedded Pi execution contract:
|
||||
|
||||
```json5
|
||||
{
|
||||
agents: {
|
||||
defaults: {
|
||||
embeddedPi: {
|
||||
executionContract: "strict-agentic",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
With `strict-agentic`, OpenClaw no longer treats a plan-only assistant turn as
|
||||
successful progress when a concrete tool action is available. It retries the
|
||||
turn with an act-now steer, auto-enables the structured `update_plan` tool for
|
||||
substantial work, and surfaces an explicit blocked state if the model keeps
|
||||
planning without acting.
|
||||
|
||||
The mode is scoped to OpenAI and OpenAI Codex GPT-5-family runs. Other providers
|
||||
and older model families keep the default embedded Pi behavior unless you opt
|
||||
them into other runtime settings.
|
||||
|
||||
### OpenAI Responses server-side compaction
|
||||
|
||||
For direct OpenAI Responses models (`openai/*` using `api: "openai-responses"` with
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
# Rich Output Protocol
|
||||
|
||||
Assistant output can carry a small set of delivery/render directives:
|
||||
|
||||
- `MEDIA:` for attachment delivery
|
||||
- `[[audio_as_voice]]` for audio presentation hints
|
||||
- `[[reply_to_current]]` / `[[reply_to:<id>]]` for reply metadata
|
||||
- `[embed ...]` for Control UI rich rendering
|
||||
|
||||
These directives are separate. `MEDIA:` and reply/voice tags remain delivery metadata; `[embed ...]` is the web-only rich render path.
|
||||
|
||||
## `[embed ...]`
|
||||
|
||||
`[embed ...]` is the only agent-facing rich render syntax for the Control UI.
|
||||
|
||||
Self-closing example:
|
||||
|
||||
```text
|
||||
[embed ref="cv_123" title="Status" /]
|
||||
```
|
||||
|
||||
Rules:
|
||||
|
||||
- `[view ...]` is no longer valid for new output.
|
||||
- Embed shortcodes render in the assistant message surface only.
|
||||
- Only URL-backed embeds are rendered. Use `ref="..."` or `url="..."`.
|
||||
- Block-form inline HTML embed shortcodes are not rendered.
|
||||
- The web UI strips the shortcode from visible text and renders the embed inline.
|
||||
- `MEDIA:` is not an embed alias and should not be used for rich embed rendering.
|
||||
|
||||
## Stored Rendering Shape
|
||||
|
||||
The normalized/stored assistant content block is a structured `canvas` item:
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "canvas",
|
||||
"preview": {
|
||||
"kind": "canvas",
|
||||
"surface": "assistant_message",
|
||||
"render": "url",
|
||||
"viewId": "cv_123",
|
||||
"url": "/__openclaw__/canvas/documents/cv_123/index.html",
|
||||
"title": "Status",
|
||||
"preferredHeight": 320
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Stored/rendered rich blocks use this `canvas` shape directly. `present_view` is not recognized.
|
||||
@@ -15,19 +15,14 @@ If `BOOTSTRAP.md` exists, that's your birth certificate. Follow it, figure out w
|
||||
|
||||
## Session Startup
|
||||
|
||||
Use runtime-provided startup context first.
|
||||
Before doing anything else:
|
||||
|
||||
That context may already include:
|
||||
1. Read `SOUL.md` — this is who you are
|
||||
2. Read `USER.md` — this is who you're helping
|
||||
3. Read `memory/YYYY-MM-DD.md` (today + yesterday) for recent context
|
||||
4. **If in MAIN SESSION** (direct chat with your human): Also read `MEMORY.md`
|
||||
|
||||
- `AGENTS.md`, `SOUL.md`, and `USER.md`
|
||||
- recent daily memory such as `memory/YYYY-MM-DD.md`
|
||||
- `MEMORY.md` when this is the main session
|
||||
|
||||
Do not manually reread startup files unless:
|
||||
|
||||
1. The user explicitly asks
|
||||
2. The provided context is missing something you need
|
||||
3. You need a deeper follow-up read beyond the provided startup context
|
||||
Don't ask permission. Just do it.
|
||||
|
||||
## Memory
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ OpenClaw assembles its own system prompt on every run. It includes:
|
||||
- Tool list + short descriptions
|
||||
- Skills list (only metadata; instructions are loaded on demand with `read`)
|
||||
- Self-update instructions
|
||||
- Workspace + bootstrap files (`AGENTS.md`, `SOUL.md`, `TOOLS.md`, `IDENTITY.md`, `USER.md`, `HEARTBEAT.md`, `BOOTSTRAP.md` when new, plus `MEMORY.md` when present or `memory.md` as a lowercase fallback). Large files are truncated by `agents.defaults.bootstrapMaxChars` (default: 20000), and total bootstrap injection is capped by `agents.defaults.bootstrapTotalMaxChars` (default: 150000). `memory/*.md` daily files are not part of the normal bootstrap prompt; they remain on-demand via memory tools on ordinary turns, but bare `/new` and `/reset` can prepend a one-shot startup-context block with recent daily memory for that first turn. That startup prelude is controlled by `agents.defaults.startupContext`.
|
||||
- Workspace + bootstrap files (`AGENTS.md`, `SOUL.md`, `TOOLS.md`, `IDENTITY.md`, `USER.md`, `HEARTBEAT.md`, `BOOTSTRAP.md` when new, plus `MEMORY.md` when present or `memory.md` as a lowercase fallback). Large files are truncated by `agents.defaults.bootstrapMaxChars` (default: 20000), and total bootstrap injection is capped by `agents.defaults.bootstrapTotalMaxChars` (default: 150000). `memory/*.md` files are on-demand via memory tools and are not auto-injected.
|
||||
- Time (UTC + user timezone)
|
||||
- Reply tags + heartbeat behavior
|
||||
- Runtime metadata (host/OS/model/thinking)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
summary: "Generate videos from text, images, or existing videos using 14 provider backends"
|
||||
summary: "Generate videos from text, images, or existing videos using 12 provider backends"
|
||||
read_when:
|
||||
- Generating videos via the agent
|
||||
- Configuring video generation providers and models
|
||||
@@ -9,7 +9,7 @@ title: "Video Generation"
|
||||
|
||||
# Video Generation
|
||||
|
||||
OpenClaw agents can generate videos from text prompts, reference images, or existing videos. Fourteen provider backends are supported, each with different model options, input modes, and feature sets. The agent picks the right provider automatically based on your configuration and available API keys.
|
||||
OpenClaw agents can generate videos from text prompts, reference images, or existing videos. Twelve provider backends are supported, each with different model options, input modes, and feature sets. The agent picks the right provider automatically based on your configuration and available API keys.
|
||||
|
||||
<Note>
|
||||
The `video_generate` tool only appears when at least one video-generation provider is available. If you do not see it in your agent tools, set a provider API key or configure `agents.defaults.videoGenerationModel`.
|
||||
@@ -78,22 +78,20 @@ Duplicate prevention: if a video task is already `queued` or `running` for the c
|
||||
|
||||
## Supported providers
|
||||
|
||||
| Provider | Default model | Text | Image ref | Video ref | API key |
|
||||
| --------------------- | ------------------------------- | ---- | ---------------------------------------------------- | ---------------- | ---------------------------------------- |
|
||||
| Alibaba | `wan2.6-t2v` | Yes | Yes (remote URL) | Yes (remote URL) | `MODELSTUDIO_API_KEY` |
|
||||
| BytePlus (1.0) | `seedance-1-0-pro-250528` | Yes | Up to 2 images (I2V models only; first + last frame) | No | `BYTEPLUS_API_KEY` |
|
||||
| BytePlus Seedance 1.5 | `seedance-1-5-pro-251215` | Yes | Up to 2 images (first + last frame via role) | No | `BYTEPLUS_API_KEY` |
|
||||
| BytePlus Seedance 2.0 | `dreamina-seedance-2-0-260128` | Yes | Up to 9 reference images | Up to 3 videos | `BYTEPLUS_API_KEY` |
|
||||
| ComfyUI | `workflow` | Yes | 1 image | No | `COMFY_API_KEY` or `COMFY_CLOUD_API_KEY` |
|
||||
| fal | `fal-ai/minimax/video-01-live` | Yes | 1 image | No | `FAL_KEY` |
|
||||
| Google | `veo-3.1-fast-generate-preview` | Yes | 1 image | 1 video | `GEMINI_API_KEY` |
|
||||
| MiniMax | `MiniMax-Hailuo-2.3` | Yes | 1 image | No | `MINIMAX_API_KEY` |
|
||||
| OpenAI | `sora-2` | Yes | 1 image | 1 video | `OPENAI_API_KEY` |
|
||||
| Qwen | `wan2.6-t2v` | Yes | Yes (remote URL) | Yes (remote URL) | `QWEN_API_KEY` |
|
||||
| Runway | `gen4.5` | Yes | 1 image | 1 video | `RUNWAYML_API_SECRET` |
|
||||
| Together | `Wan-AI/Wan2.2-T2V-A14B` | Yes | 1 image | No | `TOGETHER_API_KEY` |
|
||||
| Vydra | `veo3` | Yes | 1 image (`kling`) | No | `VYDRA_API_KEY` |
|
||||
| xAI | `grok-imagine-video` | Yes | 1 image | 1 video | `XAI_API_KEY` |
|
||||
| Provider | Default model | Text | Image ref | Video ref | API key |
|
||||
| -------- | ------------------------------- | ---- | ----------------- | ---------------- | ---------------------------------------- |
|
||||
| Alibaba | `wan2.6-t2v` | Yes | Yes (remote URL) | Yes (remote URL) | `MODELSTUDIO_API_KEY` |
|
||||
| BytePlus | `seedance-1-0-lite-t2v-250428` | Yes | 1 image | No | `BYTEPLUS_API_KEY` |
|
||||
| ComfyUI | `workflow` | Yes | 1 image | No | `COMFY_API_KEY` or `COMFY_CLOUD_API_KEY` |
|
||||
| fal | `fal-ai/minimax/video-01-live` | Yes | 1 image | No | `FAL_KEY` |
|
||||
| Google | `veo-3.1-fast-generate-preview` | Yes | 1 image | 1 video | `GEMINI_API_KEY` |
|
||||
| MiniMax | `MiniMax-Hailuo-2.3` | Yes | 1 image | No | `MINIMAX_API_KEY` |
|
||||
| OpenAI | `sora-2` | Yes | 1 image | 1 video | `OPENAI_API_KEY` |
|
||||
| Qwen | `wan2.6-t2v` | Yes | Yes (remote URL) | Yes (remote URL) | `QWEN_API_KEY` |
|
||||
| Runway | `gen4.5` | Yes | 1 image | 1 video | `RUNWAYML_API_SECRET` |
|
||||
| Together | `Wan-AI/Wan2.2-T2V-A14B` | Yes | 1 image | No | `TOGETHER_API_KEY` |
|
||||
| Vydra | `veo3` | Yes | 1 image (`kling`) | No | `VYDRA_API_KEY` |
|
||||
| xAI | `grok-imagine-video` | Yes | 1 image | 1 video | `XAI_API_KEY` |
|
||||
|
||||
Some providers accept additional or alternate API key env vars. See individual [provider pages](#related) for details.
|
||||
|
||||
@@ -130,49 +128,31 @@ and the shared live sweep.
|
||||
|
||||
### Content inputs
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| ------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `image` | string | Single reference image (path or URL) |
|
||||
| `images` | string[] | Multiple reference images (up to 9) |
|
||||
| `imageRoles` | string[] | Optional per-position role hints parallel to the combined image list. Canonical values: `first_frame`, `last_frame`, `reference_image` |
|
||||
| `video` | string | Single reference video (path or URL) |
|
||||
| `videos` | string[] | Multiple reference videos (up to 4) |
|
||||
| `videoRoles` | string[] | Optional per-position role hints parallel to the combined video list. Canonical value: `reference_video` |
|
||||
| `audioRef` | string | Single reference audio (path or URL). Used for e.g. background music or voice reference when the provider supports audio inputs |
|
||||
| `audioRefs` | string[] | Multiple reference audios (up to 3) |
|
||||
| `audioRoles` | string[] | Optional per-position role hints parallel to the combined audio list. Canonical value: `reference_audio` |
|
||||
|
||||
Role hints are forwarded to the provider as-is. Canonical values come from
|
||||
the `VideoGenerationAssetRole` union but providers may accept additional
|
||||
role strings. `*Roles` arrays must not have more entries than the
|
||||
corresponding reference list; off-by-one mistakes fail with a clear error.
|
||||
Use an empty string to leave a slot unset.
|
||||
| Parameter | Type | Description |
|
||||
| --------- | -------- | ------------------------------------ |
|
||||
| `image` | string | Single reference image (path or URL) |
|
||||
| `images` | string[] | Multiple reference images (up to 5) |
|
||||
| `video` | string | Single reference video (path or URL) |
|
||||
| `videos` | string[] | Multiple reference videos (up to 4) |
|
||||
|
||||
### Style controls
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| ----------------- | ------- | --------------------------------------------------------------------------------------- |
|
||||
| `aspectRatio` | string | `1:1`, `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`, `9:16`, `16:9`, `21:9`, or `adaptive` |
|
||||
| `resolution` | string | `480P`, `720P`, `768P`, or `1080P` |
|
||||
| `durationSeconds` | number | Target duration in seconds (rounded to nearest provider-supported value) |
|
||||
| `size` | string | Size hint when the provider supports it |
|
||||
| `audio` | boolean | Enable generated audio in the output when supported. Distinct from `audioRef*` (inputs) |
|
||||
| `watermark` | boolean | Toggle provider watermarking when supported |
|
||||
|
||||
`adaptive` is a provider-specific sentinel: it is forwarded as-is to
|
||||
providers that declare `adaptive` in their capabilities (e.g. BytePlus
|
||||
Seedance uses it to auto-detect the ratio from the input image
|
||||
dimensions). Providers that do not declare it surface the value via
|
||||
`details.ignoredOverrides` in the tool result so the drop is visible.
|
||||
| Parameter | Type | Description |
|
||||
| ----------------- | ------- | ------------------------------------------------------------------------ |
|
||||
| `aspectRatio` | string | `1:1`, `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`, `9:16`, `16:9`, `21:9` |
|
||||
| `resolution` | string | `480P`, `720P`, `768P`, or `1080P` |
|
||||
| `durationSeconds` | number | Target duration in seconds (rounded to nearest provider-supported value) |
|
||||
| `size` | string | Size hint when the provider supports it |
|
||||
| `audio` | boolean | Enable generated audio when supported |
|
||||
| `watermark` | boolean | Toggle provider watermarking when supported |
|
||||
|
||||
### Advanced
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| ----------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `action` | string | `"generate"` (default), `"status"`, or `"list"` |
|
||||
| `model` | string | Provider/model override (e.g. `runway/gen4.5`) |
|
||||
| `filename` | string | Output filename hint |
|
||||
| `providerOptions` | object | Provider-specific options as a JSON object (e.g. `{"seed": 42, "draft": true}`). Providers that declare a typed schema validate the keys and types; unknown keys or mismatches skip the candidate during fallback. Providers without a declared schema receive the options as-is. Run `video_generate action=list` to see what each provider accepts |
|
||||
| Parameter | Type | Description |
|
||||
| ---------- | ------ | ----------------------------------------------- |
|
||||
| `action` | string | `"generate"` (default), `"status"`, or `"list"` |
|
||||
| `model` | string | Provider/model override (e.g. `runway/gen4.5`) |
|
||||
| `filename` | string | Output filename hint |
|
||||
|
||||
Not all providers support all parameters. OpenClaw already normalizes duration to the closest provider-supported value, and it also remaps translated geometry hints such as size-to-aspect-ratio when a fallback provider exposes a different control surface. Truly unsupported overrides are ignored on a best-effort basis and reported as warnings in the tool result. Hard capability limits (such as too many reference inputs) fail before submission.
|
||||
|
||||
@@ -183,37 +163,10 @@ Reference inputs also select the runtime mode:
|
||||
- No reference media: `generate`
|
||||
- Any image reference: `imageToVideo`
|
||||
- Any video reference: `videoToVideo`
|
||||
- Reference audio inputs do not change the resolved mode; they apply on top of whatever mode the image/video references select, and only work with providers that declare `maxInputAudios`
|
||||
|
||||
Mixed image and video references are not a stable shared capability surface.
|
||||
Prefer one reference type per request.
|
||||
|
||||
#### Fallback and typed options
|
||||
|
||||
Some capability checks are applied at the fallback layer rather than the
|
||||
tool boundary so that a request that exceeds the primary provider's limits
|
||||
can still run on a capable fallback:
|
||||
|
||||
- If the active candidate declares no `maxInputAudios` (or declares it as
|
||||
`0`), it is skipped when the request contains audio references, and the
|
||||
next candidate is tried.
|
||||
- If the active candidate's `maxDurationSeconds` is below the requested
|
||||
`durationSeconds` and the candidate does not declare a
|
||||
`supportedDurationSeconds` list, it is skipped.
|
||||
- If the request contains `providerOptions` and the active candidate
|
||||
explicitly declares a typed `providerOptions` schema, the candidate is
|
||||
skipped when the supplied keys are not in the schema or the value types do
|
||||
not match. Providers that have not yet declared a schema receive the
|
||||
options as-is (backward-compatible pass-through). A provider can
|
||||
explicitly opt out of all provider options by declaring an empty schema
|
||||
(`capabilities.providerOptions: {}`), which causes the same skip as a
|
||||
type mismatch.
|
||||
|
||||
The first skip reason in a request is logged at `warn` so operators see
|
||||
when their primary provider was passed over; subsequent skips log at
|
||||
`debug` to keep long fallback chains quiet. If every candidate is skipped,
|
||||
the aggregated error includes the skip reason for each.
|
||||
|
||||
## Actions
|
||||
|
||||
- **generate** (default) -- create a video from the given prompt and optional reference inputs.
|
||||
@@ -248,24 +201,50 @@ entries.
|
||||
}
|
||||
```
|
||||
|
||||
HeyGen video-agent on fal can be pinned with:
|
||||
|
||||
```json5
|
||||
{
|
||||
agents: {
|
||||
defaults: {
|
||||
videoGenerationModel: {
|
||||
primary: "fal/fal-ai/heygen/v2/video-agent",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
Seedance 2.0 on fal can be pinned with:
|
||||
|
||||
```json5
|
||||
{
|
||||
agents: {
|
||||
defaults: {
|
||||
videoGenerationModel: {
|
||||
primary: "fal/bytedance/seedance-2.0/fast/text-to-video",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
## Provider notes
|
||||
|
||||
| Provider | Notes |
|
||||
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| Alibaba | Uses DashScope/Model Studio async endpoint. Reference images and videos must be remote `http(s)` URLs. |
|
||||
| BytePlus (1.0) | Provider id `byteplus`. Models: `seedance-1-0-pro-250528` (default), `seedance-1-0-pro-t2v-250528`, `seedance-1-0-pro-fast-251015`, `seedance-1-0-lite-t2v-250428`, `seedance-1-0-lite-i2v-250428`. T2V models (`*-t2v-*`) do not accept image inputs; I2V models and general `*-pro-*` models support a single reference image (first frame). Pass the image positionally or set `role: "first_frame"`. T2V model IDs are automatically switched to the corresponding I2V variant when an image is provided. Supported `providerOptions` keys: `seed` (number), `draft` (boolean, forces 480p), `camera_fixed` (boolean). |
|
||||
| BytePlus Seedance 1.5 | Requires the [`@openclaw/byteplus-modelark`](https://www.npmjs.com/package/@openclaw/byteplus-modelark) plugin. Provider id `byteplus-seedance15`. Model: `seedance-1-5-pro-251215`. Uses the unified `content[]` API. Supports at most 2 input images (first_frame + last_frame). All inputs must be remote `https://` URLs. Set `role: "first_frame"` / `"last_frame"` on each image, or pass images positionally. `aspectRatio: "adaptive"` auto-detects ratio from the input image. `audio: true` maps to `generate_audio`. `providerOptions.seed` (number) is forwarded. |
|
||||
| BytePlus Seedance 2.0 | Requires the [`@openclaw/byteplus-modelark`](https://www.npmjs.com/package/@openclaw/byteplus-modelark) plugin. Provider id `byteplus-seedance2`. Models: `dreamina-seedance-2-0-260128`, `dreamina-seedance-2-0-fast-260128`. Uses the unified `content[]` API. Supports up to 9 reference images, 3 reference videos, and 3 reference audios. All inputs must be remote `https://` URLs. Set `role` on each asset — supported values: `"first_frame"`, `"last_frame"`, `"reference_image"`, `"reference_video"`, `"reference_audio"`. `aspectRatio: "adaptive"` auto-detects ratio from the input image. `audio: true` maps to `generate_audio`. `providerOptions.seed` (number) is forwarded. |
|
||||
| ComfyUI | Workflow-driven local or cloud execution. Supports text-to-video and image-to-video through the configured graph. |
|
||||
| fal | Uses queue-backed flow for long-running jobs. Single image reference only. |
|
||||
| Google | Uses Gemini/Veo. Supports one image or one video reference. |
|
||||
| MiniMax | Single image reference only. |
|
||||
| OpenAI | Only `size` override is forwarded. Other style overrides (`aspectRatio`, `resolution`, `audio`, `watermark`) are ignored with a warning. |
|
||||
| Qwen | Same DashScope backend as Alibaba. Reference inputs must be remote `http(s)` URLs; local files are rejected upfront. |
|
||||
| Runway | Supports local files via data URIs. Video-to-video requires `runway/gen4_aleph`. Text-only runs expose `16:9` and `9:16` aspect ratios. |
|
||||
| Together | Single image reference only. |
|
||||
| Vydra | Uses `https://www.vydra.ai/api/v1` directly to avoid auth-dropping redirects. `veo3` is bundled as text-to-video only; `kling` requires a remote image URL. |
|
||||
| xAI | Supports text-to-video, image-to-video, and remote video edit/extend flows. |
|
||||
| Provider | Notes |
|
||||
| -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Alibaba | Uses DashScope/Model Studio async endpoint. Reference images and videos must be remote `http(s)` URLs. |
|
||||
| BytePlus | Single image reference only. |
|
||||
| ComfyUI | Workflow-driven local or cloud execution. Supports text-to-video and image-to-video through the configured graph. |
|
||||
| fal | Uses queue-backed flow for long-running jobs. Single image reference only. Includes HeyGen video-agent and Seedance 2.0 text-to-video and image-to-video model refs. |
|
||||
| Google | Uses Gemini/Veo. Supports one image or one video reference. |
|
||||
| MiniMax | Single image reference only. |
|
||||
| OpenAI | Only `size` override is forwarded. Other style overrides (`aspectRatio`, `resolution`, `audio`, `watermark`) are ignored with a warning. |
|
||||
| Qwen | Same DashScope backend as Alibaba. Reference inputs must be remote `http(s)` URLs; local files are rejected upfront. |
|
||||
| Runway | Supports local files via data URIs. Video-to-video requires `runway/gen4_aleph`. Text-only runs expose `16:9` and `9:16` aspect ratios. |
|
||||
| Together | Single image reference only. |
|
||||
| Vydra | Uses `https://www.vydra.ai/api/v1` directly to avoid auth-dropping redirects. `veo3` is bundled as text-to-video only; `kling` requires a remote image URL. |
|
||||
| xAI | Supports text-to-video, image-to-video, and remote video edit/extend flows. |
|
||||
|
||||
## Provider capability modes
|
||||
|
||||
|
||||
@@ -138,38 +138,6 @@ Cron jobs panel notes:
|
||||
- Gateway persists aborted partial assistant text into transcript history when buffered output exists
|
||||
- Persisted entries include abort metadata so transcript consumers can tell abort partials from normal completion output
|
||||
|
||||
## Hosted embeds
|
||||
|
||||
Assistant messages can render hosted web content inline with the `[embed ...]`
|
||||
shortcode. The iframe sandbox policy is controlled by
|
||||
`gateway.controlUi.embedSandbox`:
|
||||
|
||||
- `strict`: disables script execution inside hosted embeds
|
||||
- `scripts`: allows interactive embeds while keeping origin isolation; this is
|
||||
the default and is usually enough for self-contained browser games/widgets
|
||||
- `trusted`: adds `allow-same-origin` on top of `allow-scripts` for same-site
|
||||
documents that intentionally need stronger privileges
|
||||
|
||||
Example:
|
||||
|
||||
```json5
|
||||
{
|
||||
gateway: {
|
||||
controlUi: {
|
||||
embedSandbox: "scripts",
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
Use `trusted` only when the embedded document genuinely needs same-origin
|
||||
behavior. For most agent-generated games and interactive canvases, `scripts` is
|
||||
the safer choice.
|
||||
|
||||
Absolute external `http(s)` embed URLs stay blocked by default. If you
|
||||
intentionally want `[embed url="https://..."]` to load third-party pages, set
|
||||
`gateway.controlUi.allowExternalEmbedUrls: true`.
|
||||
|
||||
## Tailnet access (recommended)
|
||||
|
||||
### Integrated Tailscale Serve (preferred)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@openclaw/acpx",
|
||||
"version": "2026.4.11",
|
||||
"version": "2026.4.10",
|
||||
"description": "OpenClaw ACP runtime backend",
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
import fs from "node:fs";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { validateJsonSchemaValue } from "../../src/plugins/schema-validator.js";
|
||||
|
||||
const manifest = JSON.parse(
|
||||
fs.readFileSync(new URL("./openclaw.plugin.json", import.meta.url), "utf-8"),
|
||||
) as { configSchema: Record<string, unknown> };
|
||||
|
||||
describe("active-memory manifest config schema", () => {
|
||||
it("accepts modelFallback for CLI and config.patch flows", () => {
|
||||
const result = validateJsonSchemaValue({
|
||||
schema: manifest.configSchema,
|
||||
cacheKey: "active-memory.manifest.model-fallback",
|
||||
value: {
|
||||
enabled: true,
|
||||
agents: ["main"],
|
||||
modelFallback: "google/gemini-3-flash",
|
||||
modelFallbackPolicy: "resolved-only",
|
||||
},
|
||||
});
|
||||
|
||||
expect(result.ok).toBe(true);
|
||||
});
|
||||
});
|
||||
@@ -97,15 +97,7 @@ describe("active-memory plugin", () => {
|
||||
agents: ["main"],
|
||||
logging: true,
|
||||
};
|
||||
api.config = {
|
||||
agents: {
|
||||
defaults: {
|
||||
model: {
|
||||
primary: "github-copilot/gpt-5.4-mini",
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
api.config = {};
|
||||
hoisted.sessionStore["agent:main:main"] = {
|
||||
sessionId: "s-main",
|
||||
updatedAt: 0,
|
||||
@@ -389,16 +381,7 @@ describe("active-memory plugin", () => {
|
||||
});
|
||||
|
||||
it("treats non-default main session keys as direct chats", async () => {
|
||||
api.config = {
|
||||
agents: {
|
||||
defaults: {
|
||||
model: {
|
||||
primary: "github-copilot/gpt-5.4-mini",
|
||||
},
|
||||
},
|
||||
},
|
||||
session: { mainKey: "home" },
|
||||
};
|
||||
api.config = { session: { mainKey: "home" } };
|
||||
|
||||
const result = await hooks.before_prompt_build(
|
||||
{ prompt: "what wings should i order?", messages: [] },
|
||||
@@ -471,81 +454,7 @@ describe("active-memory plugin", () => {
|
||||
expect(runEmbeddedPiAgent.mock.calls.at(-1)?.[0]).toMatchObject({
|
||||
provider: "github-copilot",
|
||||
model: "gpt-5.4-mini",
|
||||
messageProvider: "webchat",
|
||||
sessionKey: expect.stringMatching(/^agent:main:main:active-memory:[a-f0-9]{12}$/),
|
||||
config: {
|
||||
plugins: {
|
||||
entries: {
|
||||
"active-memory": {
|
||||
config: {
|
||||
qmd: {
|
||||
searchMode: "search",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it("lets active memory inherit the main QMD search mode when configured", async () => {
|
||||
api.config = {
|
||||
agents: {
|
||||
defaults: {
|
||||
model: {
|
||||
primary: "github-copilot/gpt-5.4-mini",
|
||||
},
|
||||
},
|
||||
},
|
||||
memory: {
|
||||
backend: "qmd",
|
||||
qmd: {
|
||||
searchMode: "query",
|
||||
},
|
||||
},
|
||||
};
|
||||
api.pluginConfig = {
|
||||
agents: ["main"],
|
||||
qmd: {
|
||||
searchMode: "inherit",
|
||||
},
|
||||
};
|
||||
await plugin.register(api as unknown as OpenClawPluginApi);
|
||||
|
||||
await hooks.before_prompt_build(
|
||||
{
|
||||
prompt: "what wings should i order? inherit-qmd-mode-check",
|
||||
messages: [],
|
||||
},
|
||||
{
|
||||
agentId: "main",
|
||||
trigger: "user",
|
||||
sessionKey: "agent:main:main",
|
||||
messageProvider: "webchat",
|
||||
},
|
||||
);
|
||||
|
||||
expect(runEmbeddedPiAgent.mock.calls.at(-1)?.[0]).toMatchObject({
|
||||
config: {
|
||||
memory: {
|
||||
backend: "qmd",
|
||||
qmd: {
|
||||
searchMode: "query",
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
entries: {
|
||||
"active-memory": {
|
||||
config: {
|
||||
qmd: {
|
||||
searchMode: "inherit",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -821,8 +730,7 @@ describe("active-memory plugin", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("skips recall when no model or explicit fallback resolves", async () => {
|
||||
api.config = {};
|
||||
it("can disable default remote model fallback", async () => {
|
||||
api.pluginConfig = {
|
||||
agents: ["main"],
|
||||
modelFallbackPolicy: "resolved-only",
|
||||
@@ -843,81 +751,19 @@ describe("active-memory plugin", () => {
|
||||
expect(runEmbeddedPiAgent).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("uses config.modelFallback when no session or agent model resolves", async () => {
|
||||
api.config = {};
|
||||
api.pluginConfig = {
|
||||
agents: ["main"],
|
||||
modelFallback: "google/gemini-3-flash",
|
||||
modelFallbackPolicy: "default-remote",
|
||||
};
|
||||
await plugin.register(api as unknown as OpenClawPluginApi);
|
||||
|
||||
await hooks.before_prompt_build(
|
||||
{ prompt: "what wings should i order? custom fallback", messages: [] },
|
||||
{
|
||||
agentId: "main",
|
||||
trigger: "user",
|
||||
sessionKey: "agent:main:custom-fallback",
|
||||
messageProvider: "webchat",
|
||||
},
|
||||
);
|
||||
|
||||
expect(runEmbeddedPiAgent.mock.calls.at(-1)?.[0]).toMatchObject({
|
||||
provider: "google",
|
||||
model: "gemini-3-flash-preview",
|
||||
});
|
||||
expect(api.logger.warn).toHaveBeenCalledWith(
|
||||
expect.stringContaining("config.modelFallbackPolicy is deprecated"),
|
||||
);
|
||||
});
|
||||
|
||||
it("does not use a built-in fallback model even when default-remote is configured", async () => {
|
||||
api.config = {};
|
||||
api.pluginConfig = {
|
||||
agents: ["main"],
|
||||
modelFallbackPolicy: "default-remote",
|
||||
};
|
||||
await plugin.register(api as unknown as OpenClawPluginApi);
|
||||
|
||||
const result = await hooks.before_prompt_build(
|
||||
{ prompt: "what wings should i order? built-in fallback", messages: [] },
|
||||
{
|
||||
agentId: "main",
|
||||
trigger: "user",
|
||||
sessionKey: "agent:main:built-in-fallback",
|
||||
messageProvider: "webchat",
|
||||
},
|
||||
);
|
||||
|
||||
expect(result).toBeUndefined();
|
||||
expect(runEmbeddedPiAgent).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("persists a readable debug summary alongside the status line", async () => {
|
||||
const sessionKey = "agent:main:debug";
|
||||
hoisted.sessionStore[sessionKey] = {
|
||||
sessionId: "s-main",
|
||||
updatedAt: 0,
|
||||
};
|
||||
runEmbeddedPiAgent.mockImplementationOnce(async () => {
|
||||
return {
|
||||
meta: {
|
||||
activeMemorySearchDebug: {
|
||||
backend: "qmd",
|
||||
configuredMode: "search",
|
||||
effectiveMode: "query",
|
||||
fallback: "unsupported-search-flags",
|
||||
searchMs: 2590,
|
||||
hits: 3,
|
||||
},
|
||||
},
|
||||
payloads: [{ text: "User prefers lemon pepper wings, and blue cheese still wins." }],
|
||||
};
|
||||
runEmbeddedPiAgent.mockResolvedValueOnce({
|
||||
payloads: [{ text: "User prefers lemon pepper wings, and blue cheese still wins." }],
|
||||
});
|
||||
|
||||
await hooks.before_prompt_build(
|
||||
{
|
||||
prompt: "what wings should i order? debug telemetry",
|
||||
prompt: "what wings should i order?",
|
||||
messages: [],
|
||||
},
|
||||
{ agentId: "main", trigger: "user", sessionKey, messageProvider: "webchat" },
|
||||
@@ -940,7 +786,7 @@ describe("active-memory plugin", () => {
|
||||
lines: expect.arrayContaining([
|
||||
expect.stringContaining("🧩 Active Memory: ok"),
|
||||
expect.stringContaining(
|
||||
"🔎 Active Memory Debug: backend=qmd configuredMode=search effectiveMode=query fallback=unsupported-search-flags searchMs=2590 hits=3 | User prefers lemon pepper wings, and blue cheese still wins.",
|
||||
"🔎 Active Memory Debug: User prefers lemon pepper wings, and blue cheese still wins.",
|
||||
),
|
||||
]),
|
||||
},
|
||||
@@ -1100,43 +946,10 @@ describe("active-memory plugin", () => {
|
||||
expect(infoLines.some((line: string) => line.includes(" cached "))).toBe(false);
|
||||
});
|
||||
|
||||
it("ignores late subagent payloads once the active-memory timeout signal has fired", async () => {
|
||||
api.pluginConfig = {
|
||||
agents: ["main"],
|
||||
timeoutMs: 250,
|
||||
logging: true,
|
||||
};
|
||||
await plugin.register(api as unknown as OpenClawPluginApi);
|
||||
runEmbeddedPiAgent.mockImplementationOnce(async (params: { timeoutMs?: number }) => {
|
||||
await new Promise((resolve) => setTimeout(resolve, (params.timeoutMs ?? 0) + 25));
|
||||
return {
|
||||
payloads: [{ text: "late timeout payload that should never become memory context" }],
|
||||
meta: { aborted: true },
|
||||
};
|
||||
});
|
||||
|
||||
const result = await hooks.before_prompt_build(
|
||||
{ prompt: "what wings should i order? late payload timeout", messages: [] },
|
||||
{
|
||||
agentId: "main",
|
||||
trigger: "user",
|
||||
sessionKey: "agent:main:late-timeout-payload",
|
||||
messageProvider: "webchat",
|
||||
},
|
||||
);
|
||||
|
||||
expect(result).toBeUndefined();
|
||||
const infoLines = vi
|
||||
.mocked(api.logger.info)
|
||||
.mock.calls.map((call: unknown[]) => String(call[0]));
|
||||
expect(infoLines.some((line: string) => line.includes("status=timeout"))).toBe(true);
|
||||
});
|
||||
|
||||
it("uses a canonical agent session key when only sessionId is available", async () => {
|
||||
hoisted.sessionStore["agent:main:telegram:direct:12345"] = {
|
||||
sessionId: "session-a",
|
||||
updatedAt: 25,
|
||||
channel: "telegram",
|
||||
};
|
||||
|
||||
await hooks.before_prompt_build(
|
||||
@@ -1152,10 +965,6 @@ describe("active-memory plugin", () => {
|
||||
expect(runEmbeddedPiAgent.mock.calls.at(-1)?.[0]?.sessionKey).toMatch(
|
||||
/^agent:main:telegram:direct:12345:active-memory:[a-f0-9]{12}$/,
|
||||
);
|
||||
expect(runEmbeddedPiAgent.mock.calls.at(-1)?.[0]).toMatchObject({
|
||||
messageChannel: "telegram",
|
||||
messageProvider: "telegram",
|
||||
});
|
||||
expect(hoisted.sessionStore["agent:main:telegram:direct:12345"]?.pluginDebugEntries).toEqual([
|
||||
{
|
||||
pluginId: "active-memory",
|
||||
@@ -1191,82 +1000,6 @@ describe("active-memory plugin", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("prefers the resolved session channel over a wrapper channel hint", async () => {
|
||||
hoisted.sessionStore["agent:main:telegram:direct:12345"] = {
|
||||
sessionId: "session-a",
|
||||
updatedAt: 25,
|
||||
channel: "telegram",
|
||||
};
|
||||
|
||||
await hooks.before_prompt_build(
|
||||
{ prompt: "what wings should i order? wrapper channel hint", messages: [] },
|
||||
{
|
||||
agentId: "main",
|
||||
trigger: "user",
|
||||
sessionKey: "agent:main:telegram:direct:12345",
|
||||
messageProvider: "webchat",
|
||||
channelId: "webchat",
|
||||
},
|
||||
);
|
||||
|
||||
expect(runEmbeddedPiAgent.mock.calls.at(-1)?.[0]).toMatchObject({
|
||||
messageChannel: "telegram",
|
||||
messageProvider: "telegram",
|
||||
});
|
||||
});
|
||||
|
||||
it("preserves an explicit real channel hint over a stale stored wrapper channel", async () => {
|
||||
hoisted.sessionStore["agent:main:telegram:direct:12345"] = {
|
||||
sessionId: "session-a",
|
||||
updatedAt: 25,
|
||||
origin: {
|
||||
provider: "webchat",
|
||||
},
|
||||
};
|
||||
|
||||
await hooks.before_prompt_build(
|
||||
{ prompt: "what wings should i order? explicit channel hint", messages: [] },
|
||||
{
|
||||
agentId: "main",
|
||||
trigger: "user",
|
||||
sessionKey: "agent:main:telegram:direct:12345",
|
||||
messageProvider: "webchat",
|
||||
channelId: "telegram",
|
||||
},
|
||||
);
|
||||
|
||||
expect(runEmbeddedPiAgent.mock.calls.at(-1)?.[0]).toMatchObject({
|
||||
messageChannel: "telegram",
|
||||
messageProvider: "telegram",
|
||||
});
|
||||
});
|
||||
|
||||
it("preserves a direct explicit channel when weak legacy fallback disagrees", async () => {
|
||||
hoisted.sessionStore["agent:main:telegram:direct:12345"] = {
|
||||
sessionId: "session-a",
|
||||
updatedAt: 25,
|
||||
origin: {
|
||||
provider: "webchat",
|
||||
},
|
||||
};
|
||||
|
||||
await hooks.before_prompt_build(
|
||||
{ prompt: "what wings should i order? direct explicit channel", messages: [] },
|
||||
{
|
||||
agentId: "main",
|
||||
trigger: "user",
|
||||
sessionKey: "agent:main:telegram:direct:12345",
|
||||
messageProvider: "telegram",
|
||||
channelId: "telegram",
|
||||
},
|
||||
);
|
||||
|
||||
expect(runEmbeddedPiAgent.mock.calls.at(-1)?.[0]).toMatchObject({
|
||||
messageChannel: "telegram",
|
||||
messageProvider: "telegram",
|
||||
});
|
||||
});
|
||||
|
||||
it("clears stale status on skipped non-interactive turns even when agentId is missing", async () => {
|
||||
const sessionKey = "noncanonical-session";
|
||||
hoisted.sessionStore[sessionKey] = {
|
||||
|
||||
@@ -25,8 +25,8 @@ const DEFAULT_RECENT_USER_CHARS = 220;
|
||||
const DEFAULT_RECENT_ASSISTANT_CHARS = 180;
|
||||
const DEFAULT_CACHE_TTL_MS = 15_000;
|
||||
const DEFAULT_MAX_CACHE_ENTRIES = 1000;
|
||||
const DEFAULT_MODEL_REF = "github-copilot/gpt-5.4-mini";
|
||||
const DEFAULT_QUERY_MODE = "recent" as const;
|
||||
const DEFAULT_QMD_SEARCH_MODE = "search" as const;
|
||||
const DEFAULT_TRANSCRIPT_DIR = "active-memory";
|
||||
const TOGGLE_STATE_FILE = "session-toggles.json";
|
||||
|
||||
@@ -58,7 +58,6 @@ type ActiveRecallPluginConfig = {
|
||||
enabled?: boolean;
|
||||
agents?: string[];
|
||||
model?: string;
|
||||
modelFallback?: string;
|
||||
modelFallbackPolicy?: "default-remote" | "resolved-only";
|
||||
allowedChatTypes?: Array<"direct" | "group" | "channel">;
|
||||
thinking?: ActiveMemoryThinkingLevel;
|
||||
@@ -82,18 +81,12 @@ type ActiveRecallPluginConfig = {
|
||||
cacheTtlMs?: number;
|
||||
persistTranscripts?: boolean;
|
||||
transcriptDir?: string;
|
||||
qmd?: {
|
||||
searchMode?: ActiveMemoryQmdSearchMode;
|
||||
};
|
||||
};
|
||||
|
||||
type ActiveMemoryQmdSearchMode = "inherit" | "search" | "vsearch" | "query";
|
||||
|
||||
type ResolvedActiveRecallPluginConfig = {
|
||||
enabled: boolean;
|
||||
agents: string[];
|
||||
model?: string;
|
||||
modelFallback?: string;
|
||||
modelFallbackPolicy: "default-remote" | "resolved-only";
|
||||
allowedChatTypes: Array<"direct" | "group" | "channel">;
|
||||
thinking: ActiveMemoryThinkingLevel;
|
||||
@@ -117,9 +110,6 @@ type ResolvedActiveRecallPluginConfig = {
|
||||
cacheTtlMs: number;
|
||||
persistTranscripts: boolean;
|
||||
transcriptDir: string;
|
||||
qmd: {
|
||||
searchMode: ActiveMemoryQmdSearchMode;
|
||||
};
|
||||
};
|
||||
|
||||
type ActiveRecallRecentTurn = {
|
||||
@@ -132,29 +122,13 @@ type PluginDebugEntry = {
|
||||
lines: string[];
|
||||
};
|
||||
|
||||
type ActiveMemorySearchDebug = {
|
||||
backend?: string;
|
||||
configuredMode?: string;
|
||||
effectiveMode?: string;
|
||||
fallback?: string;
|
||||
searchMs?: number;
|
||||
hits?: number;
|
||||
};
|
||||
|
||||
type ActiveRecallResult =
|
||||
| {
|
||||
status: "empty" | "timeout" | "unavailable";
|
||||
elapsedMs: number;
|
||||
summary: string | null;
|
||||
searchDebug?: ActiveMemorySearchDebug;
|
||||
}
|
||||
| {
|
||||
status: "ok";
|
||||
elapsedMs: number;
|
||||
rawReply: string;
|
||||
summary: string;
|
||||
searchDebug?: ActiveMemorySearchDebug;
|
||||
};
|
||||
| { status: "ok"; elapsedMs: number; rawReply: string; summary: string };
|
||||
|
||||
type CachedActiveRecallResult = {
|
||||
expiresAt: number;
|
||||
@@ -263,18 +237,6 @@ function normalizePromptConfigText(value: unknown): string | undefined {
|
||||
return text ? text : undefined;
|
||||
}
|
||||
|
||||
function resolveQmdSearchMode(value: unknown): ActiveMemoryQmdSearchMode {
|
||||
if (value === "inherit" || value === "search" || value === "vsearch" || value === "query") {
|
||||
return value;
|
||||
}
|
||||
return DEFAULT_QMD_SEARCH_MODE;
|
||||
}
|
||||
|
||||
function hasDeprecatedModelFallbackPolicy(pluginConfig: unknown): boolean {
|
||||
const raw = asRecord(pluginConfig);
|
||||
return raw ? Object.hasOwn(raw, "modelFallbackPolicy") : false;
|
||||
}
|
||||
|
||||
function resolveSafeTranscriptDir(baseSessionsDir: string, transcriptDir: string): string {
|
||||
const normalized = transcriptDir.trim();
|
||||
if (!normalized || normalized.includes(":") || path.isAbsolute(normalized)) {
|
||||
@@ -352,85 +314,6 @@ function resolveCanonicalSessionKeyFromSessionId(params: {
|
||||
}
|
||||
}
|
||||
|
||||
function normalizeOptionalString(value: unknown): string | undefined {
|
||||
return typeof value === "string" && value.trim() ? value.trim() : undefined;
|
||||
}
|
||||
|
||||
function resolveRecallRunChannelContext(params: {
|
||||
api: OpenClawPluginApi;
|
||||
agentId: string;
|
||||
sessionKey?: string;
|
||||
sessionId?: string;
|
||||
messageProvider?: string;
|
||||
channelId?: string;
|
||||
}): {
|
||||
messageChannel?: string;
|
||||
messageProvider?: string;
|
||||
} {
|
||||
const explicitChannel = normalizeOptionalString(params.channelId);
|
||||
const explicitProvider = normalizeOptionalString(params.messageProvider);
|
||||
const trustedExplicitChannel =
|
||||
explicitChannel && explicitChannel !== explicitProvider ? explicitChannel : undefined;
|
||||
const resolveReturnValue = (params: {
|
||||
resolvedChannel?: string;
|
||||
resolvedChannelStrength?: "strong" | "weak";
|
||||
}) => {
|
||||
const trustedResolvedChannel =
|
||||
params.resolvedChannelStrength === "strong" ? params.resolvedChannel : undefined;
|
||||
return {
|
||||
messageChannel:
|
||||
trustedExplicitChannel ??
|
||||
trustedResolvedChannel ??
|
||||
explicitChannel ??
|
||||
params.resolvedChannel,
|
||||
messageProvider:
|
||||
trustedExplicitChannel ??
|
||||
trustedResolvedChannel ??
|
||||
explicitProvider ??
|
||||
explicitChannel ??
|
||||
params.resolvedChannel,
|
||||
};
|
||||
};
|
||||
const resolvedSessionKey =
|
||||
normalizeOptionalString(params.sessionKey) ??
|
||||
resolveCanonicalSessionKeyFromSessionId({
|
||||
api: params.api,
|
||||
agentId: params.agentId,
|
||||
sessionId: params.sessionId,
|
||||
});
|
||||
if (!resolvedSessionKey) {
|
||||
return resolveReturnValue({});
|
||||
}
|
||||
|
||||
try {
|
||||
const storePath = params.api.runtime.agent.session.resolveStorePath(
|
||||
params.api.config.session?.store,
|
||||
{
|
||||
agentId: params.agentId,
|
||||
},
|
||||
);
|
||||
const store = params.api.runtime.agent.session.loadSessionStore(storePath);
|
||||
const sessionEntry = resolveSessionStoreEntry({
|
||||
store,
|
||||
sessionKey: resolvedSessionKey,
|
||||
}).existing;
|
||||
const strongEntryChannel =
|
||||
normalizeOptionalString(sessionEntry?.lastChannel) ??
|
||||
normalizeOptionalString(sessionEntry?.channel);
|
||||
const weakEntryChannel = normalizeOptionalString(sessionEntry?.origin?.provider);
|
||||
return resolveReturnValue({
|
||||
resolvedChannel: strongEntryChannel ?? weakEntryChannel,
|
||||
resolvedChannelStrength: strongEntryChannel
|
||||
? "strong"
|
||||
: weakEntryChannel
|
||||
? "weak"
|
||||
: undefined,
|
||||
});
|
||||
} catch {
|
||||
return resolveReturnValue({});
|
||||
}
|
||||
}
|
||||
|
||||
function resolveToggleStatePath(api: OpenClawPluginApi): string {
|
||||
return path.join(
|
||||
api.runtime.state.resolveStateDir(),
|
||||
@@ -603,7 +486,6 @@ function normalizePluginConfig(pluginConfig: unknown): ResolvedActiveRecallPlugi
|
||||
const raw = (
|
||||
pluginConfig && typeof pluginConfig === "object" ? pluginConfig : {}
|
||||
) as ActiveRecallPluginConfig;
|
||||
const qmd = asRecord(raw.qmd);
|
||||
const allowedChatTypes = Array.isArray(raw.allowedChatTypes)
|
||||
? raw.allowedChatTypes.filter(
|
||||
(value): value is ActiveMemoryChatType =>
|
||||
@@ -616,10 +498,6 @@ function normalizePluginConfig(pluginConfig: unknown): ResolvedActiveRecallPlugi
|
||||
? raw.agents.map((agentId) => agentId.trim()).filter(Boolean)
|
||||
: [],
|
||||
model: typeof raw.model === "string" && raw.model.trim() ? raw.model.trim() : undefined,
|
||||
modelFallback:
|
||||
typeof raw.modelFallback === "string" && raw.modelFallback.trim()
|
||||
? raw.modelFallback.trim()
|
||||
: undefined,
|
||||
modelFallbackPolicy:
|
||||
raw.modelFallbackPolicy === "resolved-only" ? "resolved-only" : "default-remote",
|
||||
allowedChatTypes: allowedChatTypes.length > 0 ? allowedChatTypes : ["direct"],
|
||||
@@ -651,36 +529,6 @@ function normalizePluginConfig(pluginConfig: unknown): ResolvedActiveRecallPlugi
|
||||
cacheTtlMs: clampInt(raw.cacheTtlMs, DEFAULT_CACHE_TTL_MS, 1000, 120_000),
|
||||
persistTranscripts: raw.persistTranscripts === true,
|
||||
transcriptDir: normalizeTranscriptDir(raw.transcriptDir),
|
||||
qmd: {
|
||||
searchMode: resolveQmdSearchMode(qmd?.searchMode),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
function applyActiveMemoryRuntimeConfigSnapshot(
|
||||
cfg: OpenClawConfig,
|
||||
pluginConfig: ResolvedActiveRecallPluginConfig,
|
||||
): OpenClawConfig {
|
||||
const existingEntry = asRecord(cfg.plugins?.entries?.["active-memory"]);
|
||||
const existingPluginConfig = asRecord(existingEntry?.config);
|
||||
return {
|
||||
...cfg,
|
||||
plugins: {
|
||||
...cfg.plugins,
|
||||
entries: {
|
||||
...cfg.plugins?.entries,
|
||||
"active-memory": {
|
||||
...existingEntry,
|
||||
config: {
|
||||
...existingPluginConfig,
|
||||
qmd: {
|
||||
...asRecord(existingPluginConfig?.qmd),
|
||||
searchMode: pluginConfig.qmd.searchMode,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1011,48 +859,12 @@ function buildPluginStatusLine(params: {
|
||||
return parts.join(" ");
|
||||
}
|
||||
|
||||
function buildPluginDebugLine(params: {
|
||||
summary?: string | null;
|
||||
searchDebug?: ActiveMemorySearchDebug;
|
||||
}): string | null {
|
||||
const cleaned = sanitizeDebugText(params.summary ?? "");
|
||||
const debugParts: string[] = [];
|
||||
const backend = sanitizeDebugText(params.searchDebug?.backend ?? "");
|
||||
if (backend) {
|
||||
debugParts.push(`backend=${backend}`);
|
||||
function buildPluginDebugLine(summary: string | null | undefined): string | null {
|
||||
const cleaned = sanitizeDebugText(summary ?? "");
|
||||
if (!cleaned) {
|
||||
return null;
|
||||
}
|
||||
const configuredMode = sanitizeDebugText(params.searchDebug?.configuredMode ?? "");
|
||||
if (configuredMode) {
|
||||
debugParts.push(`configuredMode=${configuredMode}`);
|
||||
}
|
||||
const effectiveMode = sanitizeDebugText(params.searchDebug?.effectiveMode ?? "");
|
||||
if (effectiveMode) {
|
||||
debugParts.push(`effectiveMode=${effectiveMode}`);
|
||||
}
|
||||
const fallback = sanitizeDebugText(params.searchDebug?.fallback ?? "");
|
||||
if (fallback) {
|
||||
debugParts.push(`fallback=${fallback}`);
|
||||
}
|
||||
if (
|
||||
typeof params.searchDebug?.searchMs === "number" &&
|
||||
Number.isFinite(params.searchDebug.searchMs)
|
||||
) {
|
||||
debugParts.push(`searchMs=${Math.max(0, Math.round(params.searchDebug.searchMs))}`);
|
||||
}
|
||||
if (typeof params.searchDebug?.hits === "number" && Number.isFinite(params.searchDebug.hits)) {
|
||||
debugParts.push(`hits=${Math.max(0, Math.floor(params.searchDebug.hits))}`);
|
||||
}
|
||||
const prefix = debugParts.join(" ");
|
||||
if (prefix && cleaned) {
|
||||
return `${ACTIVE_MEMORY_DEBUG_PREFIX} ${prefix} | ${cleaned}`;
|
||||
}
|
||||
if (prefix) {
|
||||
return `${ACTIVE_MEMORY_DEBUG_PREFIX} ${prefix}`;
|
||||
}
|
||||
if (cleaned) {
|
||||
return `${ACTIVE_MEMORY_DEBUG_PREFIX} ${cleaned}`;
|
||||
}
|
||||
return null;
|
||||
return `${ACTIVE_MEMORY_DEBUG_PREFIX} ${cleaned}`;
|
||||
}
|
||||
|
||||
function sanitizeDebugText(text: string): string {
|
||||
@@ -1073,16 +885,12 @@ async function persistPluginStatusLines(params: {
|
||||
sessionKey?: string;
|
||||
statusLine?: string;
|
||||
debugSummary?: string | null;
|
||||
searchDebug?: ActiveMemorySearchDebug;
|
||||
}): Promise<void> {
|
||||
const sessionKey = params.sessionKey?.trim();
|
||||
if (!sessionKey) {
|
||||
return;
|
||||
}
|
||||
const debugLine = buildPluginDebugLine({
|
||||
summary: params.debugSummary,
|
||||
searchDebug: params.searchDebug,
|
||||
});
|
||||
const debugLine = buildPluginDebugLine(params.debugSummary);
|
||||
const agentId = params.agentId.trim();
|
||||
if (!agentId && (params.statusLine || debugLine)) {
|
||||
return;
|
||||
@@ -1143,99 +951,6 @@ async function persistPluginStatusLines(params: {
|
||||
}
|
||||
}
|
||||
|
||||
async function readActiveMemorySearchDebug(
|
||||
sessionFile: string,
|
||||
): Promise<ActiveMemorySearchDebug | undefined> {
|
||||
let raw: string;
|
||||
try {
|
||||
raw = await fs.readFile(sessionFile, "utf8");
|
||||
} catch {
|
||||
return undefined;
|
||||
}
|
||||
const lines = raw
|
||||
.split("\n")
|
||||
.map((line) => line.trim())
|
||||
.filter(Boolean);
|
||||
for (let index = lines.length - 1; index >= 0; index -= 1) {
|
||||
const line = lines[index];
|
||||
try {
|
||||
const parsed = JSON.parse(line) as unknown;
|
||||
const record = asRecord(parsed);
|
||||
const nestedMessage = asRecord(record?.message);
|
||||
const topLevelMessage =
|
||||
record?.role === "toolResult" || record?.toolName === "memory_search" ? record : undefined;
|
||||
const message = nestedMessage ?? topLevelMessage;
|
||||
if (!message) {
|
||||
continue;
|
||||
}
|
||||
const role = normalizeOptionalString(message.role);
|
||||
const toolName = normalizeOptionalString(message.toolName);
|
||||
if (role !== "toolResult" || toolName !== "memory_search") {
|
||||
continue;
|
||||
}
|
||||
const details = asRecord(message.details);
|
||||
const debug = asRecord(details?.debug);
|
||||
if (!debug) {
|
||||
continue;
|
||||
}
|
||||
return {
|
||||
backend: normalizeOptionalString(debug.backend),
|
||||
configuredMode: normalizeOptionalString(debug.configuredMode),
|
||||
effectiveMode: normalizeOptionalString(debug.effectiveMode),
|
||||
fallback: normalizeOptionalString(debug.fallback),
|
||||
searchMs:
|
||||
typeof debug.searchMs === "number" && Number.isFinite(debug.searchMs)
|
||||
? debug.searchMs
|
||||
: undefined,
|
||||
hits:
|
||||
typeof debug.hits === "number" && Number.isFinite(debug.hits) ? debug.hits : undefined,
|
||||
};
|
||||
} catch {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function normalizeSearchDebug(value: unknown): ActiveMemorySearchDebug | undefined {
|
||||
const debug = asRecord(value);
|
||||
if (!debug) {
|
||||
return undefined;
|
||||
}
|
||||
const normalized: ActiveMemorySearchDebug = {
|
||||
backend: normalizeOptionalString(debug.backend),
|
||||
configuredMode: normalizeOptionalString(debug.configuredMode),
|
||||
effectiveMode: normalizeOptionalString(debug.effectiveMode),
|
||||
fallback: normalizeOptionalString(debug.fallback),
|
||||
searchMs:
|
||||
typeof debug.searchMs === "number" && Number.isFinite(debug.searchMs)
|
||||
? debug.searchMs
|
||||
: undefined,
|
||||
hits: typeof debug.hits === "number" && Number.isFinite(debug.hits) ? debug.hits : undefined,
|
||||
};
|
||||
return normalized.backend ||
|
||||
normalized.configuredMode ||
|
||||
normalized.effectiveMode ||
|
||||
normalized.fallback ||
|
||||
typeof normalized.searchMs === "number" ||
|
||||
typeof normalized.hits === "number"
|
||||
? normalized
|
||||
: undefined;
|
||||
}
|
||||
|
||||
function readActiveMemorySearchDebugFromRunResult(
|
||||
result: unknown,
|
||||
): ActiveMemorySearchDebug | undefined {
|
||||
const record = asRecord(result);
|
||||
const meta = asRecord(record?.meta);
|
||||
return (
|
||||
normalizeSearchDebug(meta?.activeMemorySearchDebug) ??
|
||||
normalizeSearchDebug(meta?.memorySearchDebug) ??
|
||||
normalizeSearchDebug(record?.activeMemorySearchDebug) ??
|
||||
normalizeSearchDebug(record?.memorySearchDebug)
|
||||
);
|
||||
}
|
||||
|
||||
function escapeXml(str: string): string {
|
||||
return str
|
||||
.replace(/&/g, "&")
|
||||
@@ -1421,15 +1136,6 @@ function extractRecentTurns(messages: unknown[]): ActiveRecallRecentTurn[] {
|
||||
return turns;
|
||||
}
|
||||
|
||||
function parseModelCandidate(modelRef: string | undefined) {
|
||||
if (!modelRef) {
|
||||
return undefined;
|
||||
}
|
||||
return (
|
||||
parseModelRef(modelRef, DEFAULT_PROVIDER) ?? { provider: DEFAULT_PROVIDER, model: modelRef }
|
||||
);
|
||||
}
|
||||
|
||||
function getModelRef(
|
||||
api: OpenClawPluginApi,
|
||||
agentId: string,
|
||||
@@ -1438,22 +1144,31 @@ function getModelRef(
|
||||
modelProviderId?: string;
|
||||
modelId?: string;
|
||||
},
|
||||
): { provider: string; model: string } | undefined {
|
||||
) {
|
||||
const currentRunModel =
|
||||
ctx?.modelProviderId && ctx?.modelId ? `${ctx.modelProviderId}/${ctx.modelId}` : undefined;
|
||||
const candidates = [
|
||||
config.model,
|
||||
currentRunModel,
|
||||
resolveAgentEffectiveModelPrimary(api.config, agentId),
|
||||
config.modelFallback,
|
||||
];
|
||||
for (const candidate of candidates) {
|
||||
const parsed = parseModelCandidate(candidate);
|
||||
if (parsed) {
|
||||
return parsed;
|
||||
}
|
||||
const agentPrimaryModel = resolveAgentEffectiveModelPrimary(api.config, agentId);
|
||||
const configured =
|
||||
config.model ||
|
||||
currentRunModel ||
|
||||
agentPrimaryModel ||
|
||||
(config.modelFallbackPolicy === "default-remote" ? DEFAULT_MODEL_REF : undefined);
|
||||
if (!configured) {
|
||||
return undefined;
|
||||
}
|
||||
return undefined;
|
||||
const parsed = parseModelRef(configured, DEFAULT_PROVIDER);
|
||||
if (parsed) {
|
||||
return parsed;
|
||||
}
|
||||
const parsedAgentPrimary = agentPrimaryModel
|
||||
? parseModelRef(agentPrimaryModel, DEFAULT_PROVIDER)
|
||||
: undefined;
|
||||
return (
|
||||
parsedAgentPrimary ?? {
|
||||
provider: DEFAULT_PROVIDER,
|
||||
model: configured,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
async function runRecallSubagent(params: {
|
||||
@@ -1462,17 +1177,11 @@ async function runRecallSubagent(params: {
|
||||
agentId: string;
|
||||
sessionKey?: string;
|
||||
sessionId?: string;
|
||||
messageProvider?: string;
|
||||
channelId?: string;
|
||||
query: string;
|
||||
currentModelProviderId?: string;
|
||||
currentModelId?: string;
|
||||
abortSignal?: AbortSignal;
|
||||
}): Promise<{
|
||||
rawReply: string;
|
||||
transcriptPath?: string;
|
||||
searchDebug?: ActiveMemorySearchDebug;
|
||||
}> {
|
||||
}): Promise<{ rawReply: string; transcriptPath?: string }> {
|
||||
const workspaceDir = resolveAgentWorkspaceDir(params.api.config, params.agentId);
|
||||
const agentDir = resolveAgentDir(params.api.config, params.agentId);
|
||||
const modelRef = getModelRef(params.api, params.agentId, params.config, {
|
||||
@@ -1519,27 +1228,16 @@ async function runRecallSubagent(params: {
|
||||
config: params.config,
|
||||
query: params.query,
|
||||
});
|
||||
const { messageChannel, messageProvider } = resolveRecallRunChannelContext({
|
||||
api: params.api,
|
||||
agentId: params.agentId,
|
||||
sessionKey: parentSessionKey,
|
||||
sessionId: params.sessionId,
|
||||
messageProvider: params.messageProvider,
|
||||
channelId: params.channelId,
|
||||
});
|
||||
|
||||
try {
|
||||
const embeddedConfig = applyActiveMemoryRuntimeConfigSnapshot(params.api.config, params.config);
|
||||
const result = await params.api.runtime.agent.runEmbeddedPiAgent({
|
||||
sessionId: subagentSessionId,
|
||||
sessionKey: subagentSessionKey,
|
||||
agentId: params.agentId,
|
||||
messageChannel,
|
||||
messageProvider,
|
||||
sessionFile,
|
||||
workspaceDir,
|
||||
agentDir,
|
||||
config: embeddedConfig,
|
||||
config: params.api.config,
|
||||
prompt,
|
||||
provider: modelRef.provider,
|
||||
model: modelRef.model,
|
||||
@@ -1555,30 +1253,14 @@ async function runRecallSubagent(params: {
|
||||
silentExpected: true,
|
||||
abortSignal: params.abortSignal,
|
||||
});
|
||||
if (params.abortSignal?.aborted) {
|
||||
const reason = params.abortSignal.reason;
|
||||
if (reason instanceof Error) {
|
||||
throw reason;
|
||||
}
|
||||
const abortErr =
|
||||
reason !== undefined
|
||||
? new Error("Operation aborted", { cause: reason })
|
||||
: new Error("Operation aborted");
|
||||
abortErr.name = "AbortError";
|
||||
throw abortErr;
|
||||
}
|
||||
const rawReply = (result.payloads ?? [])
|
||||
.map((payload) => payload.text?.trim() ?? "")
|
||||
.filter(Boolean)
|
||||
.join("\n")
|
||||
.trim();
|
||||
const searchDebug =
|
||||
(await readActiveMemorySearchDebug(sessionFile)) ??
|
||||
readActiveMemorySearchDebugFromRunResult(result);
|
||||
return {
|
||||
rawReply: rawReply || "NONE",
|
||||
transcriptPath: params.config.persistTranscripts ? sessionFile : undefined,
|
||||
searchDebug,
|
||||
};
|
||||
} finally {
|
||||
if (tempDir) {
|
||||
@@ -1593,8 +1275,6 @@ async function maybeResolveActiveRecall(params: {
|
||||
agentId: string;
|
||||
sessionKey?: string;
|
||||
sessionId?: string;
|
||||
messageProvider?: string;
|
||||
channelId?: string;
|
||||
query: string;
|
||||
currentModelProviderId?: string;
|
||||
currentModelId?: string;
|
||||
@@ -1615,7 +1295,6 @@ async function maybeResolveActiveRecall(params: {
|
||||
sessionKey: params.sessionKey,
|
||||
statusLine: `${buildPluginStatusLine({ result: cached, config: params.config })} cached`,
|
||||
debugSummary: cached.summary,
|
||||
searchDebug: cached.searchDebug,
|
||||
});
|
||||
if (params.config.logging) {
|
||||
params.api.logger.info?.(
|
||||
@@ -1638,7 +1317,7 @@ async function maybeResolveActiveRecall(params: {
|
||||
timeoutId.unref?.();
|
||||
|
||||
try {
|
||||
const { rawReply, transcriptPath, searchDebug } = await runRecallSubagent({
|
||||
const { rawReply, transcriptPath } = await runRecallSubagent({
|
||||
...params,
|
||||
abortSignal: controller.signal,
|
||||
});
|
||||
@@ -1656,13 +1335,11 @@ async function maybeResolveActiveRecall(params: {
|
||||
elapsedMs: Date.now() - startedAt,
|
||||
rawReply,
|
||||
summary,
|
||||
searchDebug,
|
||||
}
|
||||
: {
|
||||
status: "empty",
|
||||
elapsedMs: Date.now() - startedAt,
|
||||
summary: null,
|
||||
searchDebug,
|
||||
};
|
||||
if (params.config.logging) {
|
||||
params.api.logger.info?.(
|
||||
@@ -1675,7 +1352,6 @@ async function maybeResolveActiveRecall(params: {
|
||||
sessionKey: params.sessionKey,
|
||||
statusLine: buildPluginStatusLine({ result, config: params.config }),
|
||||
debugSummary: result.summary,
|
||||
searchDebug: result.searchDebug,
|
||||
});
|
||||
if (shouldCacheResult(result)) {
|
||||
setCachedResult(cacheKey, result, params.config.cacheTtlMs);
|
||||
@@ -1698,7 +1374,6 @@ async function maybeResolveActiveRecall(params: {
|
||||
agentId: params.agentId,
|
||||
sessionKey: params.sessionKey,
|
||||
statusLine: buildPluginStatusLine({ result, config: params.config }),
|
||||
searchDebug: result.searchDebug,
|
||||
});
|
||||
return result;
|
||||
}
|
||||
@@ -1716,7 +1391,6 @@ async function maybeResolveActiveRecall(params: {
|
||||
agentId: params.agentId,
|
||||
sessionKey: params.sessionKey,
|
||||
statusLine: buildPluginStatusLine({ result, config: params.config }),
|
||||
searchDebug: result.searchDebug,
|
||||
});
|
||||
return result;
|
||||
} finally {
|
||||
@@ -1730,20 +1404,11 @@ export default definePluginEntry({
|
||||
description: "Proactively surfaces relevant memory before eligible conversational replies.",
|
||||
register(api: OpenClawPluginApi) {
|
||||
let config = normalizePluginConfig(api.pluginConfig);
|
||||
const warnDeprecatedModelFallbackPolicy = (pluginConfig: unknown) => {
|
||||
if (hasDeprecatedModelFallbackPolicy(pluginConfig)) {
|
||||
api.logger.warn?.(
|
||||
"active-memory: config.modelFallbackPolicy is deprecated and no longer changes runtime behavior; set config.modelFallback explicitly if you want a fallback model",
|
||||
);
|
||||
}
|
||||
};
|
||||
warnDeprecatedModelFallbackPolicy(api.pluginConfig);
|
||||
const refreshLiveConfigFromRuntime = () => {
|
||||
const livePluginConfig =
|
||||
config = normalizePluginConfig(
|
||||
resolveActiveMemoryPluginConfigFromConfig(api.runtime.config.loadConfig()) ??
|
||||
api.pluginConfig;
|
||||
config = normalizePluginConfig(livePluginConfig);
|
||||
warnDeprecatedModelFallbackPolicy(livePluginConfig);
|
||||
api.pluginConfig,
|
||||
);
|
||||
};
|
||||
api.registerCommand({
|
||||
name: "active-memory",
|
||||
@@ -1874,8 +1539,6 @@ export default definePluginEntry({
|
||||
agentId: effectiveAgentId,
|
||||
sessionKey: resolvedSessionKey,
|
||||
sessionId: ctx.sessionId,
|
||||
messageProvider: ctx.messageProvider,
|
||||
channelId: ctx.channelId,
|
||||
query,
|
||||
currentModelProviderId: ctx.modelProviderId,
|
||||
currentModelId: ctx.modelId,
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
"items": { "type": "string" }
|
||||
},
|
||||
"model": { "type": "string" },
|
||||
"modelFallback": { "type": "string" },
|
||||
"modelFallbackPolicy": {
|
||||
"type": "string",
|
||||
"enum": ["default-remote", "resolved-only"]
|
||||
@@ -54,17 +53,7 @@
|
||||
"logging": { "type": "boolean" },
|
||||
"persistTranscripts": { "type": "boolean" },
|
||||
"transcriptDir": { "type": "string" },
|
||||
"cacheTtlMs": { "type": "integer", "minimum": 1000, "maximum": 120000 },
|
||||
"qmd": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"searchMode": {
|
||||
"type": "string",
|
||||
"enum": ["inherit", "search", "vsearch", "query"]
|
||||
}
|
||||
}
|
||||
}
|
||||
"cacheTtlMs": { "type": "integer", "minimum": 1000, "maximum": 120000 }
|
||||
}
|
||||
},
|
||||
"uiHints": {
|
||||
@@ -80,13 +69,9 @@
|
||||
"label": "Memory Model",
|
||||
"help": "Provider/model used for the blocking memory sub-agent."
|
||||
},
|
||||
"modelFallback": {
|
||||
"label": "Fallback Memory Model",
|
||||
"help": "Optional provider/model to use if no explicit plugin model, session model, or agent primary model resolves."
|
||||
},
|
||||
"modelFallbackPolicy": {
|
||||
"label": "Model Fallback Policy",
|
||||
"help": "Deprecated compatibility field. Active Memory no longer uses a built-in fallback model; set modelFallback explicitly if you want a fallback."
|
||||
"help": "Choose whether Active Memory falls back to the built-in remote default model when no explicit or inherited model is available."
|
||||
},
|
||||
"allowedChatTypes": {
|
||||
"label": "Allowed Chat Types",
|
||||
@@ -130,10 +115,6 @@
|
||||
"transcriptDir": {
|
||||
"label": "Transcript Directory",
|
||||
"help": "Relative directory under the agent sessions folder used when transcript persistence is enabled."
|
||||
},
|
||||
"qmd.searchMode": {
|
||||
"label": "QMD Search Mode",
|
||||
"help": "Override the QMD search mode used by the blocking memory sub-agent. Defaults to fast lexical search; use inherit to match the main memory backend setting."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@openclaw/alibaba-provider",
|
||||
"version": "2026.4.11",
|
||||
"version": "2026.4.10",
|
||||
"private": true,
|
||||
"description": "OpenClaw Alibaba Model Studio video provider plugin",
|
||||
"type": "module",
|
||||
|
||||
@@ -4,7 +4,6 @@ import {
|
||||
expectSuccessfulDashscopeVideoResult,
|
||||
mockSuccessfulDashscopeVideoTask,
|
||||
} from "../../test/helpers/media-generation/dashscope-video-provider.js";
|
||||
import { expectExplicitVideoGenerationCapabilities } from "../../test/helpers/media-generation/provider-capability-assertions.js";
|
||||
import {
|
||||
getProviderHttpMocks,
|
||||
installProviderHttpMockCleanup,
|
||||
@@ -21,10 +20,6 @@ beforeAll(async () => {
|
||||
installProviderHttpMockCleanup();
|
||||
|
||||
describe("alibaba video generation provider", () => {
|
||||
it("declares explicit mode capabilities", () => {
|
||||
expectExplicitVideoGenerationCapabilities(buildAlibabaVideoGenerationProvider());
|
||||
});
|
||||
|
||||
it("submits async Wan generation, polls task status, and downloads the resulting video", async () => {
|
||||
mockSuccessfulDashscopeVideoTask({ postJsonRequestMock, fetchWithTimeoutMock });
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@openclaw/amazon-bedrock-mantle-provider",
|
||||
"version": "2026.4.11",
|
||||
"version": "2026.4.10",
|
||||
"private": true,
|
||||
"description": "OpenClaw Amazon Bedrock Mantle (OpenAI-compatible) provider plugin",
|
||||
"type": "module",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@openclaw/amazon-bedrock-provider",
|
||||
"version": "2026.4.11",
|
||||
"version": "2026.4.10",
|
||||
"private": true,
|
||||
"description": "OpenClaw Amazon Bedrock provider plugin",
|
||||
"type": "module",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@openclaw/anthropic-vertex-provider",
|
||||
"version": "2026.4.11",
|
||||
"version": "2026.4.10",
|
||||
"private": true,
|
||||
"description": "OpenClaw Anthropic Vertex provider plugin",
|
||||
"type": "module",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@openclaw/anthropic-provider",
|
||||
"version": "2026.4.11",
|
||||
"version": "2026.4.10",
|
||||
"private": true,
|
||||
"description": "OpenClaw Anthropic provider plugin",
|
||||
"type": "module",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@openclaw/arcee-provider",
|
||||
"version": "2026.4.11",
|
||||
"version": "2026.4.10",
|
||||
"private": true,
|
||||
"description": "OpenClaw Arcee provider plugin",
|
||||
"type": "module",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@openclaw/bluebubbles",
|
||||
"version": "2026.4.11",
|
||||
"version": "2026.4.10",
|
||||
"description": "OpenClaw BlueBubbles channel plugin",
|
||||
"type": "module",
|
||||
"devDependencies": {
|
||||
@@ -8,7 +8,7 @@
|
||||
"openclaw": "workspace:*"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"openclaw": ">=2026.4.11"
|
||||
"openclaw": ">=2026.4.10"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"openclaw": {
|
||||
@@ -43,10 +43,10 @@
|
||||
"minHostVersion": ">=2026.4.10"
|
||||
},
|
||||
"compat": {
|
||||
"pluginApi": ">=2026.4.11"
|
||||
"pluginApi": ">=2026.4.10"
|
||||
},
|
||||
"build": {
|
||||
"openclawVersion": "2026.4.11"
|
||||
"openclawVersion": "2026.4.10"
|
||||
},
|
||||
"release": {
|
||||
"publishToClawHub": true,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@openclaw/brave-plugin",
|
||||
"version": "2026.4.11",
|
||||
"version": "2026.4.10",
|
||||
"private": true,
|
||||
"description": "OpenClaw Brave plugin",
|
||||
"type": "module",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@openclaw/browser-plugin",
|
||||
"version": "2026.4.11",
|
||||
"version": "2026.4.10",
|
||||
"private": true,
|
||||
"description": "OpenClaw browser tool plugin",
|
||||
"type": "module",
|
||||
|
||||
@@ -66,35 +66,6 @@ function readPersistedConfig(): OpenClawConfig {
|
||||
return persistedCfg;
|
||||
}
|
||||
|
||||
async function expectGeneratedBrowserAuthPersistence(params: {
|
||||
cfg: OpenClawConfig;
|
||||
mode: "none" | "trusted-proxy";
|
||||
generatedAuthField: "token" | "password";
|
||||
}) {
|
||||
mocks.loadConfig.mockReturnValue(params.cfg);
|
||||
|
||||
const result = await ensureBrowserControlAuth({ cfg: params.cfg, env: {} as NodeJS.ProcessEnv });
|
||||
|
||||
expect(result.generatedToken).toMatch(/^[a-f0-9]{48}$/);
|
||||
expect(result.auth[params.generatedAuthField]).toBe(result.generatedToken);
|
||||
expect(result.auth[params.generatedAuthField === "token" ? "password" : "token"]).toBeUndefined();
|
||||
expect(mocks.writeConfigFile).toHaveBeenCalledTimes(1);
|
||||
const persistedCfg = readPersistedConfig();
|
||||
expect(persistedCfg?.gateway?.auth?.mode).toBe(params.mode);
|
||||
expect(persistedCfg?.gateway?.auth?.[params.generatedAuthField]).toBe(result.generatedToken);
|
||||
expect(mocks.ensureGatewayStartupAuth).not.toHaveBeenCalled();
|
||||
}
|
||||
|
||||
async function expectUnresolvedBrowserSecretRefSkipsPersistence(cfg: OpenClawConfig) {
|
||||
mocks.loadConfig.mockReturnValue(cfg);
|
||||
|
||||
const result = await ensureBrowserControlAuth({ cfg, env: {} as NodeJS.ProcessEnv });
|
||||
|
||||
expect(result).toEqual({ auth: {} });
|
||||
expect(mocks.writeConfigFile).not.toHaveBeenCalled();
|
||||
expect(mocks.ensureGatewayStartupAuth).not.toHaveBeenCalled();
|
||||
}
|
||||
|
||||
let ensureBrowserControlAuth: typeof import("./control-auth.js").ensureBrowserControlAuth;
|
||||
|
||||
describe("ensureBrowserControlAuth", () => {
|
||||
@@ -205,11 +176,18 @@ describe("ensureBrowserControlAuth", () => {
|
||||
enabled: true,
|
||||
},
|
||||
};
|
||||
await expectGeneratedBrowserAuthPersistence({
|
||||
cfg,
|
||||
mode: "none",
|
||||
generatedAuthField: "token",
|
||||
});
|
||||
mocks.loadConfig.mockReturnValue(cfg);
|
||||
|
||||
const result = await ensureBrowserControlAuth({ cfg, env: {} as NodeJS.ProcessEnv });
|
||||
|
||||
expect(result.generatedToken).toMatch(/^[a-f0-9]{48}$/);
|
||||
expect(result.auth.token).toBe(result.generatedToken);
|
||||
expect(result.auth.password).toBeUndefined();
|
||||
expect(mocks.writeConfigFile).toHaveBeenCalledTimes(1);
|
||||
const persistedCfg = readPersistedConfig();
|
||||
expect(persistedCfg?.gateway?.auth?.mode).toBe("none");
|
||||
expect(persistedCfg?.gateway?.auth?.token).toBe(result.generatedToken);
|
||||
expect(mocks.ensureGatewayStartupAuth).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("does not persist over unresolved token SecretRef in none mode", async () => {
|
||||
@@ -224,7 +202,13 @@ describe("ensureBrowserControlAuth", () => {
|
||||
enabled: true,
|
||||
},
|
||||
};
|
||||
await expectUnresolvedBrowserSecretRefSkipsPersistence(cfg);
|
||||
mocks.loadConfig.mockReturnValue(cfg);
|
||||
|
||||
const result = await ensureBrowserControlAuth({ cfg, env: {} as NodeJS.ProcessEnv });
|
||||
|
||||
expect(result).toEqual({ auth: {} });
|
||||
expect(mocks.writeConfigFile).not.toHaveBeenCalled();
|
||||
expect(mocks.ensureGatewayStartupAuth).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("still auto-generates in none mode when only password SecretRef is set", async () => {
|
||||
@@ -239,11 +223,18 @@ describe("ensureBrowserControlAuth", () => {
|
||||
enabled: true,
|
||||
},
|
||||
};
|
||||
await expectGeneratedBrowserAuthPersistence({
|
||||
cfg,
|
||||
mode: "none",
|
||||
generatedAuthField: "token",
|
||||
});
|
||||
mocks.loadConfig.mockReturnValue(cfg);
|
||||
|
||||
const result = await ensureBrowserControlAuth({ cfg, env: {} as NodeJS.ProcessEnv });
|
||||
|
||||
expect(result.generatedToken).toMatch(/^[a-f0-9]{48}$/);
|
||||
expect(result.auth.token).toBe(result.generatedToken);
|
||||
expect(result.auth.password).toBeUndefined();
|
||||
expect(mocks.writeConfigFile).toHaveBeenCalledTimes(1);
|
||||
const persistedCfg = readPersistedConfig();
|
||||
expect(persistedCfg?.gateway?.auth?.mode).toBe("none");
|
||||
expect(persistedCfg?.gateway?.auth?.token).toBe(result.generatedToken);
|
||||
expect(mocks.ensureGatewayStartupAuth).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("auto-generates in trusted-proxy mode and persists browser auth password", async () => {
|
||||
@@ -255,11 +246,18 @@ describe("ensureBrowserControlAuth", () => {
|
||||
enabled: true,
|
||||
},
|
||||
};
|
||||
await expectGeneratedBrowserAuthPersistence({
|
||||
cfg,
|
||||
mode: "trusted-proxy",
|
||||
generatedAuthField: "password",
|
||||
});
|
||||
mocks.loadConfig.mockReturnValue(cfg);
|
||||
|
||||
const result = await ensureBrowserControlAuth({ cfg, env: {} as NodeJS.ProcessEnv });
|
||||
|
||||
expect(result.generatedToken).toMatch(/^[a-f0-9]{48}$/);
|
||||
expect(result.auth.password).toBe(result.generatedToken);
|
||||
expect(result.auth.token).toBeUndefined();
|
||||
expect(mocks.writeConfigFile).toHaveBeenCalledTimes(1);
|
||||
const persistedCfg = readPersistedConfig();
|
||||
expect(persistedCfg?.gateway?.auth?.mode).toBe("trusted-proxy");
|
||||
expect(persistedCfg?.gateway?.auth?.password).toBe(result.generatedToken);
|
||||
expect(mocks.ensureGatewayStartupAuth).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("still auto-generates in trusted-proxy mode when only token SecretRef is set", async () => {
|
||||
@@ -275,11 +273,18 @@ describe("ensureBrowserControlAuth", () => {
|
||||
enabled: true,
|
||||
},
|
||||
};
|
||||
await expectGeneratedBrowserAuthPersistence({
|
||||
cfg,
|
||||
mode: "trusted-proxy",
|
||||
generatedAuthField: "password",
|
||||
});
|
||||
mocks.loadConfig.mockReturnValue(cfg);
|
||||
|
||||
const result = await ensureBrowserControlAuth({ cfg, env: {} as NodeJS.ProcessEnv });
|
||||
|
||||
expect(result.generatedToken).toMatch(/^[a-f0-9]{48}$/);
|
||||
expect(result.auth.password).toBe(result.generatedToken);
|
||||
expect(result.auth.token).toBeUndefined();
|
||||
expect(mocks.writeConfigFile).toHaveBeenCalledTimes(1);
|
||||
const persistedCfg = readPersistedConfig();
|
||||
expect(persistedCfg?.gateway?.auth?.mode).toBe("trusted-proxy");
|
||||
expect(persistedCfg?.gateway?.auth?.password).toBe(result.generatedToken);
|
||||
expect(mocks.ensureGatewayStartupAuth).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("does not persist over unresolved password SecretRef in trusted-proxy mode", async () => {
|
||||
@@ -295,7 +300,13 @@ describe("ensureBrowserControlAuth", () => {
|
||||
enabled: true,
|
||||
},
|
||||
};
|
||||
await expectUnresolvedBrowserSecretRefSkipsPersistence(cfg);
|
||||
mocks.loadConfig.mockReturnValue(cfg);
|
||||
|
||||
const result = await ensureBrowserControlAuth({ cfg, env: {} as NodeJS.ProcessEnv });
|
||||
|
||||
expect(result).toEqual({ auth: {} });
|
||||
expect(mocks.writeConfigFile).not.toHaveBeenCalled();
|
||||
expect(mocks.ensureGatewayStartupAuth).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("reuses auth from latest config snapshot", async () => {
|
||||
|
||||
@@ -3,8 +3,8 @@ import {
|
||||
normalizeLowercaseStringOrEmpty,
|
||||
normalizeOptionalString,
|
||||
} from "openclaw/plugin-sdk/text-runtime";
|
||||
import { loadConfig, writeConfigFile } from "../config/config.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { loadConfig, writeConfigFile } from "../config/config.js";
|
||||
import { resolveGatewayAuth } from "../gateway/auth.js";
|
||||
import { ensureGatewayStartupAuth } from "../gateway/startup-auth.js";
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { afterEach, beforeEach, vi } from "vitest";
|
||||
import { deriveDefaultBrowserCdpPortRange } from "../config/port-defaults.js";
|
||||
import type { MockFn } from "../test-utils/vitest-mock-fn.js";
|
||||
import { installChromeUserDataDirHooks } from "./chrome-user-data-dir.test-harness.js";
|
||||
import { getFreePort } from "./test-port.js";
|
||||
@@ -376,13 +375,9 @@ function makeProc(pid = 123) {
|
||||
|
||||
const proc = makeProc();
|
||||
|
||||
function defaultBrowserCdpPortForState(testPort: number): number {
|
||||
return deriveDefaultBrowserCdpPortRange(testPort).start;
|
||||
}
|
||||
|
||||
function defaultProfilesForState(testPort: number): HarnessState["cfgProfiles"] {
|
||||
return {
|
||||
openclaw: { cdpPort: defaultBrowserCdpPortForState(testPort), color: "#FF4500" },
|
||||
openclaw: { cdpPort: testPort + 9, color: "#FF4500" },
|
||||
};
|
||||
}
|
||||
|
||||
@@ -525,7 +520,7 @@ export async function resetBrowserControlServerTestContext(): Promise<void> {
|
||||
mockClearAll(chromeMcpMocks);
|
||||
|
||||
state.testPort = await getFreePort();
|
||||
state.cdpBaseUrl = `http://127.0.0.1:${defaultBrowserCdpPortForState(state.testPort)}`;
|
||||
state.cdpBaseUrl = `http://127.0.0.1:${state.testPort + 9}`;
|
||||
state.cfgProfiles = defaultProfilesForState(state.testPort);
|
||||
state.prevGatewayPort = process.env.OPENCLAW_GATEWAY_PORT;
|
||||
process.env.OPENCLAW_GATEWAY_PORT = String(state.testPort - 2);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@openclaw/byteplus-provider",
|
||||
"version": "2026.4.11",
|
||||
"version": "2026.4.10",
|
||||
"private": true,
|
||||
"description": "OpenClaw BytePlus provider plugin",
|
||||
"type": "module",
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { beforeAll, describe, expect, it, vi } from "vitest";
|
||||
import { expectExplicitVideoGenerationCapabilities } from "../../test/helpers/media-generation/provider-capability-assertions.js";
|
||||
import {
|
||||
getProviderHttpMocks,
|
||||
installProviderHttpMockCleanup,
|
||||
@@ -15,39 +14,31 @@ beforeAll(async () => {
|
||||
|
||||
installProviderHttpMockCleanup();
|
||||
|
||||
function mockSuccessfulBytePlusTask(params?: { model?: string }) {
|
||||
postJsonRequestMock.mockResolvedValue({
|
||||
response: {
|
||||
json: async () => ({
|
||||
id: "task_123",
|
||||
}),
|
||||
},
|
||||
release: vi.fn(async () => {}),
|
||||
});
|
||||
fetchWithTimeoutMock
|
||||
.mockResolvedValueOnce({
|
||||
json: async () => ({
|
||||
id: "task_123",
|
||||
status: "succeeded",
|
||||
content: {
|
||||
video_url: "https://example.com/byteplus.mp4",
|
||||
},
|
||||
model: params?.model ?? "seedance-1-0-lite-t2v-250428",
|
||||
}),
|
||||
})
|
||||
.mockResolvedValueOnce({
|
||||
headers: new Headers({ "content-type": "video/mp4" }),
|
||||
arrayBuffer: async () => Buffer.from("mp4-bytes"),
|
||||
});
|
||||
}
|
||||
|
||||
describe("byteplus video generation provider", () => {
|
||||
it("declares explicit mode capabilities", () => {
|
||||
expectExplicitVideoGenerationCapabilities(buildBytePlusVideoGenerationProvider());
|
||||
});
|
||||
|
||||
it("creates a content-generation task, polls, and downloads the video", async () => {
|
||||
mockSuccessfulBytePlusTask();
|
||||
postJsonRequestMock.mockResolvedValue({
|
||||
response: {
|
||||
json: async () => ({
|
||||
id: "task_123",
|
||||
}),
|
||||
},
|
||||
release: vi.fn(async () => {}),
|
||||
});
|
||||
fetchWithTimeoutMock
|
||||
.mockResolvedValueOnce({
|
||||
json: async () => ({
|
||||
id: "task_123",
|
||||
status: "succeeded",
|
||||
content: {
|
||||
video_url: "https://example.com/byteplus.mp4",
|
||||
},
|
||||
model: "seedance-1-0-lite-t2v-250428",
|
||||
}),
|
||||
})
|
||||
.mockResolvedValueOnce({
|
||||
headers: new Headers({ "content-type": "video/mp4" }),
|
||||
arrayBuffer: async () => Buffer.from("mp4-bytes"),
|
||||
});
|
||||
|
||||
const provider = buildBytePlusVideoGenerationProvider();
|
||||
const result = await provider.generateVideo({
|
||||
@@ -69,57 +60,4 @@ describe("byteplus video generation provider", () => {
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it("switches t2v image requests to i2v models and lowercases resolution", async () => {
|
||||
mockSuccessfulBytePlusTask({ model: "seedance-1-0-lite-i2v-250428" });
|
||||
|
||||
const provider = buildBytePlusVideoGenerationProvider();
|
||||
await provider.generateVideo({
|
||||
provider: "byteplus",
|
||||
model: "seedance-1-0-lite-t2v-250428",
|
||||
prompt: "Animate this still image",
|
||||
resolution: "720P",
|
||||
inputImages: [{ url: "https://example.com/first-frame.png" }],
|
||||
cfg: {},
|
||||
});
|
||||
|
||||
const request = postJsonRequestMock.mock.calls[0]?.[0] as { body?: Record<string, unknown> };
|
||||
expect(request.body).toMatchObject({
|
||||
model: "seedance-1-0-lite-i2v-250428",
|
||||
resolution: "720p",
|
||||
content: [
|
||||
{ type: "text", text: "Animate this still image" },
|
||||
{
|
||||
type: "image_url",
|
||||
image_url: { url: "https://example.com/first-frame.png" },
|
||||
role: "first_frame",
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
it("maps declared providerOptions into the request body", async () => {
|
||||
mockSuccessfulBytePlusTask({ model: "seedance-1-0-pro-250528" });
|
||||
|
||||
const provider = buildBytePlusVideoGenerationProvider();
|
||||
await provider.generateVideo({
|
||||
provider: "byteplus",
|
||||
model: "seedance-1-0-pro-250528",
|
||||
prompt: "A cinematic lobster montage",
|
||||
providerOptions: {
|
||||
seed: 42,
|
||||
draft: true,
|
||||
camera_fixed: false,
|
||||
},
|
||||
cfg: {},
|
||||
});
|
||||
|
||||
const request = postJsonRequestMock.mock.calls[0]?.[0] as { body?: Record<string, unknown> };
|
||||
expect(request.body).toMatchObject({
|
||||
model: "seedance-1-0-pro-250528",
|
||||
seed: 42,
|
||||
resolution: "480p",
|
||||
camera_fixed: false,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -141,11 +141,6 @@ export function buildBytePlusVideoGenerationProvider(): VideoGenerationProvider
|
||||
agentDir,
|
||||
}),
|
||||
capabilities: {
|
||||
providerOptions: {
|
||||
seed: "number",
|
||||
draft: "boolean",
|
||||
camera_fixed: "boolean",
|
||||
},
|
||||
generate: {
|
||||
maxVideos: 1,
|
||||
maxDurationSeconds: 12,
|
||||
@@ -196,17 +191,6 @@ export function buildBytePlusVideoGenerationProvider(): VideoGenerationProvider
|
||||
capability: "video",
|
||||
transport: "http",
|
||||
});
|
||||
// Seedance 1.0 has separate T2V and I2V model IDs (e.g. seedance-1-0-lite-t2v-250428 vs
|
||||
// seedance-1-0-lite-i2v-250428). When input images are provided with a T2V model, auto-
|
||||
// switch to the corresponding I2V variant so the API does not reject with task_type mismatch.
|
||||
// 1.5 Pro uses a single model ID for both modes and is unaffected by this substitution.
|
||||
const hasInputImages = (req.inputImages?.length ?? 0) > 0;
|
||||
const requestedModel = normalizeOptionalString(req.model) || DEFAULT_BYTEPLUS_VIDEO_MODEL;
|
||||
const resolvedModel =
|
||||
hasInputImages && requestedModel.includes("-t2v-")
|
||||
? requestedModel.replace("-t2v-", "-i2v-")
|
||||
: requestedModel;
|
||||
|
||||
const content: Array<Record<string, unknown>> = [{ type: "text", text: req.prompt }];
|
||||
const imageUrl = resolveBytePlusImageUrl(req);
|
||||
if (imageUrl) {
|
||||
@@ -217,18 +201,15 @@ export function buildBytePlusVideoGenerationProvider(): VideoGenerationProvider
|
||||
});
|
||||
}
|
||||
const body: Record<string, unknown> = {
|
||||
model: resolvedModel,
|
||||
model: normalizeOptionalString(req.model) || DEFAULT_BYTEPLUS_VIDEO_MODEL,
|
||||
content,
|
||||
};
|
||||
const aspectRatio = normalizeOptionalString(req.aspectRatio);
|
||||
if (aspectRatio) {
|
||||
body.ratio = aspectRatio;
|
||||
}
|
||||
// Seedance API requires lowercase resolution values (e.g. "480p", "720p"); uppercase
|
||||
// variants like "480P" are rejected with InvalidParameter.
|
||||
const resolution = normalizeOptionalString(req.resolution)?.toLowerCase();
|
||||
if (resolution) {
|
||||
body.resolution = resolution;
|
||||
if (req.resolution) {
|
||||
body.resolution = req.resolution;
|
||||
}
|
||||
if (typeof req.durationSeconds === "number" && Number.isFinite(req.durationSeconds)) {
|
||||
body.duration = Math.max(1, Math.round(req.durationSeconds));
|
||||
@@ -240,23 +221,6 @@ export function buildBytePlusVideoGenerationProvider(): VideoGenerationProvider
|
||||
body.watermark = req.watermark;
|
||||
}
|
||||
|
||||
// Forward declared providerOptions: seed, draft, camerafixed.
|
||||
// draft=true forces 480p resolution for faster generation.
|
||||
const opts = req.providerOptions ?? {};
|
||||
const seed = typeof opts.seed === "number" ? opts.seed : undefined;
|
||||
const draft = opts.draft === true;
|
||||
// Official JSON body field is camera_fixed (with underscore).
|
||||
const cameraFixed = typeof opts.camera_fixed === "boolean" ? opts.camera_fixed : undefined;
|
||||
if (seed != null) {
|
||||
body.seed = seed;
|
||||
}
|
||||
if (draft && !body.resolution) {
|
||||
body.resolution = "480p";
|
||||
}
|
||||
if (cameraFixed != null) {
|
||||
body.camera_fixed = cameraFixed;
|
||||
}
|
||||
|
||||
const { response, release } = await postJsonRequest({
|
||||
url: `${baseUrl}/contents/generations/tasks`,
|
||||
headers,
|
||||
@@ -291,7 +255,7 @@ export function buildBytePlusVideoGenerationProvider(): VideoGenerationProvider
|
||||
});
|
||||
return {
|
||||
videos: [video],
|
||||
model: completed.model ?? resolvedModel,
|
||||
model: completed.model ?? req.model ?? DEFAULT_BYTEPLUS_VIDEO_MODEL,
|
||||
metadata: {
|
||||
taskId,
|
||||
status: completed.status,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@openclaw/chutes-provider",
|
||||
"version": "2026.4.11",
|
||||
"version": "2026.4.10",
|
||||
"private": true,
|
||||
"description": "OpenClaw Chutes.ai provider plugin",
|
||||
"type": "module",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@openclaw/cloudflare-ai-gateway-provider",
|
||||
"version": "2026.4.11",
|
||||
"version": "2026.4.10",
|
||||
"private": true,
|
||||
"description": "OpenClaw Cloudflare AI Gateway provider plugin",
|
||||
"type": "module",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@openclaw/codex",
|
||||
"version": "2026.4.11",
|
||||
"version": "2026.4.9",
|
||||
"description": "OpenClaw Codex harness and model provider plugin",
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
|
||||
@@ -79,7 +79,7 @@ describe("CodexAppServerEventProjector", () => {
|
||||
});
|
||||
|
||||
expect(onAssistantMessageStart).toHaveBeenCalledTimes(1);
|
||||
expect(onPartialReply).not.toHaveBeenCalled();
|
||||
expect(onPartialReply).toHaveBeenLastCalledWith({ text: "hello" });
|
||||
expect(result.assistantTexts).toEqual(["hello"]);
|
||||
expect(result.messagesSnapshot.map((message) => message.role)).toEqual(["user", "assistant"]);
|
||||
expect(result.lastAssistant?.content).toEqual([{ type: "text", text: "hello" }]);
|
||||
@@ -87,79 +87,6 @@ describe("CodexAppServerEventProjector", () => {
|
||||
expect(result.replayMetadata.replaySafe).toBe(true);
|
||||
});
|
||||
|
||||
it("keeps intermediate agentMessage items out of the final visible reply", async () => {
|
||||
const onAssistantMessageStart = vi.fn();
|
||||
const onPartialReply = vi.fn();
|
||||
const params = {
|
||||
...createParams(),
|
||||
onAssistantMessageStart,
|
||||
onPartialReply,
|
||||
};
|
||||
const projector = new CodexAppServerEventProjector(params, "thread-1", "turn-1");
|
||||
|
||||
await projector.handleNotification({
|
||||
method: "item/agentMessage/delta",
|
||||
params: {
|
||||
threadId: "thread-1",
|
||||
turnId: "turn-1",
|
||||
itemId: "msg-commentary",
|
||||
delta: "checking thread context; then post a tight progress reply here.",
|
||||
},
|
||||
});
|
||||
await projector.handleNotification({
|
||||
method: "item/agentMessage/delta",
|
||||
params: {
|
||||
threadId: "thread-1",
|
||||
turnId: "turn-1",
|
||||
itemId: "msg-final",
|
||||
delta: "release fixes first. please drop affected PRs, failing checks, and blockers here.",
|
||||
},
|
||||
});
|
||||
await projector.handleNotification({
|
||||
method: "turn/completed",
|
||||
params: {
|
||||
threadId: "thread-1",
|
||||
turnId: "turn-1",
|
||||
turn: {
|
||||
id: "turn-1",
|
||||
status: "completed",
|
||||
items: [
|
||||
{
|
||||
type: "agentMessage",
|
||||
id: "msg-commentary",
|
||||
text: "checking thread context; then post a tight progress reply here.",
|
||||
},
|
||||
{
|
||||
type: "agentMessage",
|
||||
id: "msg-final",
|
||||
text: "release fixes first. please drop affected PRs, failing checks, and blockers here.",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const result = projector.buildResult({
|
||||
didSendViaMessagingTool: false,
|
||||
messagingToolSentTexts: [],
|
||||
messagingToolSentMediaUrls: [],
|
||||
messagingToolSentTargets: [],
|
||||
});
|
||||
|
||||
expect(onAssistantMessageStart).toHaveBeenCalledTimes(1);
|
||||
expect(onPartialReply).not.toHaveBeenCalled();
|
||||
expect(result.assistantTexts).toEqual([
|
||||
"release fixes first. please drop affected PRs, failing checks, and blockers here.",
|
||||
]);
|
||||
expect(result.lastAssistant?.content).toEqual([
|
||||
{
|
||||
type: "text",
|
||||
text: "release fixes first. please drop affected PRs, failing checks, and blockers here.",
|
||||
},
|
||||
]);
|
||||
expect(JSON.stringify(result.messagesSnapshot)).not.toContain("checking thread context");
|
||||
});
|
||||
|
||||
it("ignores notifications for other turns", async () => {
|
||||
const params = createParams();
|
||||
const projector = new CodexAppServerEventProjector(params, "thread-1", "turn-1");
|
||||
|
||||
@@ -44,7 +44,6 @@ const ZERO_USAGE: Usage = {
|
||||
|
||||
export class CodexAppServerEventProjector {
|
||||
private readonly assistantTextByItem = new Map<string, string>();
|
||||
private readonly assistantItemOrder: string[] = [];
|
||||
private readonly reasoningTextByItem = new Map<string, string>();
|
||||
private readonly planTextByItem = new Map<string, string>();
|
||||
private readonly activeItemIds = new Set<string>();
|
||||
@@ -153,7 +152,6 @@ export class CodexAppServerEventProjector {
|
||||
(turnFailed ? (this.completedTurn?.error?.message ?? "codex app-server turn failed") : null);
|
||||
return {
|
||||
aborted: this.aborted || turnInterrupted,
|
||||
externalAbort: false,
|
||||
timedOut: false,
|
||||
idleTimedOut: false,
|
||||
timedOutDuringCompaction: false,
|
||||
@@ -212,12 +210,9 @@ export class CodexAppServerEventProjector {
|
||||
this.assistantStarted = true;
|
||||
await this.params.onAssistantMessageStart?.();
|
||||
}
|
||||
this.rememberAssistantItem(itemId);
|
||||
const text = `${this.assistantTextByItem.get(itemId) ?? ""}${delta}`;
|
||||
this.assistantTextByItem.set(itemId, text);
|
||||
// Codex app-server can emit multiple agentMessage items per turn, including
|
||||
// intermediate coordination/progress prose. Keep those deltas internal until
|
||||
// turn completion chooses the last assistant item as the user-visible reply.
|
||||
await this.params.onPartialReply?.({ text });
|
||||
}
|
||||
|
||||
private async handleReasoningDelta(params: JsonObject): Promise<void> {
|
||||
@@ -296,7 +291,6 @@ export class CodexAppServerEventProjector {
|
||||
this.completedItemIds.add(itemId);
|
||||
}
|
||||
if (item?.type === "agentMessage" && typeof item.text === "string" && item.text) {
|
||||
this.rememberAssistantItem(item.id);
|
||||
this.assistantTextByItem.set(item.id, item.text);
|
||||
}
|
||||
if (item?.type === "plan" && typeof item.text === "string" && item.text) {
|
||||
@@ -354,7 +348,6 @@ export class CodexAppServerEventProjector {
|
||||
}
|
||||
for (const item of turn.items ?? []) {
|
||||
if (item.type === "agentMessage" && typeof item.text === "string" && item.text) {
|
||||
this.rememberAssistantItem(item.id);
|
||||
this.assistantTextByItem.set(item.id, item.text);
|
||||
}
|
||||
if (item.type === "plan" && typeof item.text === "string" && item.text) {
|
||||
@@ -432,29 +425,7 @@ export class CodexAppServerEventProjector {
|
||||
}
|
||||
|
||||
private collectAssistantTexts(): string[] {
|
||||
const finalText = this.resolveFinalAssistantText();
|
||||
return finalText ? [finalText] : [];
|
||||
}
|
||||
|
||||
private resolveFinalAssistantText(): string | undefined {
|
||||
for (let i = this.assistantItemOrder.length - 1; i >= 0; i -= 1) {
|
||||
const itemId = this.assistantItemOrder[i];
|
||||
if (!itemId) {
|
||||
continue;
|
||||
}
|
||||
const text = this.assistantTextByItem.get(itemId)?.trim();
|
||||
if (text) {
|
||||
return text;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
private rememberAssistantItem(itemId: string): void {
|
||||
if (!itemId || this.assistantItemOrder.includes(itemId)) {
|
||||
return;
|
||||
}
|
||||
this.assistantItemOrder.push(itemId);
|
||||
return [...this.assistantTextByItem.values()].filter((text) => text.trim().length > 0);
|
||||
}
|
||||
|
||||
private createAssistantMessage(text: string): AssistantMessage {
|
||||
|
||||
@@ -119,56 +119,6 @@ describe("runCodexAppServerAttempt", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("does not leak unhandled rejections when shutdown closes before interrupt", async () => {
|
||||
const unhandledRejections: unknown[] = [];
|
||||
const onUnhandledRejection = (reason: unknown) => {
|
||||
unhandledRejections.push(reason);
|
||||
};
|
||||
process.on("unhandledRejection", onUnhandledRejection);
|
||||
try {
|
||||
const requests: Array<{ method: string; params: unknown }> = [];
|
||||
const request = vi.fn(async (method: string, params?: unknown) => {
|
||||
requests.push({ method, params });
|
||||
if (method === "thread/start") {
|
||||
return { thread: { id: "thread-1" }, model: "gpt-5.4-codex", modelProvider: "openai" };
|
||||
}
|
||||
if (method === "turn/start") {
|
||||
return { turn: { id: "turn-1", status: "inProgress" } };
|
||||
}
|
||||
if (method === "turn/interrupt") {
|
||||
throw new Error("codex app-server client is closed");
|
||||
}
|
||||
return {};
|
||||
});
|
||||
__testing.setCodexAppServerClientFactoryForTests(
|
||||
async () =>
|
||||
({
|
||||
request,
|
||||
addNotificationHandler: () => () => undefined,
|
||||
addRequestHandler: () => () => undefined,
|
||||
}) as never,
|
||||
);
|
||||
const abortController = new AbortController();
|
||||
const params = createParams(
|
||||
path.join(tempDir, "session.jsonl"),
|
||||
path.join(tempDir, "workspace"),
|
||||
);
|
||||
params.abortSignal = abortController.signal;
|
||||
|
||||
const run = runCodexAppServerAttempt(params);
|
||||
await vi.waitFor(() =>
|
||||
expect(requests.some((entry) => entry.method === "turn/start")).toBe(true),
|
||||
);
|
||||
abortController.abort("shutdown");
|
||||
|
||||
await expect(run).resolves.toMatchObject({ aborted: true });
|
||||
await new Promise((resolve) => setImmediate(resolve));
|
||||
expect(unhandledRejections).toEqual([]);
|
||||
} finally {
|
||||
process.off("unhandledRejection", onUnhandledRejection);
|
||||
}
|
||||
});
|
||||
|
||||
it("forwards image attachments to the app-server turn input", async () => {
|
||||
const requests: Array<{ method: string; params: unknown }> = [];
|
||||
let notify: (notification: CodexServerNotification) => Promise<void> = async () => undefined;
|
||||
|
||||
@@ -227,14 +227,10 @@ export async function runCodexAppServerAttempt(
|
||||
);
|
||||
|
||||
const abortListener = () => {
|
||||
void client
|
||||
.request("turn/interrupt", {
|
||||
threadId: thread.threadId,
|
||||
turnId: activeTurnId,
|
||||
})
|
||||
.catch((error: unknown) => {
|
||||
embeddedAgentLog.debug("codex app-server turn interrupt failed during abort", { error });
|
||||
});
|
||||
void client.request("turn/interrupt", {
|
||||
threadId: thread.threadId,
|
||||
turnId: activeTurnId,
|
||||
});
|
||||
resolveCompletion?.();
|
||||
};
|
||||
runAbortController.signal.addEventListener("abort", abortListener, { once: true });
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { expectExplicitMusicGenerationCapabilities } from "../../test/helpers/media-generation/provider-capability-assertions.js";
|
||||
import { buildComfyMusicGenerationProvider } from "./music-generation-provider.js";
|
||||
import { _setComfyFetchGuardForTesting } from "./workflow-runtime.js";
|
||||
|
||||
@@ -13,7 +12,7 @@ describe("comfy music-generation provider", () => {
|
||||
|
||||
expect(provider.defaultModel).toBe("workflow");
|
||||
expect(provider.models).toEqual(["workflow"]);
|
||||
expectExplicitMusicGenerationCapabilities(provider);
|
||||
expect(provider.capabilities.edit?.maxInputImages).toBe(1);
|
||||
});
|
||||
|
||||
it("runs a music workflow and returns audio outputs", async () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@openclaw/comfy-provider",
|
||||
"version": "2026.4.11",
|
||||
"version": "2026.4.10",
|
||||
"private": true,
|
||||
"description": "OpenClaw ComfyUI provider plugin",
|
||||
"type": "module",
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
|
||||
import * as providerAuth from "openclaw/plugin-sdk/provider-auth-runtime";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { expectExplicitVideoGenerationCapabilities } from "../../test/helpers/media-generation/provider-capability-assertions.js";
|
||||
import {
|
||||
_setComfyFetchGuardForTesting,
|
||||
buildComfyVideoGenerationProvider,
|
||||
@@ -37,10 +36,6 @@ describe("comfy video-generation provider", () => {
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
it("declares explicit mode capabilities", () => {
|
||||
expectExplicitVideoGenerationCapabilities(buildComfyVideoGenerationProvider());
|
||||
});
|
||||
|
||||
it("treats local comfy video workflows as configured without an API key", () => {
|
||||
const provider = buildComfyVideoGenerationProvider();
|
||||
expect(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@openclaw/copilot-proxy",
|
||||
"version": "2026.4.11",
|
||||
"version": "2026.4.10",
|
||||
"private": true,
|
||||
"description": "OpenClaw Copilot Proxy provider plugin",
|
||||
"type": "module",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@openclaw/deepgram-provider",
|
||||
"version": "2026.4.11",
|
||||
"version": "2026.4.10",
|
||||
"private": true,
|
||||
"description": "OpenClaw Deepgram media-understanding provider",
|
||||
"type": "module",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@openclaw/deepseek-provider",
|
||||
"version": "2026.4.11",
|
||||
"version": "2026.4.10",
|
||||
"private": true,
|
||||
"description": "OpenClaw DeepSeek provider plugin",
|
||||
"type": "module",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@openclaw/diagnostics-otel",
|
||||
"version": "2026.4.11",
|
||||
"version": "2026.4.10",
|
||||
"description": "OpenClaw diagnostics OpenTelemetry exporter",
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
@@ -24,10 +24,10 @@
|
||||
"./index.ts"
|
||||
],
|
||||
"compat": {
|
||||
"pluginApi": ">=2026.4.11"
|
||||
"pluginApi": ">=2026.4.10"
|
||||
},
|
||||
"build": {
|
||||
"openclawVersion": "2026.4.11"
|
||||
"openclawVersion": "2026.4.10"
|
||||
},
|
||||
"release": {
|
||||
"publishToClawHub": true,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@openclaw/diffs",
|
||||
"version": "2026.4.11",
|
||||
"version": "2026.4.10",
|
||||
"private": true,
|
||||
"description": "OpenClaw diff viewer plugin",
|
||||
"type": "module",
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
import { describe } from "vitest";
|
||||
import { assertBundledChannelEntries } from "../../test/helpers/bundled-channel-entry.ts";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import entry from "./index.js";
|
||||
import setupEntry from "./setup-entry.js";
|
||||
|
||||
describe("discord bundled entries", () => {
|
||||
assertBundledChannelEntries({
|
||||
entry,
|
||||
expectedId: "discord",
|
||||
expectedName: "Discord",
|
||||
setupEntry,
|
||||
it("declares the channel plugin without importing the broad api barrel", () => {
|
||||
expect(entry.kind).toBe("bundled-channel-entry");
|
||||
expect(entry.id).toBe("discord");
|
||||
expect(entry.name).toBe("Discord");
|
||||
});
|
||||
|
||||
it("declares the setup plugin without importing the broad api barrel", () => {
|
||||
expect(setupEntry.kind).toBe("bundled-channel-setup-entry");
|
||||
expect(typeof setupEntry.loadSetupPlugin).toBe("function");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@openclaw/discord",
|
||||
"version": "2026.4.11",
|
||||
"version": "2026.4.10",
|
||||
"description": "OpenClaw Discord channel plugin",
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
@@ -16,7 +16,7 @@
|
||||
"openclaw": "workspace:*"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"openclaw": ">=2026.4.11"
|
||||
"openclaw": ">=2026.4.10"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"openclaw": {
|
||||
@@ -52,10 +52,10 @@
|
||||
"minHostVersion": ">=2026.4.10"
|
||||
},
|
||||
"compat": {
|
||||
"pluginApi": ">=2026.4.11"
|
||||
"pluginApi": ">=2026.4.10"
|
||||
},
|
||||
"build": {
|
||||
"openclawVersion": "2026.4.11"
|
||||
"openclawVersion": "2026.4.10"
|
||||
},
|
||||
"bundle": {
|
||||
"stageRuntimeDependencies": true
|
||||
|
||||
@@ -71,31 +71,6 @@ describe("handleDiscordMessageAction", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("passes activityLaunchButton helpers through send actions", async () => {
|
||||
await handleDiscordMessageAction({
|
||||
action: "send",
|
||||
params: {
|
||||
to: "channel:123",
|
||||
activityLaunchButton: true,
|
||||
activityLaunchLabel: "Open Canvas",
|
||||
},
|
||||
cfg: {
|
||||
channels: { discord: { token: "tok" } },
|
||||
} as OpenClawConfig,
|
||||
});
|
||||
|
||||
expect(handleDiscordActionMock).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
action: "sendMessage",
|
||||
to: "channel:123",
|
||||
activityLaunchButton: true,
|
||||
activityLaunchLabel: "Open Canvas",
|
||||
}),
|
||||
expect.any(Object),
|
||||
expect.any(Object),
|
||||
);
|
||||
});
|
||||
|
||||
it("rejects reactions when no message id source is available", async () => {
|
||||
await expect(
|
||||
handleDiscordMessageAction({
|
||||
|
||||
@@ -47,8 +47,6 @@ export async function handleDiscordMessageAction(
|
||||
if (action === "send") {
|
||||
const to = readStringParam(params, "to", { required: true });
|
||||
const asVoice = readBooleanParam(params, "asVoice") === true;
|
||||
const activityLaunchButton = readBooleanParam(params, "activityLaunchButton") === true;
|
||||
const activityLaunchLabel = readStringParam(params, "activityLaunchLabel");
|
||||
const rawComponents =
|
||||
params.components ??
|
||||
buildDiscordInteractiveComponents(normalizeInteractiveReply(params.interactive));
|
||||
@@ -57,7 +55,7 @@ export async function handleDiscordMessageAction(
|
||||
(typeof rawComponents === "function" || typeof rawComponents === "object");
|
||||
const components = hasComponents ? rawComponents : undefined;
|
||||
const content = readStringParam(params, "message", {
|
||||
required: !asVoice && !hasComponents && !activityLaunchButton,
|
||||
required: !asVoice && !hasComponents,
|
||||
allowEmpty: true,
|
||||
});
|
||||
// Support media, path, and filePath for media URL
|
||||
@@ -82,8 +80,6 @@ export async function handleDiscordMessageAction(
|
||||
filename: filename ?? undefined,
|
||||
replyTo: replyTo ?? undefined,
|
||||
components,
|
||||
...(activityLaunchButton ? { activityLaunchButton: true } : {}),
|
||||
...(activityLaunchLabel ? { activityLaunchLabel } : {}),
|
||||
embeds,
|
||||
asVoice,
|
||||
silent,
|
||||
|
||||
@@ -299,27 +299,7 @@ export async function handleDiscordMessagingAction(
|
||||
const to = readStringParam(params, "to", { required: true });
|
||||
const asVoice = params.asVoice === true;
|
||||
const silent = params.silent === true;
|
||||
const activityLaunchButton = readBooleanParam(params, "activityLaunchButton") === true;
|
||||
const activityLaunchLabel = readStringParam(params, "activityLaunchLabel")?.trim();
|
||||
if (activityLaunchButton && params.components !== undefined) {
|
||||
throw new Error("activityLaunchButton cannot be combined with components.");
|
||||
}
|
||||
const rawComponents = activityLaunchButton
|
||||
? {
|
||||
blocks: [
|
||||
{
|
||||
type: "actions",
|
||||
buttons: [
|
||||
{
|
||||
label: activityLaunchLabel || "Open Activity",
|
||||
style: "primary",
|
||||
action: "launch-activity",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
: params.components;
|
||||
const rawComponents = params.components;
|
||||
const componentSpec = hasDiscordComponentObjectKeys(rawComponents)
|
||||
? discordMessagingActionRuntime.readDiscordComponentSpec(rawComponents)
|
||||
: null;
|
||||
|
||||
@@ -427,64 +427,6 @@ describe("handleDiscordMessagingAction", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("builds a launch-activity button from activityLaunchButton", async () => {
|
||||
sendDiscordComponentMessage.mockClear();
|
||||
sendMessageDiscord.mockClear();
|
||||
|
||||
await handleDiscordMessagingAction(
|
||||
"sendMessage",
|
||||
{
|
||||
to: "channel:123",
|
||||
content: "Open the canvas test UI",
|
||||
activityLaunchButton: true,
|
||||
activityLaunchLabel: "Open Canvas",
|
||||
},
|
||||
enableAllActions,
|
||||
);
|
||||
|
||||
expect(sendMessageDiscord).not.toHaveBeenCalled();
|
||||
expect(sendDiscordComponentMessage).toHaveBeenCalledWith(
|
||||
"channel:123",
|
||||
expect.objectContaining({
|
||||
text: "Open the canvas test UI",
|
||||
blocks: [
|
||||
expect.objectContaining({
|
||||
type: "actions",
|
||||
buttons: [
|
||||
expect.objectContaining({
|
||||
label: "Open Canvas",
|
||||
action: "launch-activity",
|
||||
}),
|
||||
],
|
||||
}),
|
||||
],
|
||||
}),
|
||||
expect.any(Object),
|
||||
);
|
||||
});
|
||||
|
||||
it("rejects activityLaunchButton when components are also provided", async () => {
|
||||
await expect(
|
||||
handleDiscordMessagingAction(
|
||||
"sendMessage",
|
||||
{
|
||||
to: "channel:123",
|
||||
content: "hello",
|
||||
activityLaunchButton: true,
|
||||
components: {
|
||||
blocks: [
|
||||
{
|
||||
type: "actions",
|
||||
buttons: [{ label: "Manual", callbackData: "manual" }],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
enableAllActions,
|
||||
),
|
||||
).rejects.toThrow(/cannot be combined with components/i);
|
||||
});
|
||||
|
||||
it("forwards the optional filename into sendMessageDiscord", async () => {
|
||||
sendMessageDiscord.mockClear();
|
||||
await handleDiscordMessagingAction(
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { createLazyChannelApprovalNativeRuntimeAdapter } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
|
||||
import type { ChannelApprovalNativeRuntimeAdapter } from "openclaw/plugin-sdk/approval-handler-runtime";
|
||||
import { resolveApprovalRequestSessionConversation } from "openclaw/plugin-sdk/approval-native-runtime";
|
||||
import type { ChannelApprovalCapability } from "openclaw/plugin-sdk/channel-contract";
|
||||
import type { DiscordExecApprovalConfig } from "openclaw/plugin-sdk/config-runtime";
|
||||
import {
|
||||
normalizeLowercaseStringOrEmpty,
|
||||
@@ -173,9 +172,7 @@ export function createDiscordApprovalCapability(configOverride?: DiscordExecAppr
|
||||
return createApproverRestrictedNativeApprovalCapability({
|
||||
channel: "discord",
|
||||
channelLabel: "Discord",
|
||||
describeExecApprovalSetup: ({
|
||||
accountId,
|
||||
}: Parameters<NonNullable<ChannelApprovalCapability["describeExecApprovalSetup"]>>[0]) => {
|
||||
describeExecApprovalSetup: ({ accountId }) => {
|
||||
const prefix =
|
||||
accountId && accountId !== "default"
|
||||
? `channels.discord.accounts.${accountId}`
|
||||
|
||||
@@ -114,8 +114,6 @@ describe("discordMessageActions", () => {
|
||||
}
|
||||
|
||||
expect(Type.Object(schema.properties).required).toBeUndefined();
|
||||
expect(schema.properties).toHaveProperty("activityLaunchButton");
|
||||
expect(schema.properties).toHaveProperty("activityLaunchLabel");
|
||||
});
|
||||
|
||||
it("extracts send targets for message and thread reply actions", () => {
|
||||
|
||||
@@ -16,10 +16,7 @@ import {
|
||||
listEnabledDiscordAccounts,
|
||||
resolveDiscordAccount,
|
||||
} from "./accounts.js";
|
||||
import {
|
||||
createDiscordMessageToolActivityLaunchSchemaProperties,
|
||||
createDiscordMessageToolComponentsSchema,
|
||||
} from "./message-tool-schema.js";
|
||||
import { createDiscordMessageToolComponentsSchema } from "./message-tool-schema.js";
|
||||
|
||||
let discordChannelActionsRuntimePromise:
|
||||
| Promise<typeof import("./channel-actions.runtime.js")>
|
||||
@@ -164,7 +161,6 @@ function describeDiscordMessageTool({
|
||||
schema: {
|
||||
properties: {
|
||||
components: Type.Optional(createDiscordMessageToolComponentsSchema()),
|
||||
...createDiscordMessageToolActivityLaunchSchemaProperties(),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -463,21 +463,10 @@ export const discordPlugin: ChannelPlugin<ResolvedDiscordAccount, DiscordProbe>
|
||||
stripPatterns: () => ["<@!?\\d+>"],
|
||||
},
|
||||
agentPrompt: {
|
||||
messageToolHints: ({ cfg }) => {
|
||||
const hints = [
|
||||
"- Discord components: set `components` when sending messages to include buttons, selects, or v2 containers.",
|
||||
"- Forms: add `components.modal` (title, fields). OpenClaw adds a trigger button and routes submissions as new messages.",
|
||||
];
|
||||
if (cfg.canvasHost?.activity?.enabled === true) {
|
||||
hints.push(
|
||||
'- Discord Activity launch: set `activityLaunchButton=true` (optional `activityLaunchLabel`) for a ready-to-use launch button, or set a component button with `action: "launch-activity"`.',
|
||||
);
|
||||
hints.push(
|
||||
'- Discord Activity flow: update hosted canvas content under `/__openclaw__/canvas/` first, then send the launch button.',
|
||||
);
|
||||
}
|
||||
return hints;
|
||||
},
|
||||
messageToolHints: () => [
|
||||
"- Discord components: set `components` when sending messages to include buttons, selects, or v2 containers.",
|
||||
"- Forms: add `components.modal` (title, fields). OpenClaw adds a trigger button and routes submissions as new messages.",
|
||||
],
|
||||
},
|
||||
messaging: {
|
||||
normalizeTarget: normalizeDiscordMessagingTarget,
|
||||
|
||||
@@ -56,44 +56,6 @@ describe("discord components", () => {
|
||||
expect(result.modals[0]?.allowedUsers).toEqual(["discord:user-1"]);
|
||||
});
|
||||
|
||||
it("supports launch-activity button actions", () => {
|
||||
const spec = readDiscordComponentSpec({
|
||||
blocks: [
|
||||
{
|
||||
type: "actions",
|
||||
buttons: [{ label: "Open Activity", action: "launch-activity" }],
|
||||
},
|
||||
],
|
||||
});
|
||||
if (!spec) {
|
||||
throw new Error("Expected component spec to be parsed");
|
||||
}
|
||||
|
||||
const result = buildDiscordComponentMessage({ spec });
|
||||
expect(result.entries).toHaveLength(1);
|
||||
expect(result.entries[0]?.action).toBe("launch-activity");
|
||||
});
|
||||
|
||||
it("rejects launch-activity on link buttons", () => {
|
||||
expect(() =>
|
||||
readDiscordComponentSpec({
|
||||
blocks: [
|
||||
{
|
||||
type: "actions",
|
||||
buttons: [
|
||||
{
|
||||
label: "Open Activity",
|
||||
action: "launch-activity",
|
||||
style: "link",
|
||||
url: "https://example.com",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
}),
|
||||
).toThrow("not supported for link buttons");
|
||||
});
|
||||
|
||||
it("requires options for modal select fields", () => {
|
||||
expect(() =>
|
||||
readDiscordComponentSpec({
|
||||
|
||||
@@ -235,20 +235,9 @@ function parseButtonSpec(raw: unknown, label: string): DiscordComponentButtonSpe
|
||||
const obj = requireObject(raw, label);
|
||||
const style = readOptionalString(obj.style) as DiscordComponentButtonStyle | undefined;
|
||||
const url = readOptionalString(obj.url);
|
||||
const actionRaw = readOptionalString(obj.action);
|
||||
const action =
|
||||
normalizeLowercaseStringOrEmpty(actionRaw) === "launch-activity"
|
||||
? "launch-activity"
|
||||
: undefined;
|
||||
if (actionRaw && !action) {
|
||||
throw new Error(`${label}.action must be "launch-activity"`);
|
||||
}
|
||||
if ((style === "link" || url) && !url) {
|
||||
throw new Error(`${label}.url is required for link buttons`);
|
||||
}
|
||||
if (action && (style === "link" || url)) {
|
||||
throw new Error(`${label}.action is not supported for link buttons`);
|
||||
}
|
||||
return {
|
||||
label: readString(obj.label, `${label}.label`),
|
||||
style,
|
||||
@@ -267,7 +256,6 @@ function parseButtonSpec(raw: unknown, label: string): DiscordComponentButtonSpe
|
||||
: undefined,
|
||||
disabled: typeof obj.disabled === "boolean" ? obj.disabled : undefined,
|
||||
allowedUsers: readOptionalStringArray(obj.allowedUsers, `${label}.allowedUsers`),
|
||||
action,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -557,7 +545,6 @@ function createButtonComponent(params: {
|
||||
callbackData: params.spec.callbackData,
|
||||
modalId: params.modalId,
|
||||
allowedUsers: params.spec.allowedUsers,
|
||||
action: params.spec.action,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@ import type { TopLevelComponents } from "@buape/carbon";
|
||||
|
||||
export type DiscordComponentButtonStyle = "primary" | "secondary" | "success" | "danger" | "link";
|
||||
|
||||
export type DiscordComponentButtonAction = "launch-activity";
|
||||
|
||||
export type DiscordComponentSelectType = "string" | "user" | "role" | "mentionable" | "channel";
|
||||
|
||||
export type DiscordComponentModalFieldType =
|
||||
@@ -29,8 +27,6 @@ export type DiscordComponentButtonSpec = {
|
||||
disabled?: boolean;
|
||||
/** Optional allowlist of users who can interact with this button (ids or names). */
|
||||
allowedUsers?: string[];
|
||||
/** Optional special action for this button. */
|
||||
action?: DiscordComponentButtonAction;
|
||||
};
|
||||
|
||||
export type DiscordComponentSelectOption = {
|
||||
@@ -148,7 +144,6 @@ export type DiscordComponentEntry = {
|
||||
accountId?: string;
|
||||
reusable?: boolean;
|
||||
allowedUsers?: string[];
|
||||
action?: DiscordComponentButtonAction;
|
||||
messageId?: string;
|
||||
createdAt?: number;
|
||||
expiresAt?: number;
|
||||
|
||||
@@ -96,47 +96,6 @@ describe("discord doctor", () => {
|
||||
).toEqual(["Moved channels.discord.streamMode → channels.discord.streaming.mode (block)."]);
|
||||
});
|
||||
|
||||
it("moves account voice.tts.edge into providers.microsoft", () => {
|
||||
const normalize = discordDoctor.normalizeCompatibilityConfig;
|
||||
expect(normalize).toBeDefined();
|
||||
if (!normalize) {
|
||||
return;
|
||||
}
|
||||
|
||||
const result = normalize({
|
||||
cfg: {
|
||||
channels: {
|
||||
discord: {
|
||||
accounts: {
|
||||
main: {
|
||||
voice: {
|
||||
tts: {
|
||||
edge: {
|
||||
voice: "en-US-JennyNeural",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
} as never,
|
||||
});
|
||||
|
||||
expect(result.changes).toContain(
|
||||
"Moved channels.discord.accounts.main.voice.tts.edge → channels.discord.accounts.main.voice.tts.providers.microsoft.",
|
||||
);
|
||||
const mainTts = result.config.channels?.discord?.accounts?.main?.voice?.tts as
|
||||
| Record<string, unknown>
|
||||
| undefined;
|
||||
expect(mainTts?.providers).toEqual({
|
||||
microsoft: {
|
||||
voice: "en-US-JennyNeural",
|
||||
},
|
||||
});
|
||||
expect(mainTts?.edge).toBeUndefined();
|
||||
});
|
||||
|
||||
it("finds numeric id entries across discord scopes", () => {
|
||||
const cfg = {
|
||||
channels: {
|
||||
|
||||
@@ -28,11 +28,6 @@ const discordComponentButtonSchema = Type.Object({
|
||||
}),
|
||||
),
|
||||
),
|
||||
action: Type.Optional(
|
||||
stringEnum(["launch-activity"], {
|
||||
description: "Special button action (launches this app's Discord Activity).",
|
||||
}),
|
||||
),
|
||||
});
|
||||
|
||||
const discordComponentSelectSchema = Type.Object({
|
||||
@@ -93,22 +88,6 @@ const discordComponentModalSchema = Type.Object({
|
||||
fields: Type.Array(discordComponentModalFieldSchema),
|
||||
});
|
||||
|
||||
export function createDiscordMessageToolActivityLaunchSchemaProperties() {
|
||||
return {
|
||||
activityLaunchButton: Type.Optional(
|
||||
Type.Boolean({
|
||||
description:
|
||||
'Auto-add a Discord Activity launch button (equivalent to components button action="launch-activity").',
|
||||
}),
|
||||
),
|
||||
activityLaunchLabel: Type.Optional(
|
||||
Type.String({
|
||||
description: 'Optional label for activityLaunchButton (defaults to "Open Activity").',
|
||||
}),
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
export function createDiscordMessageToolComponentsSchema() {
|
||||
return Type.Object(
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
type UserSelectMenuInteraction,
|
||||
} from "@buape/carbon";
|
||||
import type { APIStringSelectComponent } from "discord-api-types/v10";
|
||||
import { ButtonStyle, ChannelType, InteractionResponseType, Routes } from "discord-api-types/v10";
|
||||
import { ButtonStyle, ChannelType } from "discord-api-types/v10";
|
||||
import { resolveHumanDelayConfig } from "openclaw/plugin-sdk/agent-runtime";
|
||||
import {
|
||||
formatInboundEnvelope,
|
||||
@@ -166,48 +166,6 @@ export function resolveDiscordComponentOriginatingTo(
|
||||
});
|
||||
}
|
||||
|
||||
async function launchDiscordActivityFromInteraction(params: {
|
||||
interaction: AgentComponentMessageInteraction;
|
||||
replyOpts: { ephemeral?: boolean };
|
||||
label: string;
|
||||
}): Promise<boolean> {
|
||||
const interactionId = params.interaction.rawData?.id;
|
||||
const interactionToken = params.interaction.rawData?.token;
|
||||
if (!interactionId || !interactionToken) {
|
||||
logError(`${params.label}: missing interaction id/token for activity launch`);
|
||||
try {
|
||||
await params.interaction.reply({
|
||||
content: "Unable to launch the activity right now.",
|
||||
...params.replyOpts,
|
||||
});
|
||||
} catch {
|
||||
// interaction may have expired
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
await params.interaction.client.rest.post(
|
||||
Routes.interactionCallback(interactionId, interactionToken),
|
||||
{
|
||||
body: { type: InteractionResponseType.LaunchActivity },
|
||||
},
|
||||
);
|
||||
return true;
|
||||
} catch (error) {
|
||||
logError(`${params.label}: failed to launch activity: ${String(error)}`);
|
||||
try {
|
||||
await params.interaction.reply({
|
||||
content: "Failed to launch the activity.",
|
||||
...params.replyOpts,
|
||||
});
|
||||
} catch {
|
||||
// interaction may have expired
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async function dispatchPluginDiscordInteractiveEvent(params: {
|
||||
ctx: AgentComponentContext;
|
||||
interaction: AgentComponentInteraction;
|
||||
@@ -760,26 +718,6 @@ async function handleDiscordComponentEvent(params: {
|
||||
return;
|
||||
}
|
||||
|
||||
if (consumed.action === "launch-activity") {
|
||||
if (!rawGuildId) {
|
||||
try {
|
||||
await params.interaction.reply({
|
||||
content: "Discord Activities can only be launched from server channels.",
|
||||
ephemeral: true,
|
||||
});
|
||||
} catch {
|
||||
// Interaction may have expired
|
||||
}
|
||||
return;
|
||||
}
|
||||
await launchDiscordActivityFromInteraction({
|
||||
interaction: params.interaction,
|
||||
replyOpts,
|
||||
label: params.label,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const values = params.values ? mapSelectValues(consumed, params.values) : undefined;
|
||||
if (consumed.callbackData) {
|
||||
const pluginDispatch = await dispatchPluginDiscordInteractiveEvent({
|
||||
|
||||
@@ -1,15 +1,8 @@
|
||||
import { randomUUID } from "node:crypto";
|
||||
import * as carbonGateway from "@buape/carbon/gateway";
|
||||
import type { APIGatewayBotInfo } from "discord-api-types/v10";
|
||||
import * as httpsProxyAgent from "https-proxy-agent";
|
||||
import type { DiscordAccountConfig } from "openclaw/plugin-sdk/config-runtime";
|
||||
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
||||
import {
|
||||
captureHttpExchange,
|
||||
captureWsEvent,
|
||||
resolveEffectiveDebugProxyUrl,
|
||||
resolveDebugProxySettings,
|
||||
} from "openclaw/plugin-sdk/proxy-capture";
|
||||
import { danger } from "openclaw/plugin-sdk/runtime-env";
|
||||
import type { RuntimeEnv } from "openclaw/plugin-sdk/runtime-env";
|
||||
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime";
|
||||
@@ -282,50 +275,11 @@ function createGatewayPlugin(params: {
|
||||
if (!url) {
|
||||
throw new Error("Gateway URL is required");
|
||||
}
|
||||
const wsFlowId = randomUUID();
|
||||
// Avoid Node's undici-backed global WebSocket here. We have seen late
|
||||
// close-path crashes during Discord gateway teardown; the ws transport is
|
||||
// already our proxy path and behaves predictably for lifecycle cleanup.
|
||||
const WebSocketCtor = params.testing?.webSocketCtor ?? ws.default;
|
||||
const socket = new WebSocketCtor(url, params.wsAgent ? { agent: params.wsAgent } : undefined);
|
||||
captureWsEvent({
|
||||
url,
|
||||
direction: "local",
|
||||
kind: "ws-open",
|
||||
flowId: wsFlowId,
|
||||
meta: { subsystem: "discord-gateway" },
|
||||
});
|
||||
socket.on?.("message", (data: unknown) => {
|
||||
captureWsEvent({
|
||||
url,
|
||||
direction: "inbound",
|
||||
kind: "ws-frame",
|
||||
flowId: wsFlowId,
|
||||
payload: Buffer.isBuffer(data) ? data : Buffer.from(String(data)),
|
||||
meta: { subsystem: "discord-gateway" },
|
||||
});
|
||||
});
|
||||
socket.on?.("close", (code: number, reason: Buffer) => {
|
||||
captureWsEvent({
|
||||
url,
|
||||
direction: "local",
|
||||
kind: "ws-close",
|
||||
flowId: wsFlowId,
|
||||
closeCode: code,
|
||||
payload: reason,
|
||||
meta: { subsystem: "discord-gateway" },
|
||||
});
|
||||
});
|
||||
socket.on?.("error", (error: Error) => {
|
||||
captureWsEvent({
|
||||
url,
|
||||
direction: "local",
|
||||
kind: "error",
|
||||
flowId: wsFlowId,
|
||||
errorText: error.message,
|
||||
meta: { subsystem: "discord-gateway" },
|
||||
});
|
||||
});
|
||||
if ("binaryType" in socket) {
|
||||
try {
|
||||
socket.binaryType = "arraybuffer";
|
||||
@@ -355,8 +309,7 @@ export function createDiscordGatewayPlugin(params: {
|
||||
};
|
||||
}): carbonGateway.GatewayPlugin {
|
||||
const intents = resolveDiscordGatewayIntents(params.discordConfig?.intents);
|
||||
const proxy = resolveEffectiveDebugProxyUrl(params.discordConfig?.proxy);
|
||||
const debugProxySettings = resolveDebugProxySettings();
|
||||
const proxy = params.discordConfig?.proxy?.trim();
|
||||
const options = {
|
||||
reconnect: { maxAttempts: 50 },
|
||||
intents,
|
||||
@@ -366,21 +319,7 @@ export function createDiscordGatewayPlugin(params: {
|
||||
if (!proxy) {
|
||||
return createGatewayPlugin({
|
||||
options,
|
||||
fetchImpl: async (input, init) => {
|
||||
const response = await fetch(input, init as RequestInit);
|
||||
if (!debugProxySettings.enabled) {
|
||||
captureHttpExchange({
|
||||
url: input,
|
||||
method: (init?.method as string | undefined) ?? "GET",
|
||||
requestHeaders: init?.headers as Headers | Record<string, string> | undefined,
|
||||
requestBody: (init as RequestInit & { body?: BodyInit | null })?.body ?? null,
|
||||
response,
|
||||
flowId: randomUUID(),
|
||||
meta: { subsystem: "discord-gateway-metadata" },
|
||||
});
|
||||
}
|
||||
return response;
|
||||
},
|
||||
fetchImpl: (input, init) => fetch(input, init as RequestInit),
|
||||
runtime: params.runtime,
|
||||
testing: params.__testing
|
||||
? {
|
||||
@@ -403,22 +342,7 @@ export function createDiscordGatewayPlugin(params: {
|
||||
|
||||
return createGatewayPlugin({
|
||||
options,
|
||||
fetchImpl: async (input, init) => {
|
||||
const response = (await (params.__testing?.undiciFetch ?? undici.fetch)(
|
||||
input,
|
||||
init,
|
||||
)) as unknown as Response;
|
||||
captureHttpExchange({
|
||||
url: input,
|
||||
method: (init?.method as string | undefined) ?? "GET",
|
||||
requestHeaders: init?.headers as Headers | Record<string, string> | undefined,
|
||||
requestBody: (init as RequestInit & { body?: BodyInit | null })?.body ?? null,
|
||||
response,
|
||||
flowId: randomUUID(),
|
||||
meta: { subsystem: "discord-gateway-metadata" },
|
||||
});
|
||||
return response;
|
||||
},
|
||||
fetchImpl: (input, init) => (params.__testing?.undiciFetch ?? undici.fetch)(input, init),
|
||||
fetchInit: { dispatcher: fetchAgent },
|
||||
wsAgent,
|
||||
runtime: params.runtime,
|
||||
|
||||
@@ -108,54 +108,6 @@ function readChoices(option: CommandOption | undefined): unknown[] | undefined {
|
||||
return Array.isArray(value) ? value : undefined;
|
||||
}
|
||||
|
||||
function requireAutocomplete(option: CommandOption, errorMessage: string) {
|
||||
const autocomplete = readAutocomplete(option);
|
||||
if (typeof autocomplete !== "function") {
|
||||
throw new Error(errorMessage);
|
||||
}
|
||||
return autocomplete as (interaction: unknown) => Promise<unknown>;
|
||||
}
|
||||
|
||||
async function runAutocomplete(
|
||||
autocomplete: (interaction: unknown) => Promise<unknown>,
|
||||
params: {
|
||||
userId: string;
|
||||
username?: string;
|
||||
globalName?: string;
|
||||
channelType: ChannelType;
|
||||
channelId: string;
|
||||
channelName: string;
|
||||
guildId?: string;
|
||||
focusedValue: string;
|
||||
},
|
||||
) {
|
||||
const respond = vi.fn(async (_choices: unknown[]) => undefined);
|
||||
|
||||
await autocomplete({
|
||||
user: {
|
||||
id: params.userId,
|
||||
username: params.username ?? params.userId,
|
||||
globalName: params.globalName ?? params.userId,
|
||||
},
|
||||
channel: {
|
||||
type: params.channelType,
|
||||
id: params.channelId,
|
||||
name: params.channelName,
|
||||
},
|
||||
guild: params.guildId ? { id: params.guildId } : undefined,
|
||||
rawData: {
|
||||
member: { roles: [] },
|
||||
},
|
||||
options: {
|
||||
getFocused: () => ({ value: params.focusedValue }),
|
||||
},
|
||||
respond,
|
||||
client: {},
|
||||
} as never);
|
||||
|
||||
return respond;
|
||||
}
|
||||
|
||||
describe("createDiscordNativeCommand option wiring", () => {
|
||||
beforeAll(async () => {
|
||||
({ listNativeCommandSpecs } = await import("openclaw/plugin-sdk/command-auth"));
|
||||
@@ -171,18 +123,31 @@ describe("createDiscordNativeCommand option wiring", () => {
|
||||
it("uses autocomplete for /acp action so inline action values are accepted", async () => {
|
||||
const command = createNativeCommand("acp");
|
||||
const action = requireOption(command, "action");
|
||||
const autocomplete = requireAutocomplete(action, "acp action option did not wire autocomplete");
|
||||
const autocomplete = readAutocomplete(action);
|
||||
if (typeof autocomplete !== "function") {
|
||||
throw new Error("acp action option did not wire autocomplete");
|
||||
}
|
||||
const respond = vi.fn(async (_choices: unknown[]) => undefined);
|
||||
|
||||
expect(readChoices(action)).toBeUndefined();
|
||||
const respond = await runAutocomplete(autocomplete, {
|
||||
userId: "owner",
|
||||
username: "tester",
|
||||
globalName: "Tester",
|
||||
channelType: ChannelType.DM,
|
||||
channelId: "dm-1",
|
||||
channelName: "dm-1",
|
||||
focusedValue: "st",
|
||||
});
|
||||
await autocomplete({
|
||||
user: {
|
||||
id: "owner",
|
||||
username: "tester",
|
||||
globalName: "Tester",
|
||||
},
|
||||
channel: {
|
||||
type: ChannelType.DM,
|
||||
id: "dm-1",
|
||||
},
|
||||
guild: undefined,
|
||||
rawData: {},
|
||||
options: {
|
||||
getFocused: () => ({ value: "st" }),
|
||||
},
|
||||
respond,
|
||||
client: {},
|
||||
} as never);
|
||||
expect(respond).toHaveBeenCalledWith([
|
||||
{ name: "steer", value: "steer" },
|
||||
{ name: "status", value: "status" },
|
||||
@@ -214,17 +179,35 @@ describe("createDiscordNativeCommand option wiring", () => {
|
||||
} as ReturnType<typeof loadConfig>,
|
||||
});
|
||||
const level = requireOption(command, "level");
|
||||
const autocomplete = requireAutocomplete(level, "think level option did not wire autocomplete");
|
||||
const respond = await runAutocomplete(autocomplete, {
|
||||
userId: "blocked-user",
|
||||
username: "blocked",
|
||||
globalName: "Blocked",
|
||||
channelType: ChannelType.GuildText,
|
||||
channelId: "channel-1",
|
||||
channelName: "general",
|
||||
guildId: "guild-1",
|
||||
focusedValue: "",
|
||||
});
|
||||
const autocomplete = readAutocomplete(level);
|
||||
if (typeof autocomplete !== "function") {
|
||||
throw new Error("think level option did not wire autocomplete");
|
||||
}
|
||||
const respond = vi.fn(async (_choices: unknown[]) => undefined);
|
||||
|
||||
await autocomplete({
|
||||
user: {
|
||||
id: "blocked-user",
|
||||
username: "blocked",
|
||||
globalName: "Blocked",
|
||||
},
|
||||
channel: {
|
||||
type: ChannelType.GuildText,
|
||||
id: "channel-1",
|
||||
name: "general",
|
||||
},
|
||||
guild: {
|
||||
id: "guild-1",
|
||||
},
|
||||
rawData: {
|
||||
member: { roles: [] },
|
||||
},
|
||||
options: {
|
||||
getFocused: () => ({ value: "" }),
|
||||
},
|
||||
respond,
|
||||
client: {},
|
||||
} as never);
|
||||
|
||||
expect(respond).toHaveBeenCalledWith([]);
|
||||
});
|
||||
@@ -253,17 +236,35 @@ describe("createDiscordNativeCommand option wiring", () => {
|
||||
} as ReturnType<typeof loadConfig>,
|
||||
});
|
||||
const level = requireOption(command, "level");
|
||||
const autocomplete = requireAutocomplete(level, "think level option did not wire autocomplete");
|
||||
const respond = await runAutocomplete(autocomplete, {
|
||||
userId: "allowed-user",
|
||||
username: "allowed",
|
||||
globalName: "Allowed",
|
||||
channelType: ChannelType.GuildText,
|
||||
channelId: "channel-1",
|
||||
channelName: "general",
|
||||
guildId: "guild-1",
|
||||
focusedValue: "xh",
|
||||
});
|
||||
const autocomplete = readAutocomplete(level);
|
||||
if (typeof autocomplete !== "function") {
|
||||
throw new Error("think level option did not wire autocomplete");
|
||||
}
|
||||
const respond = vi.fn(async (_choices: unknown[]) => undefined);
|
||||
|
||||
await autocomplete({
|
||||
user: {
|
||||
id: "allowed-user",
|
||||
username: "allowed",
|
||||
globalName: "Allowed",
|
||||
},
|
||||
channel: {
|
||||
type: ChannelType.GuildText,
|
||||
id: "channel-1",
|
||||
name: "general",
|
||||
},
|
||||
guild: {
|
||||
id: "guild-1",
|
||||
},
|
||||
rawData: {
|
||||
member: { roles: [] },
|
||||
},
|
||||
options: {
|
||||
getFocused: () => ({ value: "xh" }),
|
||||
},
|
||||
respond,
|
||||
client: {},
|
||||
} as never);
|
||||
|
||||
expect(respond).toHaveBeenCalledWith([]);
|
||||
});
|
||||
@@ -288,16 +289,33 @@ describe("createDiscordNativeCommand option wiring", () => {
|
||||
discordConfig,
|
||||
});
|
||||
const level = requireOption(command, "level");
|
||||
const autocomplete = requireAutocomplete(level, "think level option did not wire autocomplete");
|
||||
const respond = await runAutocomplete(autocomplete, {
|
||||
userId: "allowed-user",
|
||||
username: "allowed",
|
||||
globalName: "Allowed",
|
||||
channelType: ChannelType.GroupDM,
|
||||
channelId: "blocked-group",
|
||||
channelName: "Blocked Group",
|
||||
focusedValue: "xh",
|
||||
});
|
||||
const autocomplete = readAutocomplete(level);
|
||||
if (typeof autocomplete !== "function") {
|
||||
throw new Error("think level option did not wire autocomplete");
|
||||
}
|
||||
const respond = vi.fn(async (_choices: unknown[]) => undefined);
|
||||
|
||||
await autocomplete({
|
||||
user: {
|
||||
id: "allowed-user",
|
||||
username: "allowed",
|
||||
globalName: "Allowed",
|
||||
},
|
||||
channel: {
|
||||
type: ChannelType.GroupDM,
|
||||
id: "blocked-group",
|
||||
name: "Blocked Group",
|
||||
},
|
||||
guild: undefined,
|
||||
rawData: {
|
||||
member: { roles: [] },
|
||||
},
|
||||
options: {
|
||||
getFocused: () => ({ value: "xh" }),
|
||||
},
|
||||
respond,
|
||||
client: {},
|
||||
} as never);
|
||||
|
||||
expect(respond).toHaveBeenCalledWith([]);
|
||||
});
|
||||
|
||||
@@ -3,14 +3,11 @@ import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
const {
|
||||
GatewayIntents,
|
||||
baseRegisterClientSpy,
|
||||
captureHttpExchangeSpy,
|
||||
captureWsEventSpy,
|
||||
GatewayPlugin,
|
||||
globalFetchMock,
|
||||
HttpsProxyAgent,
|
||||
getLastAgent,
|
||||
restProxyAgentSpy,
|
||||
resolveDebugProxySettingsMock,
|
||||
undiciFetchMock,
|
||||
undiciProxyAgentSpy,
|
||||
resetLastAgent,
|
||||
@@ -24,9 +21,6 @@ const {
|
||||
const globalFetchMock = vi.fn();
|
||||
const baseRegisterClientSpy = vi.fn();
|
||||
const webSocketSpy = vi.fn();
|
||||
const captureHttpExchangeSpy = vi.fn();
|
||||
const captureWsEventSpy = vi.fn();
|
||||
const resolveDebugProxySettingsMock = vi.fn(() => ({ enabled: false }));
|
||||
|
||||
const GatewayIntents = {
|
||||
Guilds: 1 << 0,
|
||||
@@ -72,9 +66,6 @@ const {
|
||||
HttpsProxyAgent,
|
||||
getLastAgent: () => HttpsProxyAgent.lastCreated,
|
||||
restProxyAgentSpy,
|
||||
captureHttpExchangeSpy,
|
||||
captureWsEventSpy,
|
||||
resolveDebugProxySettingsMock,
|
||||
undiciFetchMock,
|
||||
undiciProxyAgentSpy,
|
||||
resetLastAgent: () => {
|
||||
@@ -115,14 +106,6 @@ vi.mock("ws", () => ({
|
||||
},
|
||||
}));
|
||||
|
||||
vi.mock("openclaw/plugin-sdk/proxy-capture", () => ({
|
||||
captureHttpExchange: captureHttpExchangeSpy,
|
||||
captureWsEvent: captureWsEventSpy,
|
||||
resolveEffectiveDebugProxyUrl: (configuredProxyUrl?: string) =>
|
||||
configuredProxyUrl?.trim() || process.env.OPENCLAW_DEBUG_PROXY_URL,
|
||||
resolveDebugProxySettings: resolveDebugProxySettingsMock,
|
||||
}));
|
||||
|
||||
describe("createDiscordGatewayPlugin", () => {
|
||||
let createDiscordGatewayPlugin: typeof import("./gateway-plugin.js").createDiscordGatewayPlugin;
|
||||
|
||||
@@ -230,9 +213,6 @@ describe("createDiscordGatewayPlugin", () => {
|
||||
undiciProxyAgentSpy.mockClear();
|
||||
wsProxyAgentSpy.mockClear();
|
||||
webSocketSpy.mockClear();
|
||||
captureHttpExchangeSpy.mockClear();
|
||||
captureWsEventSpy.mockClear();
|
||||
resolveDebugProxySettingsMock.mockReset().mockReturnValue({ enabled: false });
|
||||
resetLastAgent();
|
||||
});
|
||||
|
||||
@@ -269,23 +249,6 @@ describe("createDiscordGatewayPlugin", () => {
|
||||
expect(wsProxyAgentSpy).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("allocates a fresh websocket flow id for each gateway socket", () => {
|
||||
const runtime = createRuntime();
|
||||
const plugin = createDiscordGatewayPlugin({
|
||||
discordConfig: {},
|
||||
runtime,
|
||||
});
|
||||
|
||||
const createWebSocket = (plugin as unknown as { createWebSocket: (url: string) => unknown })
|
||||
.createWebSocket;
|
||||
createWebSocket("wss://gateway.discord.gg/?attempt=1");
|
||||
createWebSocket("wss://gateway.discord.gg/?attempt=2");
|
||||
|
||||
const openCalls = captureWsEventSpy.mock.calls.filter(([event]) => event?.kind === "ws-open");
|
||||
expect(openCalls).toHaveLength(2);
|
||||
expect(openCalls[0]?.[0]?.flowId).not.toBe(openCalls[1]?.[0]?.flowId);
|
||||
});
|
||||
|
||||
it("maps plain-text Discord 503 responses to fetch failed", async () => {
|
||||
await expectGatewayRegisterFallback({
|
||||
ok: false,
|
||||
@@ -361,19 +324,6 @@ describe("createDiscordGatewayPlugin", () => {
|
||||
expect(baseRegisterClientSpy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it("does not double-capture gateway metadata fetches when global fetch patching is enabled", async () => {
|
||||
resolveDebugProxySettingsMock.mockReturnValue({ enabled: true });
|
||||
const runtime = createRuntime();
|
||||
const plugin = createDiscordGatewayPlugin({
|
||||
discordConfig: {},
|
||||
runtime,
|
||||
});
|
||||
|
||||
await registerGatewayClientWithMetadata({ plugin, fetchMock: globalFetchMock });
|
||||
|
||||
expect(captureHttpExchangeSpy).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("accepts IPv6 loopback proxy URLs for gateway metadata and websocket setup", async () => {
|
||||
const runtime = createRuntime();
|
||||
const plugin = createDiscordGatewayPlugin({
|
||||
|
||||
@@ -30,7 +30,6 @@ describe("resolveDiscordRestFetch", () => {
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
vi.unstubAllEnvs();
|
||||
undiciFetchMock.mockReset();
|
||||
proxyAgentSpy.mockReset();
|
||||
});
|
||||
@@ -101,21 +100,4 @@ describe("resolveDiscordRestFetch", () => {
|
||||
expect(proxyAgentSpy).toHaveBeenCalledWith("http://[::1]:8080");
|
||||
expect(runtime.error).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("uses debug proxy env when no discord proxy URL is configured", async () => {
|
||||
vi.stubEnv("OPENCLAW_DEBUG_PROXY_ENABLED", "1");
|
||||
vi.stubEnv("OPENCLAW_DEBUG_PROXY_URL", "http://127.0.0.1:7777");
|
||||
const runtime = {
|
||||
log: vi.fn(),
|
||||
error: vi.fn(),
|
||||
exit: vi.fn(),
|
||||
} as const;
|
||||
undiciFetchMock.mockResolvedValue(new Response("ok", { status: 200 }));
|
||||
|
||||
const fetcher = resolveDiscordRestFetch(undefined, runtime);
|
||||
await fetcher("https://discord.com/api/v10/oauth2/applications/@me");
|
||||
|
||||
expect(proxyAgentSpy).toHaveBeenCalledWith("http://127.0.0.1:7777");
|
||||
expect(runtime.log).toHaveBeenCalledWith("discord: rest proxy enabled");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -678,37 +678,6 @@ describe("monitorDiscordProvider", () => {
|
||||
expect(monitorLifecycleMock).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it("continues startup when Discord rejects bulk deploy that removes the Entry Point command", async () => {
|
||||
const runtime = baseRuntime();
|
||||
const entryPointError = Object.assign(
|
||||
new Error(
|
||||
"You cannot remove this app's Entry Point command in a bulk update operation. Please include the Entry Point command in your update request or delete it separately.",
|
||||
),
|
||||
{
|
||||
status: 400,
|
||||
discordCode: 50240,
|
||||
rawBody: {
|
||||
code: 50240,
|
||||
message:
|
||||
"You cannot remove this app's Entry Point command in a bulk update operation. Please include the Entry Point command in your update request or delete it separately.",
|
||||
},
|
||||
},
|
||||
);
|
||||
clientHandleDeployRequestMock.mockRejectedValueOnce(entryPointError);
|
||||
|
||||
await monitorDiscordProvider({
|
||||
config: baseConfig(),
|
||||
runtime,
|
||||
});
|
||||
|
||||
expect(clientHandleDeployRequestMock).toHaveBeenCalledTimes(1);
|
||||
expect(clientFetchUserMock).toHaveBeenCalledWith("@me");
|
||||
expect(monitorLifecycleMock).toHaveBeenCalledTimes(1);
|
||||
expect(runtime.error).toHaveBeenCalledWith(
|
||||
expect.stringContaining("failed to deploy native commands"),
|
||||
);
|
||||
});
|
||||
|
||||
it("formats rejected Discord deploy entries with command details", () => {
|
||||
const details = providerTesting.formatDiscordDeployErrorDetails({
|
||||
status: 400,
|
||||
|
||||
@@ -9,7 +9,6 @@ import {
|
||||
import { GatewayCloseCodes, type GatewayPlugin } from "@buape/carbon/gateway";
|
||||
import { Routes } from "discord-api-types/v10";
|
||||
import { CHANNEL_APPROVAL_NATIVE_RUNTIME_CONTEXT_CAPABILITY } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
|
||||
import type { ChannelRuntimeSurface } from "openclaw/plugin-sdk/channel-contract";
|
||||
import { registerChannelRuntimeContext } from "openclaw/plugin-sdk/channel-runtime-context";
|
||||
import {
|
||||
listNativeCommandSpecsForConfig,
|
||||
@@ -96,7 +95,7 @@ export type MonitorDiscordOpts = {
|
||||
accountId?: string;
|
||||
config?: OpenClawConfig;
|
||||
runtime?: RuntimeEnv;
|
||||
channelRuntime?: ChannelRuntimeSurface;
|
||||
channelRuntime?: import("openclaw/plugin-sdk/channel-core").PluginRuntime["channel"];
|
||||
abortSignal?: AbortSignal;
|
||||
mediaMaxMb?: number;
|
||||
historyLimit?: number;
|
||||
@@ -322,126 +321,18 @@ async function deployDiscordCommands(params: {
|
||||
err instanceof RateLimitError &&
|
||||
err.discordCode === 30034 &&
|
||||
/daily application command creates/i.test(err.message);
|
||||
const isEntryPointBulkUpdateRejected = (err: unknown) => {
|
||||
if (!err || typeof err !== "object") {
|
||||
return false;
|
||||
}
|
||||
const status = (err as DiscordDeployErrorLike).status;
|
||||
const code = (err as DiscordDeployErrorLike).discordCode;
|
||||
const rawBody = (err as DiscordDeployErrorLike).rawBody;
|
||||
const messageParts = [
|
||||
formatErrorMessage(err),
|
||||
typeof rawBody === "string"
|
||||
? rawBody
|
||||
: rawBody && typeof rawBody === "object" && "message" in rawBody
|
||||
? String((rawBody as { message?: unknown }).message ?? "")
|
||||
: "",
|
||||
];
|
||||
const joinedMessage = messageParts.join(" ");
|
||||
return (
|
||||
status === 400 &&
|
||||
(code === 50240 || String(code) === "50240") &&
|
||||
/entry point command/i.test(joinedMessage)
|
||||
);
|
||||
};
|
||||
const restClient = params.client.rest as {
|
||||
put: (path: string, data?: unknown, query?: unknown) => Promise<unknown>;
|
||||
get?: (path: string, query?: unknown) => Promise<unknown>;
|
||||
options?: { queueRequests?: boolean };
|
||||
};
|
||||
const originalPut = restClient.put.bind(restClient);
|
||||
const previousQueueRequests = restClient.options?.queueRequests;
|
||||
const isGlobalApplicationCommandsPath = (path: string) => /^\/applications\/\d+\/commands$/.test(path);
|
||||
const readCommandType = (value: unknown): number | undefined => {
|
||||
if (typeof value === "number" && Number.isFinite(value)) {
|
||||
return value;
|
||||
}
|
||||
if (typeof value === "string") {
|
||||
const parsed = Number(value);
|
||||
if (Number.isFinite(parsed)) {
|
||||
return parsed;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
const isPrimaryEntryPointCommand = (value: unknown): value is Record<string, unknown> =>
|
||||
Boolean(value) &&
|
||||
typeof value === "object" &&
|
||||
readCommandType((value as { type?: unknown }).type) === 4;
|
||||
const toEntryPointDeployPayload = (value: Record<string, unknown>): Record<string, unknown> => {
|
||||
const payload: Record<string, unknown> = { type: 4 };
|
||||
const allowedKeys = [
|
||||
"name",
|
||||
"name_localizations",
|
||||
"description",
|
||||
"description_localizations",
|
||||
"options",
|
||||
"default_member_permissions",
|
||||
"dm_permission",
|
||||
"default_permission",
|
||||
"nsfw",
|
||||
"integration_types",
|
||||
"contexts",
|
||||
"handler",
|
||||
];
|
||||
for (const key of allowedKeys) {
|
||||
if (value[key] !== undefined) {
|
||||
payload[key] = value[key];
|
||||
}
|
||||
}
|
||||
return payload;
|
||||
};
|
||||
let cachedPrimaryEntryPointPayload: Record<string, unknown> | null | undefined;
|
||||
const loadPrimaryEntryPointPayload = async (path: string): Promise<Record<string, unknown> | null> => {
|
||||
if (cachedPrimaryEntryPointPayload !== undefined) {
|
||||
return cachedPrimaryEntryPointPayload;
|
||||
}
|
||||
const restGet = typeof restClient.get === "function" ? restClient.get.bind(restClient) : null;
|
||||
if (!restGet || !isGlobalApplicationCommandsPath(path)) {
|
||||
cachedPrimaryEntryPointPayload = null;
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
const existingCommands = await restGet(path);
|
||||
const entryPoint = Array.isArray(existingCommands)
|
||||
? existingCommands.find((command) => isPrimaryEntryPointCommand(command))
|
||||
: undefined;
|
||||
cachedPrimaryEntryPointPayload = entryPoint ? toEntryPointDeployPayload(entryPoint) : null;
|
||||
return cachedPrimaryEntryPointPayload;
|
||||
} catch {
|
||||
cachedPrimaryEntryPointPayload = null;
|
||||
return null;
|
||||
}
|
||||
};
|
||||
const maybeInjectPrimaryEntryPoint = async (path: string, body: unknown): Promise<unknown> => {
|
||||
if (!isGlobalApplicationCommandsPath(path) || !Array.isArray(body)) {
|
||||
return body;
|
||||
}
|
||||
if (body.some((command) => isPrimaryEntryPointCommand(command))) {
|
||||
return body;
|
||||
}
|
||||
const entryPointPayload = await loadPrimaryEntryPointPayload(path);
|
||||
if (!entryPointPayload) {
|
||||
return body;
|
||||
}
|
||||
params.runtime.log?.(
|
||||
warn(
|
||||
`discord: auto-including existing Entry Point command in bulk deploy for ${accountId}.`,
|
||||
),
|
||||
);
|
||||
return [...body, entryPointPayload];
|
||||
};
|
||||
restClient.put = async (path: string, data?: unknown, query?: unknown) => {
|
||||
const startedAt = Date.now();
|
||||
const originalBody =
|
||||
const body =
|
||||
data && typeof data === "object" && "body" in data
|
||||
? (data as { body?: unknown }).body
|
||||
: undefined;
|
||||
const body = await maybeInjectPrimaryEntryPoint(path, originalBody);
|
||||
const requestData =
|
||||
body !== originalBody && data && typeof data === "object" && "body" in data
|
||||
? { ...(data as Record<string, unknown>), body }
|
||||
: data;
|
||||
const commandCount = Array.isArray(body) ? body.length : undefined;
|
||||
const bodyBytes =
|
||||
body === undefined
|
||||
@@ -453,7 +344,7 @@ async function deployDiscordCommands(params: {
|
||||
);
|
||||
}
|
||||
try {
|
||||
const result = await originalPut(path, requestData, query);
|
||||
const result = await originalPut(path, data, query);
|
||||
if ((shouldLogVerboseForTesting ?? shouldLogVerbose)()) {
|
||||
params.runtime.log?.(
|
||||
`discord startup [${accountId}] deploy-rest:put:done ${Math.max(0, Date.now() - startupStartedAt)}ms path=${path} requestMs=${Date.now() - startedAt}`,
|
||||
@@ -490,9 +381,6 @@ async function deployDiscordCommands(params: {
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (isEntryPointBulkUpdateRejected(err)) {
|
||||
throw err;
|
||||
}
|
||||
if (!(err instanceof RateLimitError) || attempt >= maxAttempts) {
|
||||
throw err;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user