2521 Commits

Author SHA1 Message Date
Peter Steinberger
64ecd3e81c test: merge duplicate targetDir escape cases 2026-02-22 17:51:38 +00:00
Peter Steinberger
0e38505d3d test: collapse duplicate sandbox skill mirroring cases 2026-02-22 17:51:38 +00:00
Peter Steinberger
c964d21d74 perf(test): prebuild download archives and cache apply module 2026-02-22 17:51:38 +00:00
Aleksandrs Tihenko
c52b2ad5c3
fix(cache): inject cache_control into system prompt for OpenRouter Anthropic (#15151) (#17473)
* fix(cache): inject cache_control into system prompt for OpenRouter Anthropic

Add onPayload wrapper that injects cache_control: { type: "ephemeral" }
into the system/developer message content for OpenRouter requests routed
to Anthropic models. The system prompt is typically ~18k tokens and was
being re-processed on every request without caching.

Fixes #15151

* Changelog: add OpenRouter note for #17473

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-02-22 12:27:01 -05:00
Joly0
ded9a59f78
OpenRouter: allow any model ID instead of restricting to static catalog (#14312)
* OpenRouter: allow any model ID instead of restricting to static catalog

OpenRouter models were restricted to a hardcoded prefix list in the internal model catalog, preventing use of newly added or less common models. This change makes OpenRouter work as the pass-through proxy it is -- any valid OpenRouter model ID now resolves dynamically.

Fixes https://github.com/openclaw/openclaw/issues/5241

Changes:
- Add OpenRouter as an implicit provider in resolveImplicitProviders so models.json is populated when an API key is detected (models-config.providers.ts)
- Add a pass-through fallback in resolveModel that creates OpenRouter models on-the-fly when they aren't pre-registered in the local catalog (
model.ts
)
- Remove the static prefix filter for OpenRouter/opencode in isModernModelRef (live-model-filter.ts)

* Apply requested change for maxTokens

* Agents: remove dead helper in live model filter

* Changelog: note Joly0/main OpenRouter fix

* Changelog: fix OpenRouter entry text

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-02-22 12:21:20 -05:00
zwffff
c543994e90
Default reasoning to on when model has reasoning: true (fix #22456) (#22513)
* Default reasoning to on when model has reasoning: true (fix #22456)

What: When a model is configured with reasoning: true in openclaw.json (e.g. OpenRouter x-ai/grok-4.1-fast), the session now defaults reasoningLevel to on if the user has not set it via /reasoning or session store.

Why: Users expected setting reasoning: true on the model to enable reasoning; previously only session/directive reasoningLevel was used and it always defaulted to off, so Think stayed off despite the model config.

* Chore: sync formatted files from main for CI

* Changelog: note zwffff/main OpenRouter fix

* Changelog: fix OpenRouter entry text

* Update msteams.md

* Update msteams.md

* Update msteams.md

---------

Co-authored-by: 曾文锋0668000834 <zeng.wenfeng@xydigit.com>
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-02-22 12:19:36 -05:00
Robby
99cfb3dab2
fix(openrouter): pass reasoning.effort based on thinking level (#14664) (#17236)
* fix(openrouter): pass reasoning.effort to OpenRouter API (#14664)

* Agents: pass thinkLevel to extra-params wrapper

* Changelog: note fix/openrouter-reasoning-effort-14664 OpenRouter fix

* Changelog: fix OpenRouter entry text

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-02-22 12:14:12 -05:00
Peter Steinberger
ad1072842e test: dedupe agent tests and session helpers 2026-02-22 17:11:54 +00:00
Mitsuyuki Osabe
415686244a
feat: pass through OpenRouter provider routing params (#17148)
extraParams.provider was silently dropped by createStreamFnWithExtraParams().
This change injects it into model.compat.openRouterRouting so pi-ai's
buildParams includes params.provider in the API request body.

Enables OpenRouter provider routing options (only, order, allow_fallbacks,
data_collection, ignore, sort, quantizations) via model config:

```jsonc
"openrouter/model-name": {
  "params": {
    "provider": {
      "only": ["deepinfra", "fireworks"],
      "allow_fallbacks": false
    }
  }
}
```

Closes #10869

✍️ Author: Claude Code with @carrotRakko (AI-written, human-approved)
2026-02-22 12:11:04 -05:00
Omair Afzal
3891ba4bb5
fix(providers): preserve openrouter/ prefix for native models (#12942)
* fix(providers): preserve openrouter/ prefix for native models (#12924)

OpenRouter-native models like 'openrouter/aurora-alpha' need the full
'openrouter/<name>' as the model ID in API requests. The existing
parseModelRef() stripped the prefix, sending just 'aurora-alpha'
which OpenRouter rejects with 400.

Fix: normalizeProviderModelId() now re-adds the 'openrouter/' prefix
for models without a slash (native models), while passing through
external provider models (e.g. 'anthropic/claude-sonnet-4-5') as-is.

Closes #12924

* Changelog: add OpenRouter note for #12942

---------

Co-authored-by: Luna AI <luna@coredirection.ai>
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-02-22 12:08:46 -05:00
Peter Steinberger
35fecc4bee test: remove redundant runner ordering checks 2026-02-22 17:06:35 +00:00
Peter Steinberger
c6b94f2652 test: speed up skills download tar traversal fixture 2026-02-22 17:06:35 +00:00
Peter Steinberger
bd6be417e4 test: trim duplicate smoke and embedded runner cases 2026-02-22 17:06:35 +00:00
Peter Steinberger
b1a97e77ca test: tighten bash timeout poll upper bound 2026-02-22 17:06:35 +00:00
Peter Steinberger
c5904da85a test: trim bash tool timing constants 2026-02-22 17:06:35 +00:00
Peter Steinberger
68b9b44498 test: reduce bash background abort wait constants 2026-02-22 17:06:35 +00:00
Peter Steinberger
089ee242bc test: precompute skills download tar fixture and dedupe setup 2026-02-22 17:06:35 +00:00
Peter Steinberger
2b74e5f66d test: reduce bash tool suite sleep durations 2026-02-22 17:06:35 +00:00
Peter Steinberger
47514e35a2 test: dedupe pi embedded runner setup and orphan case 2026-02-22 17:06:35 +00:00
Peter Steinberger
f3ba3fe8dc test: isolate skills-install temp home env 2026-02-22 17:06:35 +00:00
Peter Steinberger
3046fa31e8 test: isolate skills suite env and trim scan overhead 2026-02-22 17:06:35 +00:00
Peter Steinberger
6cd12ca1ce test: merge download archive safety suites 2026-02-22 17:06:35 +00:00
Peter Steinberger
0b13a0286e test: preload bash exec path tool module in suite 2026-02-22 17:06:34 +00:00
Peter Steinberger
6042075bdf test: preload safe-bins tool module in suite 2026-02-22 17:06:34 +00:00
Ayaan Zaidi
6268ed57ea fix(agents): stop param shadowing in auth failure marker 2026-02-22 21:00:17 +05:30
Peter Steinberger
d0b59270a7 refactor: dedupe auth-profile failure marking and rotation test setup 2026-02-22 15:44:10 +01:00
Glucksberg
53adae9cec
fix(telegram): add dnsResultOrder=ipv4first default on Node 22+ to fix fetch failures (#5405)
Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 71366e9532b6c67f0413b65a9ac8623eae000e9b
Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com>
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Reviewed-by: @obviyus
2026-02-22 20:07:51 +05:30
Peter Steinberger
3e2849c578 fix: align timeout cooldown behavior docs/tests (#22622) (thanks @vageeshkumar) 2026-02-22 15:34:20 +01:00
Vageesh Kumar
71d0b86352 fix(agents): skip auth profile cooldown for timeout failures
A timeout is model/network-specific, not an auth issue. Marking the
auth profile as failed on timeout poisons fallback models on the same
provider (e.g. gpt-5.3 timeout would block gpt-5.2 via shared profile
cooldown). The prompt-phase path already guards against this; this
aligns the post-response timeout path to match.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 15:34:20 +01:00
Peter Steinberger
4c355a28a3 refactor: centralize tool-error visibility policy 2026-02-22 15:30:53 +01:00
Peter Steinberger
835be4392e fix: gate tool error details behind verbose 2026-02-22 15:26:47 +01:00
Peter Steinberger
d116bcfb14 refactor(runtime): consolidate followup, gateway, and provider dedupe paths 2026-02-22 14:08:51 +00:00
Peter Steinberger
adfbbcf1f6 chore: merge origin/main into main 2026-02-22 13:42:52 +00:00
Peter Steinberger
1becebe188 fix: harden session lock contention and cleanup 2026-02-22 13:40:55 +00:00
Peter Steinberger
2c40a20737 test: trim background hold duration in abort coverage 2026-02-22 12:38:57 +00:00
Peter Steinberger
5b23159c4c test: create homedir before sandbox image mkdtemp 2026-02-22 12:35:38 +00:00
Peter Steinberger
96515a5729 test: merge duplicate read-tool content coverage cases 2026-02-22 12:32:05 +00:00
Peter Steinberger
c8a4977378 test: replace mtime sleep with explicit utimes bump 2026-02-22 12:29:53 +00:00
Peter Steinberger
dc356ae1c2 test: remove duplicate workspace path-resolution case 2026-02-22 12:27:55 +00:00
Peter Steinberger
c7a4346e4d test: remove sharp dependency from read-tool metadata test 2026-02-22 12:27:10 +00:00
Peter Steinberger
60a0291bf8 test: dedupe workspace path-resolution scenarios 2026-02-22 12:25:57 +00:00
Peter Steinberger
07527e22ce refactor(auth-profiles): centralize active-window logic + strengthen regression coverage 2026-02-22 13:23:19 +01:00
Peter Steinberger
1152b25866 fix(gateway): guard trim crashes in subagent flow 2026-02-22 13:21:26 +01:00
Peter Steinberger
0d0f4c6992 refactor(exec): centralize safe-bin policy checks 2026-02-22 13:18:25 +01:00
Artale
51e9c54f09
fix(agents): skip bootstrap files with undefined path (#22698)
* fix(agents): skip bootstrap files with undefined path

buildBootstrapContextFiles() called file.path.replace() without checking
that path was defined. If a hook pushed a bootstrap file using 'filePath'
instead of 'path', the function threw TypeError and crashed every agent
session — not just the misconfigured hook.

Fix: add a null-guard before the path.replace() call. Files with undefined
path are skipped with a warning so one bad hook can't take down all agents.

Also adds a test covering the undefined-path case.

Fixes #22693

* fix: harden bootstrap path validation and report guards (#22698) (thanks @arosstale)

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-02-22 13:17:07 +01:00
Peter Steinberger
7c3c406a35 fix: keep auth-profile cooldown windows immutable in-window (#23536) (thanks @arosstale) 2026-02-22 13:14:02 +01:00
artale
dc69610d51 fix(auth-profiles): never shorten cooldown deadline on retry
When the backoff saturates at 60 min and retries fire every 30 min
(e.g. cron jobs), each failed request was resetting cooldownUntil to
now+60m.  Because now+60m < existing deadline, the window kept getting
renewed and the profile never recovered without manually clearing
usageStats in auth-profiles.json.

Fix: only write a new cooldownUntil (or disabledUntil for billing) when
the new deadline is strictly later than the existing one.  This lets the
original window expire naturally while still allowing genuine backoff
extension when error counts climb further.

Fixes #23516

[AI-assisted]
2026-02-22 13:14:02 +01:00
Peter Steinberger
47c3f742b6 fix(exec): require explicit safe-bin profiles 2026-02-22 12:58:55 +01:00
Peter Steinberger
29cc7f431f test: share runtime scan filters and cached test scans 2026-02-22 12:44:44 +01:00
Peter Steinberger
3a65e4b523 test: make snapshot env override assertion independent of host env 2026-02-22 12:40:30 +01:00