Commit Graph

51273 Commits

Author SHA1 Message Date
Peter Steinberger
aef8d1771d fix(models): reset warmed provider auth on hot reload 2026-05-21 20:09:51 +01:00
Sarah Fortune
7ddcca6c77 address review v3: invalidate prepared map on auth-profile logout + defer plugin-reload rewarm
P1 (auth-profile logout): invalidateModelAuthStatusCache now also clears
the prepared provider-auth map, and the models.auth.logout handler fires
a rewarm against the current config. Without this, removing a provider's
auth profiles left the warmed 'true' answer in the map until restart,
so /models and pickers kept advertising the removed provider.

P1 (plugin-reload ordering): the previous version fired the rewarm
inline with the clear, before plan.reloadPlugins() ran. The warmer
reads plugin metadata and synthetic-auth hooks, so it published the
pre-reload runtime's answers. Moved the rewarm to fire after the
plugin-reload block completes, so it reads the new plugin runtime.

The early clear still happens upfront so callers don't keep seeing the
pre-reload answer during the reload window.
2026-05-21 20:09:51 +01:00
Sarah Fortune
c452a1e7e5 address review v2: workspace scope, warm generation guard, plugin reload trigger
ClawSweeper P1 + P2 findings on the prior review-fix commit.

- [P1] hasAuthForModelProvider now also checks workspaceDir against the
  warm's snapshot value. The warmer uses resolveDefaultAgentWorkspaceDir,
  but per-agent picker calls (buildModelsProviderData →
  resolveVisibleModelCatalog → createProviderAuthChecker) thread an
  agent-specific workspaceDir, and provider env/synthetic-auth
  resolution depends on it. Without this check the picker for agent B
  would silently reuse agent A's warmed answer.
- [P1] warmCurrentProviderAuthState now claims a generation counter at
  the start of its work and only publishes the new state if the
  generation hasn't been bumped (by a concurrent clear or another
  warm). Closes the race where a slow startup warm could overwrite a
  newer reload-driven rewarm with stale data.
- [P2] Reload handler now also clears and rewarms the prepared map
  when plugins.* config paths change. Provider auth can come from
  plugin env vars and plugin synthetic-auth wiring, so plugin hot
  reloads must invalidate the auth state too — not just model config
  paths.

Test: new case asserting a non-default workspaceDir caller bypasses the
prepared map and falls through to compute.
2026-05-21 20:09:51 +01:00
Sarah Fortune
01087cb936 address review: scope short-circuit by caller auth context + rewarm on reload
Two fixes flagged by ClawSweeper.

P1 — hasAuthForModelProvider now only short-circuits via the prepared
map when the caller's scope matches the warmer's (broad discovery, no
agentDir/env/store override). Read-only gateway model lists pass
runtimeAuthDiscovery: false, which the visibility helper maps to
discoverExternalCliAuth: false and allowPluginSyntheticAuth: false; the
prepared broad answer was previously masking that narrower intent. Now
those callers fall through to compute the narrow answer.

P2 — server-reload-handlers now also schedules a rewarm right after
clearing the prepared state on model-config reload, so long-lived
gateways don't regress to per-call discovery between reload and the
next restart.

Test: extends model-provider-auth.test.ts with a scope-narrowing case
asserting the prepared answer is bypassed when the caller passes
discoverExternalCliAuth: false / allowPluginSyntheticAuth: false.
2026-05-21 20:09:51 +01:00
Sarah Fortune
180cecda85 test(model-provider-auth): cover prepared-state short-circuit and clear
Asserts hasAuthForModelProvider returns the warmed answer for providers
in the prepared map and skips the compute path, and that
clearCurrentProviderAuthState restores fall-through to compute.
2026-05-21 20:09:51 +01:00
Sarah Fortune
4f80cc1943 perf(models): pre-warm provider auth state at gateway startup
Eliminates the per-call auth-filter loop that every /models invocation
(Discord/Telegram pickers, CLI, status commands) was paying — 30 unique
providers × ~600 ms each of plugin-runtime / external-CLI / auth-profile
discovery, done fresh on every call (~20 s per call).

warmCurrentProviderAuthState builds a provider->boolean map once at
gateway startup against a single AuthProfileStore scoped to every
candidate provider, and hasAuthForModelProvider consults the prepared
map first and short-circuits. The map is invalidated on config reload
alongside resetModelCatalogCache so the next read after a relevant
config change rewarms.

Per /models: ~20,569 ms → ~5 ms (~4,100×).
One-time startup warm cost: ~49 s (cold catalog + auth sweep), logged
via gateway log.info on completion.
2026-05-21 20:09:51 +01:00
Dallin Romney
ebd8b00cc3 fix(qa-lab): rename codex lifecycle fixtures to match knip ignore pattern (#85066)
knip's deadcode-unused-files check ignores fixtures matching **/*.fixture.ts
(dot before "fixture"). The codex lifecycle fixtures landed in bbf3eec786
as auth-profile-fixture.ts and codex-plugin-fixture.ts (hyphen), so knip
flagged them as unexpected unused files and CI's check-dependencies job
has been failing on main since then. Rename to auth-profile.fixture.ts
and codex-plugin.fixture.ts and update the lifecycle test, the fixture
cross-import, and the six qa/scenarios markdown files that reference
them by path and qaImport specifier.
2026-05-21 11:56:59 -07:00
Vincent Koc
b25a0d013b test(gateway): relax e2e node status waits 2026-05-22 02:25:30 +08:00
zhang-guiping
7d5afcbb3f fix #84745: scope Google preview model normalization to Google providers only (#84762)
Summary:
- The branch scopes config-time Google Gemini preview model normalization to Google providers or nested `google/` proxy suffixes, adds model-picker regression coverage, and adds a changelog entry.
- Reproducibility: yes. by source inspection. Current main sends every provider suffix through the Google prev ... i-3-flash` deterministically becomes `litellm/gemini-3-flash-preview`; I did not run a live cron preflight.

Automerge notes:
- PR branch already contained follow-up commit before automerge: fix(config): scope Google preview model normalization to Google provi…
- PR branch already contained follow-up commit before automerge: fix #84745: scope Google preview model normalization to Google provid…
- PR branch already contained follow-up commit before automerge: fix #84745: preserve proxy Google model normalization

Validation:
- ClawSweeper review passed for head c59163c809.
- Required merge gates passed before the squash merge.

Prepared head SHA: c59163c809
Review: https://github.com/openclaw/openclaw/pull/84762#issuecomment-4504169062

Co-authored-by: zhang-guiping <zhang.guiping@xydigit.com>
Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
Co-authored-by: 张贵萍0668001030 <zhang.guiping@xydigit.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
2026-05-21 17:45:57 +00:00
Vincent Koc
bbf3eec786 test(qa-lab): cover codex plugin lifecycle fixtures 2026-05-22 01:42:25 +08:00
Vincent Koc
ec0cf9af04 fix(tests): allow slower kitchen sink installs 2026-05-22 01:40:18 +08:00
Vincent Koc
46c8864048 revert(qa-lab): remove scenario github traceability metadata 2026-05-22 01:27:29 +08:00
Vincent Koc
23c58081d0 fix(docker): prune omitted plugin runtime deps 2026-05-22 01:08:48 +08:00
Dallin Romney
205c595b13 fix(auth): skip OAuth refresh adapter when credential has no refresh token (#85028)
OAuth credentials that loaded without their sidecar material (no access, no
refresh) would still enter the refresh path inside the per-profile lock,
where the adapter call is bounded by OAUTH_REFRESH_CALL_TIMEOUT_MS (120s).
That made the eventual "No API key found for provider" surface to the user
only after a long stall, even though the resolver had no usable material to
attempt with.

Short-circuit doRefreshOAuthTokenWithLock to return null when there is no
refresh token to use, after the in-lock main-store adoption and external
bootstrap-credential checks have already had a chance to recover.

Thanks @romneyda.
2026-05-21 10:00:29 -07:00
Vincent Koc
178e510aae test(qa-lab): cover update package sentinel 2026-05-22 00:59:02 +08:00
clawsweeper[bot]
7f943b5d8f fix(json): retry on transient File changed during read race condition (#85029)
Summary:
- The PR wraps the async JSON file readers in `src/infra/json-files.ts` with bounded retries for fs-safe `File changed during read` races, adds regression tests, and adds a changelog entry.
- Reproducibility: yes. Source inspection shows fs-safe throws `File changed during read`, current main re-exp ... R proof includes before/after gateway logs; I did not run a new live race harness in this read-only review.

Automerge notes:
- PR branch already contained follow-up commit before automerge: fix(json): preserve strict reader types (Promise<T> for readJson/read…
- PR branch already contained follow-up commit before automerge: test(json): add retry-success and retry-exhaustion coverage
- PR branch already contained follow-up commit before automerge: fix(json): resolve lint warnings (prefer-exponentiation-operator, cur…
- PR branch already contained follow-up commit before automerge: fix(json): retry on transient File changed during read race condition

Validation:
- ClawSweeper review passed for head 00602a1c03.
- Required merge gates passed before the squash merge.

Prepared head SHA: 00602a1c03
Review: https://github.com/openclaw/openclaw/pull/85029#issuecomment-4510494668

Co-authored-by: samson1357924 <98934496+samson1357924@users.noreply.github.com>
Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
Approved-by: takhoffman
Co-authored-by: takhoffman <781889+takhoffman@users.noreply.github.com>
2026-05-21 16:56:46 +00:00
clawsweeper[bot]
5955f354f7 fix(status): add gateway delivery health telemetry (#85016)
Summary:
- This replacement PR adds inbound delivery diagnostic events, gateway status counters and warnings, transport ... ut, Prometheus/OpenTelemetry metrics, docs, changelog, and regression coverage for gateway delivery health.
- Reproducibility: no. high-confidence live reproduction of the original Feishu failure was run here. Source i ... ch/turn telemetry, and the source PR supplies after-fix live output for the connected WebChat gateway path.

Automerge notes:
- PR branch already contained follow-up commit before automerge: fix(types): restore PR conflict resolution type checks

Validation:
- ClawSweeper review passed for head 6ffe08a9c7.
- Required merge gates passed before the squash merge.

Prepared head SHA: 6ffe08a9c7
Review: https://github.com/openclaw/openclaw/pull/85016#issuecomment-4510224436

Co-authored-by: Andi Liao <liaoandi95@gmail.com>
Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
Approved-by: takhoffman
Co-authored-by: takhoffman <781889+takhoffman@users.noreply.github.com>
2026-05-21 16:55:29 +00:00
Vincent Koc
efb7e4742f test(qa-lab): trace scenario issue evidence 2026-05-22 00:51:32 +08:00
clawsweeper[bot]
b33deb4159 fix(sessions): preserve compatible auth overrides (#85014)
Summary:
- This replacement branch preserves compatible session auth profile overrides during `sessions.patch` model ch ... d/cross-provider regression coverage, and updates related doctor/Mantis test assertions plus the changelog.
- Reproducibility: yes. by source inspection: current main’s `sessions.patch` model branch calls `applyModelOv ... d helper clears auth fields unless preservation is requested. I did not run tests in this read-only review.

Automerge notes:
- PR branch already contained follow-up commit before automerge: test(mantis): align telegram proof evidence comment
- PR branch already contained follow-up commit before automerge: fix(sessions): preserve provider auth aliases
- PR branch already contained follow-up commit before automerge: fix(sessions): guard unprefixed auth overrides
- PR branch already contained follow-up commit before automerge: fix(doctor): preserve params prototype semantics
- PR branch already contained follow-up commit before automerge: fix(sessions): preserve compatible auth overrides

Validation:
- ClawSweeper review passed for head 64a07393d5.
- Required merge gates passed before the squash merge.

Prepared head SHA: 64a07393d5
Review: https://github.com/openclaw/openclaw/pull/85014#issuecomment-4510194125

Co-authored-by: Andy Ye <35905412+TurboTheTurtle@users.noreply.github.com>
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
Approved-by: takhoffman
Co-authored-by: takhoffman <781889+takhoffman@users.noreply.github.com>
2026-05-21 16:17:50 +00:00
Vincent Koc
652712e0ad ci(qa): publish soak parity artifacts 2026-05-22 00:08:51 +08:00
Vincent Koc
9f2c0a80b4 fix(qa): keep searchable tool coverage report-only 2026-05-21 23:55:35 +08:00
Vincent Koc
da1925cb67 test(e2e): isolate kitchen sink rpc gateway 2026-05-21 23:54:33 +08:00
clawsweeper[bot]
277a4b6952 fix(ollama): allow Orb host local auth (#84999)
Summary:
- The PR adds Docker/OrbStack host aliases to Ollama local-auth classification, keeps those aliases out of loopback-only discovery suppression, adds regression tests, and updates the changelog.
- Reproducibility: yes. The linked report gives a concrete v2026.5.19 config and error, and current main source shows host.orb.internal is not classified as local for ollama-local marker auth.

Automerge notes:
- PR branch already contained follow-up commit before automerge: fix(ollama): allow Orb host local auth

Validation:
- ClawSweeper review passed for head cb82dcf522.
- Required merge gates passed before the squash merge.

Prepared head SHA: cb82dcf522
Review: https://github.com/openclaw/openclaw/pull/84999#issuecomment-4509786332

Co-authored-by: Bob <dutifulbob@gmail.com>
Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
Approved-by: osolmaz
Co-authored-by: osolmaz <2453968+osolmaz@users.noreply.github.com>
2026-05-21 15:37:42 +00:00
Firas Alswihry
229323d37a test(qa-lab): add personal failure recovery scenario 2026-05-21 23:22:35 +08:00
Vincent Koc
0e6f314dbb ci: tune crabbox developer image config 2026-05-21 23:21:35 +08:00
Vincent Koc
cf0657852f feat(qa-lab): add jsonl replay harness 2026-05-21 23:03:51 +08:00
Neerav Makwana
66dcc4ee8f fix(codex): beta blocker - keep context engine on canonical session key (#84954)
Merged via squash.

Prepared head SHA: 6cdccaa007
Co-authored-by: neeravmakwana <261249544+neeravmakwana@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
2026-05-21 11:01:35 -04:00
Peter Steinberger
1b1580cbc3 chore(release): refresh generated baselines 2026-05-21 15:52:04 +01:00
Sally O'Malley
e72f601925 fix(openshell): use NVIDIA CLI contract
Remove the unrelated npm openshell dependency and keep the OpenShell sandbox backend pointed at the NVIDIA CLI command contract.
2026-05-21 22:51:57 +08:00
Peter Steinberger
94b6d9f8b2 docs(release): prefer 1Password provider preflight 2026-05-21 15:46:34 +01:00
Gio Della-Libera
6dbd5bd446 Policy: add model, network, and MCP conformance checks (#80783)
* feat(policy): add model network and mcp conformance checks

* fix(policy): validate conformance rule shapes

* fix(policy): quote dynamic evidence paths

* fix(policy): scan per-agent model maps

* fix(policy): normalize model provider conformance
2026-05-21 07:27:16 -07:00
Vincent Koc
2bb00f6726 fix(agents): fence embedded session writes 2026-05-21 22:17:48 +08:00
Peter Steinberger
95eac52e92 test: update command auth expectations 2026-05-21 15:14:48 +01:00
Peter Steinberger
e0b53cae41 docs: remove stale owner tool wording 2026-05-21 15:14:48 +01:00
Peter Steinberger
02182d5a30 refactor: remove sender owner tool gating 2026-05-21 15:14:48 +01:00
Rubén Cuevas
159b3002e4 fix(xai): keep OAuth URL clickable (#84927) 2026-05-21 07:08:34 -07:00
Jesse Merhi
a901396ad1 Fix stale WebChat typing indicator after terminal session patch (#84565)
Summary:
- The branch clears WebChat local run and stream state when terminal session reconciliation completes the acti ...  session events, adjusts deferred history/queue flushing, adds regression tests, and updates the changelog.
- Reproducibility: yes. with high confidence from source inspection and PR evidence. Current main can apply a  ...  PR body, recording, and regression shape show the stale WebChat typing state being cleared by this branch.

Automerge notes:
- PR branch already contained follow-up commit before automerge: fix: harden webchat session run reconciliation

Validation:
- ClawSweeper review passed for head 89cca8dd01.
- Required merge gates passed before the squash merge.

Prepared head SHA: 89cca8dd01
Review: https://github.com/openclaw/openclaw/pull/84565#issuecomment-4498262223

Co-authored-by: jesse-merhi <79823012+jesse-merhi@users.noreply.github.com>
Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
Approved-by: jesse-merhi
2026-05-21 14:05:58 +00:00
Peter Steinberger
c49647ee23 docs: document rejected autoreview findings 2026-05-21 14:55:07 +01:00
Vincent Koc
db606a8475 docs(changelog): note VAPID subject fix
Add the missing changelog entry for the landed Web Push VAPID subject fix and refresh the config docs baseline hash to match the Node 24 check environment.
2026-05-21 21:54:47 +08:00
Shakker
6ccca4ae95 docs: add plugin registry reuse changelog 2026-05-21 13:41:29 +01:00
Shakker
b248b4816b test: cover dispatch registry reuse caller 2026-05-21 13:41:29 +01:00
ai-hpc
d2ad7d6b4c perf(plugins): reuse compatible gateway startup registry 2026-05-21 13:41:29 +01:00
Vincent Koc
bde07ddb15 fix(tests): wrap kitchen sink pnpm runner 2026-05-21 19:24:56 +08:00
Vincent Koc
04061bc801 fix(agents): cap heartbeat context hint fallback 2026-05-21 19:01:00 +08:00
Vincent Koc
88c49f9e68 chore(deadcode): dedupe repeated helpers 2026-05-21 18:47:09 +08:00
Frank Yang
f39f56a096 perf(cli): cache stable subcommand help (#84786)
Serve stable doctor, gateway, models, and plugins parent help from startup metadata while preserving strict argv validation and version precedence.

Verification:
- pnpm test src/cli/run-main.test.ts src/cli/run-main.exit.test.ts test/scripts/write-cli-startup-metadata.test.ts -- --reporter=default
- pnpm check:changed
- GitHub required checks passed
2026-05-21 18:01:32 +08:00
WhatsSkiLL
2000227e9e fix(ollama): preserve tool call ids [AI-assisted] (#84855)
Summary:
- The PR preserves native Ollama tool-call IDs through ingest and replay, opts native Ollama out of strict replay ID sanitization, and adds focused regression tests plus a changelog entry.
- Reproducibility: yes. Current main drops native Ollama tool-call IDs on ingest and replay and applies strict ...  PR discussion includes a maintainer-side before/after probe that reproduced the source-level failure path.

Automerge notes:
- PR branch already contained follow-up commit before automerge: fix(ollama): keep native tool ids through replay

Validation:
- ClawSweeper review passed for head bb9fef7d4c.
- Required merge gates passed before the squash merge.

Prepared head SHA: bb9fef7d4c
Review: https://github.com/openclaw/openclaw/pull/84855#issuecomment-4505423891

Co-authored-by: IWhatsskill <whatsskilll@gmail.com>
Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
Approved-by: osolmaz
Co-authored-by: osolmaz <2453968+osolmaz@users.noreply.github.com>
2026-05-21 09:51:00 +00:00
Peter Steinberger
f43e83c937 fix: align remaining copyright notice 2026-05-21 10:47:54 +01:00
tanshanshan
8a8f9dc8cb fix(config): append numeric bound hints to ceiling/floor validation errors (#84852)
* fix(config): append numeric bound hints to ceiling/floor validation errors

When a config value exceeds a schema-enforced ceiling or falls below a
floor, the error message now includes the constraint explicitly:
  - Inclusive: `(maximum: 20)` / `(minimum: 0)`
  - Exclusive: `(must be less than 5)` / `(must be greater than 0)`

This matches the clarity that enum/union rejections already get via
`(allowed: …)` hints, and avoids the misleading "minimum: 0" wording
that previous attempts produced for `.positive()` / `.gt(0)` rejections.

Only numeric-origin `too_big`/`too_small` issues are enriched; string,
array, and file-size origins are left unchanged.

Fixes #52500

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

* test(config): update maxFileBytes test for numeric bound hint

The test snapshot for `logging.maxFileBytes: 0` rejection now includes
the `(must be greater than 0)` hint appended by the numeric bound
enrichment added in the previous commit.

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

* fix(config): guard nullable record in appendNumericBoundHint call

ClawSweeper P1: `record` from `toIssueRecord()` can be null, but
`appendNumericBoundHint` expects a non-null `UnknownIssueRecord`.
Guard with a ternary so the original message is returned when record
is null (which only happens for malformed/empty issues that already
produce generic "Invalid input" messages).

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

---------

Co-authored-by: tanshanshan <tanshanshan@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 17:44:29 +08:00
Vincent Koc
0fb1de5f73 fix(qa): enable private self-check runtime 2026-05-21 17:42:42 +08:00