Commit Graph

16532 Commits

Author SHA1 Message Date
Peter Steinberger
7d22a16adb fix: bound bootstrap handoff token scopes 2026-04-04 22:29:52 +09:00
Peter Steinberger
3758a0ce5b refactor(gateway): simplify connect auth parsing 2026-04-04 22:23:09 +09:00
AARON AGENT
16e7e2551b fix(cron): prevent agent default model from overriding cron payload model (#58294)
* fix(cron): prevent agent default model from overriding cron payload model (#58065)

When a cron job specifies a model override via the Advanced settings,
runWithModelFallback could silently fall back to the agent's configured
primary model. This happened because fallbacksOverride was undefined
when neither payload.fallbacks nor per-agent fallbacks were configured,
causing resolveFallbackCandidates to append the agent primary as a
last-resort candidate. A transient failure on the cron-selected model
(rate limit, model-not-found, etc.) would then succeed on the agent
default, making it appear as if the override was ignored entirely.

Fix: when the cron payload carries an explicit model override, ensure
fallbacksOverride is always a defined array (empty when no fallbacks
are configured) so the agent primary is never silently appended.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* test: use stricter toEqual([]) assertion for fallbacksOverride

Replace toBeDefined() + toBeInstanceOf(Array) with toEqual([])
to catch regressions where the array unexpectedly gains entries.
Addresses review feedback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: preserve cron override fallback semantics (#58294)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-04-04 22:18:38 +09:00
Peter Steinberger
3f1b2703b7 fix: preserve cached device token scopes safely (#46032) (thanks @caicongyang) 2026-04-04 22:17:38 +09:00
Assistant
056c0870a9 fix(gateway): preserve stored scopes when reconnecting with device token
When the gateway client reconnects using a stored device token, it was
defaulting to ["operator.admin"] scopes instead of preserving the
previously authorized scopes from the stored token. This caused the
operator device token to be regenerated without operator.read scope,
breaking status/probe/health commands.

This fix:
1. Loads the stored scopes along with the stored token in selectConnectAuth
2. Uses the stored scopes when reconnecting with a valid device token
3. Falls back to explicitly requested scopes or default admin-only scope
   when no stored scopes exist

Fixes #46000
2026-04-04 22:17:38 +09:00
Sebastian B Otaegui
33e6a7a28e feat(plugin-sdk): export OpenClawSchema via plugin-sdk/config-schema (#60557)
Merged via squash.

Prepared head SHA: 637ff7d3c8
Co-authored-by: feniix <91633+feniix@users.noreply.github.com>
Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com>
Reviewed-by: @altaywtf
2026-04-04 16:10:43 +03:00
Evan Newman
a26b844b88 fix(doctor): avoid repeat talk normalization changes from key order (#59911)
Merged via squash.

Prepared head SHA: a67bcaa11b
Co-authored-by: ejames-dev <180847219+ejames-dev@users.noreply.github.com>
Co-authored-by: hxy91819 <8814856+hxy91819@users.noreply.github.com>
Reviewed-by: @hxy91819
2026-04-04 21:07:10 +08:00
Vincent Koc
0d47106b98 fix(tests): restore stream wrapper type coverage 2026-04-04 21:56:48 +09:00
Vincent Koc
71ea82a4f4 fix(build): restore portable provider runtime types 2026-04-04 21:56:48 +09:00
Vincent Koc
2a03326925 fix(plugin-sdk): keep telegram command config available 2026-04-04 21:56:48 +09:00
Vincent Koc
b3faf20d91 perf(agents): avoid repeated subagent registry rescans 2026-04-04 21:56:48 +09:00
Peter Steinberger
032dbf0ec6 fix: serialize async auth rate-limit attempts 2026-04-04 21:55:09 +09:00
XING
587f19967c fix(cron): notify user via primary delivery channel on job failure (#60622)
Merged via squash.

Prepared head SHA: bee4dfca06
Co-authored-by: artwalker <44759507+artwalker@users.noreply.github.com>
Co-authored-by: frankekn <4488090+frankekn@users.noreply.github.com>
Reviewed-by: @frankekn
2026-04-04 20:24:16 +08:00
Vincent Koc
b742909dca fix(agents): prefer cron for deferred follow-ups (#60811)
* fix(agents): prefer cron for deferred follow-ups

* fix(agents): gate cron scheduling guidance

* fix(changelog): add scheduling guidance note

* fix(agents): restore exec approval agent hint
2026-04-04 21:11:27 +09:00
Vincent Koc
486505a54e refactor(providers): share kilocode stream family 2026-04-04 21:05:42 +09:00
Peter Steinberger
8cf6e4b5df fix(plugin-sdk): unblock gateway test surfaces 2026-04-04 21:02:04 +09:00
Peter Steinberger
fb0d60d7f3 fix: resolve MiniMax portal usage auth 2026-04-04 12:42:30 +01:00
Stuart Sy
3f457cabf7 fix(status): hydrate cache usage in transcript fallback (#59247)
* fix(status): hydrate cache usage in transcript fallback

* docs(changelog): note status cache fallback fix

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-04-04 20:34:41 +09:00
Peter Steinberger
9eb8184f36 fix: improve MiniMax coding-plan parsing (#52349) (thanks @IVY-AI-gif) 2026-04-04 20:32:15 +09:00
IVY
dd9c9dac53 style: format with oxfmt 2026-04-04 20:32:15 +09:00
IVY
30de4337bf fix: address review feedback and formatting
- Remove redundant name === 'MiniMax-M*' condition (already matched by startsWith)
- Use !== undefined guard instead of falsy check in deriveWindowLabelFromTimestamps
- Pass chatRemains directly to deriveWindowLabel when available
- Remove JSDoc comment style to match codebase conventions
2026-04-04 20:32:15 +09:00
IVY
efd5d5eb20 fix(usage): improve MiniMax coding-plan usage parsing for model_remains array
- Pick the chat model entry (MiniMax-M*) from model_remains instead of using the first BFS candidate, which could be a speech/video/image model with total_count=0.
- Derive window label from start_time/end_time timestamps when window_hours/window_minutes fields are absent; fixes the hardcoded 5h default for 4h windows.
- Include model name in plan label so users can distinguish free-tier coding-plan quota from paid API balance.

Closes #52335
2026-04-04 20:32:15 +09:00
Peter Steinberger
65fcf7e104 fix(gateway): scope browser-origin auth throttling 2026-04-04 20:30:39 +09:00
Vincent Koc
8f7b02e567 refactor(providers): share openai stream families 2026-04-04 20:29:11 +09:00
Vincent Koc
c75f82448f fix(google-cli): parse gemini json response and stats (#60801)
* fix(google-cli): restore gemini json reporting

* fix(google-cli): fall back to stats when usage is empty

* fix(changelog): note gemini cli cache reporting
2026-04-04 20:27:22 +09:00
Peter Steinberger
46cb493ac8 fix(sandbox): cover home credential bind audit 2026-04-04 20:27:10 +09:00
Peter Steinberger
3dda75894b refactor(agents): centralize run wait helpers 2026-04-04 20:22:16 +09:00
moktamd
2701e75f40 fix: disable thinking for MiniMax anthropic-messages streaming
MiniMax M2.7 returns reasoning_content in OpenAI-style delta chunks
({delta: {content: "", reasoning_content: "..."}}) when thinking is
active, rather than native Anthropic thinking block SSE events. Pi-ai's
Anthropic provider does not handle this format, causing the model's
internal reasoning to appear as visible chat output.

Add createMinimaxThinkingDisabledWrapper that injects
thinking: {type: "disabled"} into the outgoing payload for any MiniMax
anthropic-messages request where thinking is not already explicitly
configured, preventing the provider from generating reasoning_content
deltas during streaming.

Fixes #55739
2026-04-04 20:21:37 +09:00
Vincent Koc
bc648ac8e6 refactor(providers): add stream family hooks 2026-04-04 20:19:53 +09:00
Peter Steinberger
1037af01ad style(agents): normalize runtime prompt formatting 2026-04-04 12:19:08 +01:00
Peter Steinberger
c70b10460c style(auth): normalize auth choice formatting 2026-04-04 12:19:08 +01:00
Peter Steinberger
f3aad63f4e style(providers): normalize import and wrap formatting 2026-04-04 12:19:08 +01:00
Peter Steinberger
3207c5326a refactor: share native streaming compat helpers 2026-04-04 12:18:45 +01:00
Peter Steinberger
605f48556b refactor(browser): share lifecycle cleanup helpers 2026-04-04 12:17:46 +01:00
Peter Steinberger
c3f415ad6e fix: preserve node system.run approval plans 2026-04-04 20:16:53 +09:00
Peter Steinberger
53c33f8207 fix: forward node exec approval plans 2026-04-04 20:16:19 +09:00
Jasmine Zhang
b838ecf885 fix: add 60s timeout to MiniMax VLM fetch call
The VLM image analysis fetch had no timeout, causing sessions to hang
indefinitely when the MiniMax API is slow or unresponsive. Other
vision/model API calls in the codebase already use timeouts. Adds
AbortSignal.timeout(60_000) consistent with image upload workloads.

Fixes #54139
2026-04-04 20:15:13 +09:00
Peter Steinberger
39bcf695dc fix(cron): reject unsafe custom session targets earlier 2026-04-04 20:13:39 +09:00
Vincent Koc
c29d4bbb86 test(providers): add family capability matrix coverage 2026-04-04 20:11:25 +09:00
Peter Steinberger
91bac7cb83 fix(usage): restore provider auth fallback 2026-04-04 12:10:45 +01:00
Peter Steinberger
9b352ab5b0 test: isolate session status from provider runtime leak 2026-04-04 12:08:05 +01:00
Peter Steinberger
b7411ad594 refactor(cron): share descendant run quiescence wait 2026-04-04 20:07:33 +09:00
Peter Steinberger
7b6334b0f4 refactor(agents): share run wait reply helpers 2026-04-04 20:07:33 +09:00
Peter Steinberger
bbb0b574c4 refactor: centralize gateway method policy helpers 2026-04-04 20:07:18 +09:00
Vincent Koc
d766465e38 fix(google): add direct cachedContent support (#60757)
* fix(google): restore gemini cache reporting

* fix(google): split cli parsing into separate PR

* fix(google): drop remaining cli overlap

* fix(google): honor cachedContent alias precedence
2026-04-04 20:07:13 +09:00
Peter Steinberger
7ffbbd8586 fix: reserve admin gateway method prefixes 2026-04-04 20:04:48 +09:00
Peter Steinberger
3b09b58c5d test: cover browser cleanup for cron and subagents (#60146) (thanks @BrianWang1990) 2026-04-04 20:03:57 +09:00
BrianWang1990
e697838899 style: fix import order in server-cron.ts
Move plugin-sdk import after cron/* imports per alphabetical convention.
2026-04-04 20:03:57 +09:00
BrianWang1990
72b2e413d6 fix(browser): clean up browser tabs/processes when cron tasks and subagents complete
When cron tasks or subagents use browser automation, the browser
processes were not cleaned up after the task completed. This caused
orphaned Chrome processes (PPID=1) to accumulate over time.

Root cause: closeTrackedBrowserTabsForSessions was only called during
session-reset/session-delete (via ensureSessionRuntimeCleanup), but
isolated cron runs and subagent completions never triggered these paths.

Fix: Add browser tab cleanup in two places:
1. server-cron.ts: wrap runCronIsolatedAgentTurn in try/finally to
   ensure browser tabs are cleaned up after every cron run.
2. subagent-registry-lifecycle.ts: call closeTrackedBrowserTabsForSessions
   when a subagent run completes, before the announce cleanup flow.

Both cleanup calls are best-effort (caught errors) so they never mask
the actual task result or break the completion flow.

Fixes #60104
2026-04-04 20:03:57 +09:00
Peter Steinberger
0b1c9c7057 fix: stabilize codex auth ownership and ws fallback cache 2026-04-04 20:03:15 +09:00