Commit Graph

30093 Commits

Author SHA1 Message Date
Vincent Koc
fb70de8046 test(plugin-sdk): align debouncer runtime mock 2026-05-18 14:34:07 +08:00
Ayaan Zaidi
ad4a74c884 test(reply): cover preview final delivery 2026-05-18 11:55:03 +05:30
Ayaan Zaidi
b6fd843288 fix(reply): keep final delivery after previews 2026-05-18 11:55:03 +05:30
Peter Steinberger
b3fc9fe079 fix(update): keep modern deferral metadata current 2026-05-18 07:21:42 +01:00
Peter Steinberger
394037c174 fix(update): defer configured plugin installs for shipped parents 2026-05-18 07:21:42 +01:00
Peter Steinberger
2976517bc7 fix(plugins): gate onboarding ClawHub npm fallback 2026-05-18 07:21:42 +01:00
Peter Steinberger
00205cab08 fix(plugins): restrict ClawHub npm fallback scope 2026-05-18 07:21:42 +01:00
Peter Steinberger
db8de0db7a fix(update): preserve managed package manager roots 2026-05-18 07:21:42 +01:00
Peter Steinberger
aec0c56386 fix(update): harden legacy package handoff 2026-05-18 07:21:42 +01:00
scoootscooob
5a7b861ea2 fix(config): keep unrelated plugin diagnostics nonfatal (#83438)
* fix(config): keep unrelated plugin diagnostics nonfatal

* docs(changelog): mention config plugin validation fix
2026-05-17 23:11:15 -07:00
Peter Steinberger
e96428b008 fix(config): share subagent model schema (#83339)
* fix(config): share subagent model schema

* fix(config): remove subagent model timeout surface

* fix(config): migrate ignored agent model timeouts

* test(config): fix doctor migration lint

* test(extensions): remove retired model timeout fixture

* fix(config): collect default subagent pricing refs
2026-05-18 07:07:52 +01:00
Peter Steinberger
102e4f2c9d fix: replay Xiaomi Anthropic reasoning blocks 2026-05-18 06:53:17 +01:00
Peter Steinberger
476bd35431 fix: correct restart trace timer metrics (#83300) 2026-05-18 06:51:44 +01:00
samzong
51d44ab1fc fix: scope plugin service startup traces
Signed-off-by: samzong <samzong.lu@gmail.com>
2026-05-18 06:51:44 +01:00
samzong
e292d3976a feat(gateway): attribute ACPX startup probe cost
Signed-off-by: samzong <samzong.lu@gmail.com>
2026-05-18 06:51:44 +01:00
Patrick Erichsen
9d4500f3ac test: cover gateway exec approval runtime flow (#83452)
* test: cover gateway exec approval runtime flow

* fix: satisfy exec approval e2e test types
2026-05-17 22:42:04 -07:00
Said Urtabajev
47b8e56e3f feat(docker): add image apt package build arg
feat(docker): add image apt package build arg

Add OPENCLAW_IMAGE_APT_PACKAGES as the preferred runtime-neutral image build arg for Docker and Podman apt package installs while keeping OPENCLAW_DOCKER_APT_PACKAGES as the legacy fallback.

Maintainer verification:
- pnpm docs:list
- node scripts/run-vitest.mjs run --config test/vitest/vitest.e2e.config.ts src/docker-setup.e2e.test.ts
- node scripts/run-vitest.mjs src/dockerfile.test.ts test/scripts/test-install-sh-docker.test.ts
- node scripts/run-vitest.mjs run --config test/vitest/vitest.cron.config.ts src/cron/isolated-agent.model-overrides.test.ts
- pnpm exec oxfmt --check --threads=1 docs/install/docker.md docs/install/podman.md scripts/clawdock/README.md docs/help/faq.md CHANGELOG.md
- git diff --check origin/main...HEAD
- .agents/skills/autoreview/scripts/autoreview --mode local
- .agents/skills/autoreview/scripts/autoreview --mode branch
- pnpm check:changed via Blacksmith Testbox tbx_01krwqmfhcdekaczvrkxnb7t59, Actions run 26014630478, exit 0

Known CI note: checks-node-core-runtime-shared timed out repeatedly in unrelated src/cron/isolated-agent.model-overrides.test.ts on GitHub Actions; the same test passes locally after this rebase.

Co-authored-by: Said Urtabajev <said@bumpclub.ee>
2026-05-18 06:37:16 +01:00
Vincent Koc
57bc26893e test(cron): force PI for timeout override assertions 2026-05-18 13:33:07 +08:00
Peter Steinberger
e453a39d6b build: align node version floor 2026-05-18 06:28:14 +01:00
Peter Steinberger
f7196e3b53 build: update pi dependencies to 0.75.1 2026-05-18 06:22:36 +01:00
Vincent Koc
9d5db92cda test(cron): type OpenAI PI override config 2026-05-18 13:22:23 +08:00
Vincent Koc
939712fbbf test(cron): keep OpenAI override assertions on PI 2026-05-18 13:12:01 +08:00
Jesse Merhi
198f20fd20 Fix approval runtime gateway calls (#83433)
* fix approval runtime gateway calls

* docs: credit approval runtime fix contributors

* docs: include maintainer changelog credit
2026-05-18 15:10:15 +10:00
Vincent Koc
e3d5518838 test(agents): cover Codex preflight plugin load 2026-05-18 12:55:02 +08:00
Vincent Koc
8f27b3e21f fix(agents): fail closed on missing Codex harness 2026-05-18 12:47:51 +08:00
Josh Avant
395bd578d2 Fix Telegram hot reload polling restarts (#83410)
* fix(telegram): preserve hot reload polling restarts

* docs: add changelog for telegram hot reload fix
2026-05-17 23:24:04 -05:00
Peter Steinberger
84b34519a8 fix: preflight remote skill bin probes 2026-05-18 05:19:02 +01:00
Peter Steinberger
8483d03375 fix(gateway): preserve spawned sessions in configured lists 2026-05-18 04:38:14 +01:00
Peter Steinberger
29653e4106 fix: harden Mac gateway transport selection 2026-05-18 04:06:17 +01:00
Dongyan Qian
63b728de43 fix(telegram): retry 421 misdirected request responses
Treat Telegram HTTP 421 / Misdirected Request responses as retryable transport failures in both the default channel API retry policy and the strict outbound send retry path.

Wire the 421 handling into isSafeToRetrySendError so non-idempotent Telegram send operations can retry this edge-node rejection without enabling broad ambiguous network retries, and add regression coverage for the default retry path plus strict send predicate handling.
2026-05-18 08:28:27 +05:30
Vincent Koc
73ca3cf3c3 test: tolerate optional ACP cron live timeout 2026-05-18 10:55:13 +08:00
Gio Della-Libera
1b5bc33161 fix(doctor): archive legacy clawd browser profile residue (#83230)
* fix(doctor): archive legacy clawd browser profile residue

* Avoid browser cleanup load without residue

Doctor --fix now skips loading the browser doctor facade unless the legacy browser/clawd profile path exists, preventing broad config repair tests from paying the plugin load cost when there is nothing to archive.

* Use structured health check for browser residue

Register the legacy clawd browser profile residue cleanup through the modern doctor health-check contract so doctor --lint can report it and doctor --fix repairs it through structured effects.
2026-05-17 19:45:03 -07:00
Gio Della-Libera
bcbe8b6299 fix(codex): surface declined native tool replies (#83108) 2026-05-17 19:43:19 -07:00
Peter Steinberger
48f7db23f0 fix: harden clawpatch-reported edge cases 2026-05-18 03:18:55 +01:00
Vincent Koc
58e1351863 fix(qa-lab): hard gate runtime tool coverage 2026-05-18 10:05:04 +08:00
Gio Della-Libera
1768667374 fix(migrate): count hidden config conflicts in preview (#83314) 2026-05-17 18:50:22 -07:00
Gio Della-Libera
8855a4aa58 fix(update): require integer timeout values (#83310)
* fix(update): require integer timeout values

* fix(update): reject blank timeout values
2026-05-17 18:47:59 -07:00
Peter Steinberger
4b4048fd22 fix: guard xai oauth callback cors (#83322) (thanks @Jaaneek) 2026-05-18 02:43:12 +01:00
Jaaneek
5f1df99a9c xai: OAuth login fixes plus openclaw User-Agent attribution
OAuth login flow
----------------
- Hard-require refresh_token after the authorization-code exchange in
  xai-oauth.ts. Access-only responses persisted credentials that the
  downstream usability check later rejected; the new requireRefreshToken
  option fails the exchange instead. Error wording explains the missing
  refresh_token in OIDC scope terms (offline_access scope rejected),
  not a "grant".
- Derive token expiry from the access-token JWT exp claim when
  expires_in is missing. id_token exp is intentionally not used as a
  fallback because id_token lifetime tracks the OIDC session, not the
  access token, and would defer refresh past actual expiry.
- Handle CORS preflight OPTIONS on the loopback OAuth callback in
  src/plugin-sdk/provider-auth-runtime.ts. The previous handler treated
  any non-callback request as a failed GET, returned "Missing code or
  state", and tore the server down before the real GET arrived. The
  CORS allowlist is now an optional `corsOriginAllowlist` parameter on
  waitForLocalOAuthCallback so the SDK helper stays generic. The xAI
  plugin passes ["auth.x.ai", "accounts.x.ai"] from loginXaiOAuth.

Sidecar surfaces
----------------
- speech-provider.ts (POST /v1/tts) honors the xAI OAuth profile in
  addition to provider config and XAI_API_KEY. isConfigured now also
  reports true when an xAI auth profile is configured (via
  isProviderAuthProfileConfigured), so OAuth-only users are no longer
  silently filtered out by the selection layer. The bearer resolver
  threads req.cfg into resolveApiKeyForProvider so the right xAI auth
  profile is picked when a user has multiple.
- realtime-transcription-provider.ts (WSS /stt) gets the same
  isConfigured fix, and the lazy headers() resolver threads req.cfg
  into the OAuth bearer lookup. createSession stays sync per its
  plugin contract.
- stt.ts: drop the plugin-side OAuth fallback. The media-understanding
  core already resolves auth (cfg/agentDir-aware) via
  resolveProviderExecutionContext before calling transcribeAudio, so
  the wrapper was redundant. transcribeAudio is now the registered
  hook directly.

User-Agent attribution
----------------------
- New buildXaiAttributionPolicy in src/agents/provider-attribution.ts
  injects User-Agent: openclaw/<version>, originator, and version on
  /v1/responses and /v1/chat/completions traffic that goes through
  resolveProviderRequestHeaders. Gated to xai-native and default
  endpoint classes; custom proxy baseUrls remain withheld. reviewNote
  is honest about which headers are spec-verified vs mirrored.
- Shared extensions/xai/src/xai-user-agent.ts helper exports
  xaiUserAgentHeaderFor(baseUrl) which only emits the User-Agent when
  the resolved baseUrl points at the xAI-native API host. Threaded
  through TTS and realtime STT (WS upgrade headers) so user-configured
  proxy baseUrls do not receive the openclaw identity. OAuth discovery
  and token endpoints still send User-Agent unconditionally because
  isTrustedXaiOAuthEndpoint already restricts those URLs to *.x.ai.
- Image gen, batch STT, and video gen rely on the attribution policy
  alone (no manual User-Agent in defaultHeaders), so attribution
  withholding on user-configured proxy baseUrls is preserved
  end-to-end.
- UA is bearer-agnostic: same value whether the bearer comes from an
  xAI API key or the xAI OAuth flow.

Drop dead api.grok.x.ai alias
-----------------------------
- xAI retired the api.grok.x.ai alias; DNS now returns NXDOMAIN from
  xAI's own authoritative nameservers. Drop it from the xai-native
  endpoint host set in extensions/xai/openclaw.plugin.json,
  extensions/xai/api.ts, extensions/xai/tts.ts, and the
  openai-responses payload policy. Update the attribution test to
  classify api.grok.x.ai as "custom" (no live user can reach it; the
  classification keeps documenting the host's status).

Video generation now matches xAI's actual API behavior
------------------------------------------------------
Previously, real video generation requests failed with
"xAI video generation response malformed" because the poll-status
handler validated against a closed enum that did not match what the
xAI service actually returns. Four fixes:
- Loosen the poll-status handler. xAI returns intermediate strings
  outside `["queued", "processing", "done", "failed", "expired"]`
  (commonly `submitted`, `pending`, `in_progress`, ...). Treat `done`
  as terminal-success, `["failed", "error", "expired", "cancelled"]`
  as terminal-failure, and any other string (including empty) as
  continue-polling. Also accept `cancelled` as a terminal failure.
- Send default duration/aspect_ratio/resolution on every generate and
  reference-image submit. xAI rejects bodies that omit these fields.
  Defaults: duration=8s, aspect_ratio="16:9", resolution="720p".
- Accept lowercase resolution input ("480p"/"720p"/"1080p") in
  addition to uppercase, normalize to lowercase on the wire.
- Add an `x-idempotency-key` header (fresh `crypto.randomUUID()`) on
  every submit so a network retry does not double-charge the user.
  Polls intentionally reuse the unmodified `headers` without the key.

Ergonomics
----------
- All "missing xAI credentials" errors (code_execution, lazy
  code_execution fallback in extensions/xai/index.ts, x_search,
  web_search grok in web-search-provider.runtime.ts, TTS, batch STT,
  realtime STT) now mention `openclaw onboard --auth-choice xai-oauth`
  first.
- Dedupe the Grok model-id alias table: model-compat.ts re-exports
  normalizeXaiModelId from model-id.ts as normalizeNativeXaiModelId.

Test coverage
-------------
- src/plugin-sdk/provider-auth-runtime.test.ts: locks the new pure
  buildOAuthCallbackOriginResolver gate (allowlist match,
  case-normalization, https-only, non-allowlisted hosts dropped,
  multi-Origin handling).
- extensions/xai/xai-oauth.test.ts: locks
  XAI_OAUTH_CALLBACK_CORS_ORIGIN_ALLOWLIST so loginXaiOAuth keeps
  threading the right hosts to the SDK helper.
- extensions/xai/speech-provider.test.ts: OAuth-only auth profile
  flips isConfigured to true; cfg threads into the OAuth fallback
  resolver.
- extensions/xai/realtime-transcription-provider.test.ts: same +
  upgrade headers carry the OAuth bearer end-to-end.
- extensions/xai/stt.test.ts: explicit assertion that transcribeAudio
  trusts the core-resolved apiKey (no plugin-side wrapper).

Verification
------------
- pnpm install: clean
- 154/154 vitest tests pass across 13 touched test files
- pnpm check:changed: typecheck core/ext + tests, oxlint core/ext,
  runtime guards, dependency pin guard, package patch guard, runtime
  import cycles, sidecar loader guard - all green
- pnpm build: 0 errors, 0 [INEFFECTIVE_DYNAMIC_IMPORT] warnings
2026-05-18 02:43:12 +01:00
Peter Steinberger
645ef817b6 test(channels): preserve thread origin contracts
Add core and hook mapper regression coverage for the thread-origin contract behind #83302.\n\nThe tests prove a flat reply target can coexist with a thread-addressable OriginatingTo, and hook canonical conversation mapping keeps following OriginatingTo.\n\nProof: focused Vitest, autoreview, Testbox check:changed tbx_01krwaztbwm13sx9e4sbyyz4c1, and CI run 26008670388 passed.
2026-05-18 02:30:24 +01:00
Josh Avant
73049d291b Fix transcript-only assistant rows in latest reply lookup (#83362)
* fix: skip transcript-only latest assistant rows

* chore: add changelog for transcript-only assistant fix
2026-05-17 20:13:34 -05:00
Peter Steinberger
5434769e47 fix(cron): suppress source replies for announce delivery 2026-05-18 01:41:16 +01:00
compoodment
6ebe91d92b test: cover one-chunk progress final payload 2026-05-18 01:37:59 +01:00
Peter Steinberger
9bdc183b7d fix(cli): keep subcommand help lightweight 2026-05-18 01:35:04 +01:00
Peter Steinberger
b0b18d1e4a fix: seed control UI origins for bind aliases 2026-05-18 01:21:33 +01:00
Peter Steinberger
47a2efe483 fix: hide display-hidden chat transcript messages 2026-05-18 01:04:48 +01:00
Peter Steinberger
9da0f80356 fix(openai): allow available Codex OAuth models 2026-05-18 01:04:14 +01:00
Josh Avant
06f4c97130 Keep legacy Codex OAuth sidecar profiles usable (#83312)
* fix legacy Codex oauth sidecar compatibility

* docs add changelog for legacy Codex oauth compatibility

* annotate legacy oauth hash compatibility
2026-05-17 18:41:07 -05:00
Peter Steinberger
9a936b3063 test: fix CI regressions 2026-05-18 00:37:48 +01:00
Peter Steinberger
691d62630f test: keep slow tests under duration cap 2026-05-18 00:26:44 +01:00