Commit Graph

33061 Commits

Author SHA1 Message Date
Heather Wilde Renze
6a21962552 fix(sessions): enforce maintenance by default and prune on load to prevent gateway OOM
Co-authored-by: bobrenze-bot <bobrenze-ops@gmail.com>
2026-04-21 04:05:39 +01:00
Omar Shahine
b5f25de352 bluebubbles: forward per-group systemPrompt into GroupSystemPrompt (#69198)
Forward per-group systemPrompt config into inbound context GroupSystemPrompt so configured group-specific behavioral instructions (for example threaded-reply and tapback conventions) are injected on every turn. Supports "*" wildcard fallback matching the existing requireMention pattern.

Closes #60665.

Co-authored-by: Omar Shahine <omarshahine@users.noreply.github.com>
2026-04-20 20:01:03 -07:00
Peter Steinberger
d1f7f69cd4 fix: serialize run-node artifact writes 2026-04-21 03:53:23 +01:00
Peter Steinberger
11e6575c69 test: add QA coverage scenarios 2026-04-21 03:53:23 +01:00
Peter Steinberger
0c26623a96 fix: correct tiered model pricing costs 2026-04-21 03:48:25 +01:00
Shakker
04d41aeae1 docs: add setup tui hatch changelog 2026-04-21 03:47:38 +01:00
Shakker
aae4b1b29d Fix setup TUI hatch terminal handoff (#69524)
* fix: relaunch setup tui in a fresh process

* fix: harden setup tui handoff

* fix: preserve tui hatch exit flow

* Revert "fix: preserve tui hatch exit flow"

This reverts commit f4f119a5a3.

* fix: let setup tui resolve gateway auth

* fix: support packaged tui relaunch

* fix: pin setup tui gateway target

* fix: preserve setup tui auth source
2026-04-21 03:45:57 +01:00
Peter Steinberger
bed2472121 fix: stabilize docker live checks 2026-04-21 03:45:32 +01:00
Peter Steinberger
9efd2d10e7 fix: snapshot session cost estimates (#69403) (thanks @MrMiaigi) 2026-04-21 03:44:25 +01:00
Peter Steinberger
9b42cd8728 test: fix cost snapshot PR checks 2026-04-21 03:44:25 +01:00
Dexter (Miaigi)
47bb5ddece fix(cost): snapshot estimatedCostUsd instead of accumulating (#69347)
The bug: three persist sites accumulated cost instead of snapshotting
it like tokens. This caused cost to be inflated 1x-72x on multi-persist
sessions because the same cumulative usage was added repeatedly.

Root cause: persistSessionUsageUpdate, updateSessionStoreAfterAgentRun,
and the cron isolated-agent run path all used:
  estimatedCostUsd = existingCost + runCost

But runCost was already computed from cumulative run usage, so this
added the same cost repeatedly on redundant persists.

Fix: snapshot cost directly like tokens already do:
  estimatedCostUsd = runCost

Files affected:
- src/auto-reply/reply/session-usage.ts
- src/agents/command/session-store.ts
- src/cron/isolated-agent/run.ts

Tests added:
- session-store.test.ts: verify cost is snapshotted, not accumulated
- session.test.ts: updated existing test to verify snapshot behavior

Fixes #69347
2026-04-21 03:44:25 +01:00
Peter Steinberger
5bc9d9cc5c fix: clear auto model overrides on reset (#69419) (thanks @sk7n4k3d) 2026-04-21 03:36:16 +01:00
Sk7n4k3d
0eb6f5d8bc session: clear auto-sourced model/auth overrides on /new and /reset 2026-04-21 03:36:16 +01:00
Peter Steinberger
215d5fb320 fix: clear auto-failover model overrides (#69365) (thanks @Chevron7Locked) 2026-04-21 03:35:16 +01:00
Kevin O'Neill
dc0e966ed2 fix(model-selection): address Codex review P2 feedback on auto-heal override clearing
Three corrections to the auto-failover self-healing introduced in the prior commit:

1. Reset in-memory provider/model to configured primary after clearing auto override.
   get-reply-directives.ts preloads provider/model from the stored override before
   calling createModelSelectionState, so clearing only session state still ran the
   current turn on the fallback. Now provider/model are reset to defaultProvider/
   defaultModel so this turn retries the primary immediately, not on the next turn.

2. Remove resetModelOverride = true from the auto-heal path. That flag triggers a
   "Model override not allowed for this agent" system event in
   applyInlineDirectiveOverrides, which is incorrect: the override was valid and set
   by the fallback loop — it just expired once the primary recovered. Auto-heal is
   not an allowlist violation.

3. Add a test case that verifies the in-memory reset when the caller pre-loads the
   fallback provider/model (simulating the get-reply-directives.ts preload path).

Known limitation (noted in comment): channel model overrides (channels.modelByChannel)
are skipped on the recovery turn because hasSessionModelOverride was true when they
were evaluated at preload time. They resume on the following turn once session state
is clear. Fixing this cleanly requires changes to the get-reply-directives preload
flow and is out of scope for this PR.
2026-04-21 03:35:16 +01:00
Kevin O'Neill
f2abe28d40 fix(model-selection): clear auto-failover overrides so primary is retried on each turn
When runWithModelFallback falls back to a secondary provider it writes
providerOverride/modelOverride/modelOverrideSource:"auto" to the session.
On subsequent turns createModelSelectionState read this stored override and
passed the fallback provider directly to runWithModelFallback, so the
configured primary was never retried — the session was permanently pinned to
the fallback even after the primary recovered.

Fix: at model-selection ingress, when the direct session override has
modelOverrideSource "auto" (set by a previous automatic fallback, not a user
/model command), clear the override and retry the configured primary. If the
primary is still down runWithModelFallback will fall back and re-set the auto
override for that turn. Once the primary recovers the override stays clear.

User-selected overrides (modelOverrideSource "user" or legacy undefined+model)
are preserved unchanged.

Covered by four new unit tests in model-selection.test.ts:
- auto-failover override cleared and primary retried
- user-selected override preserved
- legacy override without source field preserved
- parent-session auto-override applied to child (not cleared by child logic)
2026-04-21 03:35:16 +01:00
Peter Steinberger
76d72d48f3 fix: normalize minimal ollama provider config (#69370) (thanks @PratikRai0101) 2026-04-21 03:28:17 +01:00
Pratik Rai
8edf705238 chore: satisfy strict linters and patch Windows CI corepack bug 2026-04-21 03:28:17 +01:00
Pratik Rai
2549dfe59b fix(ollama): inject default config fields during normalization to unblock implicit discovery 2026-04-21 03:28:17 +01:00
Peter Steinberger
5c85624eeb Revert "ci: use Blacksmith checkout cache"
This reverts commit 43734b1dbd.
2026-04-21 03:21:48 +01:00
Peter Steinberger
0b9a1e94b7 docs: thank openai codex endpoint contributor (#69336) 2026-04-21 03:21:01 +01:00
Peter Steinberger
cbdd6a4cbb fix: let active memory recall failures degrade (#69485) (thanks @Magicray1217) 2026-04-21 03:20:25 +01:00
Magicray1217
3f90d92667 fix(active-memory): gracefully degrade on timeout instead of failing entire reply. Fixes #66849 2026-04-21 03:20:25 +01:00
methazoo
8a2d7f2541 fix(openai-codex): use /backend-api/codex/ base URL
OpenAI removed the /backend-api/responses alias on chatgpt.com server-side.
The OpenAI SDK appends /responses to the configured baseUrl, so OpenClaw's
current baseUrl ("https://chatgpt.com/backend-api") now resolves to
/backend-api/responses and hits a Cloudflare HTML 403 block page. The
provider's 403+HTML error classifier then surfaces this as an auth-scope
failure, triggering fruitless OAuth re-login loops for every GPT-5.4
sub-agent call.

- Point OPENAI_CODEX_BASE_URL at https://chatgpt.com/backend-api/codex
  (both the catalog constant and the sibling local constant in the provider).
- Extend isOpenAICodexBaseUrl to accept the new /codex segment while keeping
  the legacy path recognized so pre-existing user configs and persisted
  model metadata still round-trip through the normalizer correctly.
- Add positive-case test coverage for the new base URL; update existing
  normalization tests whose expected canonical output now includes /codex.

Verified with live curl using the exact OAuth access token stored by
OpenClaw: the /codex/responses path returns HTTP 200 with streaming SSE,
while the old /responses alias returns HTTP 403 HTML regardless of auth
headers. Scoped tests (base-url, openai-codex-provider, transport-policy,
openai-provider, index) pass; pnpm tsgo and pnpm build are clean.
2026-04-21 03:19:58 +01:00
Peter Steinberger
8150c363b5 fix: stabilize memory dreaming QA 2026-04-21 03:12:42 +01:00
Peter Steinberger
a9bef83a0c refactor: delegate bluebubbles conversation helpers 2026-04-21 03:12:42 +01:00
Peter Steinberger
bd0c9024a2 docs: document Kimi cost live smoke 2026-04-21 03:10:56 +01:00
Peter Steinberger
18269f0b88 fix: classify loopback shared-secret pairing (#69431) (thanks @SARAMALI15792) 2026-04-21 03:10:34 +01:00
SARAMALI15792
fb1a5a2c26 test(gateway): assert cli_container_local precedence over loopback fallback (#69397) 2026-04-21 03:10:34 +01:00
SARAMALI15792
8ef356d5c3 fix(gateway): classify loopback shared-secret clients as local for pairing (#69397) 2026-04-21 03:10:34 +01:00
Peter Steinberger
43734b1dbd ci: use Blacksmith checkout cache 2026-04-21 03:09:13 +01:00
Sliverp
b938e6398b feat: add tiered model pricing support (#67605)
Adds tiered model pricing support for cost tracking, keeps configured pricing ahead of cached catalog values, and includes latest Moonshot Kimi K2.6/K2.5 cost estimates.\n\nThanks @sliverp.
2026-04-21 03:02:57 +01:00
Peter Steinberger
8d747d20b8 test: split contract vitest shards 2026-04-21 03:01:08 +01:00
Peter Steinberger
525e66e513 fix(openai): use tagged GPT-5 prompt contract 2026-04-21 02:45:17 +01:00
Peter Steinberger
c910ddac38 test: add Kimi and Qianfan extension coverage 2026-04-21 02:41:26 +01:00
Peter Steinberger
82b8a4aab6 docs(openai): clarify GPT-5 prompt defaults 2026-04-21 02:36:16 +01:00
Peter Steinberger
ab03d4e037 fix(openai): default GPT-5 prompt overlay 2026-04-21 02:36:16 +01:00
Andrii Furmanets
b6a8759b29 fix(web-search): restore SecretRef runtime compatibility for bundled providers (#68424)
Adds missing compatibility runtime path metadata for bundled SecretRef-capable web-search providers and keeps the manifest registry covered by a regression test.\n\nThanks @afurm!
2026-04-21 02:34:24 +01:00
Peter Steinberger
f04185cc70 test: stabilize live media and gateway probes 2026-04-21 02:10:19 +01:00
Peter Steinberger
5ab26a8774 ci: extend checkout fetch timeout 2026-04-21 02:05:26 +01:00
aniaan
c8e5150fd4 feat(moonshot): default to Kimi K2.6 with K2.6-only thinking.keep support (#68816)
Merged via squash.

Prepared head SHA: ed54e02842
Co-authored-by: aniaan <40813941+aniaan@users.noreply.github.com>
Co-authored-by: odysseus0 <8635094+odysseus0@users.noreply.github.com>
Reviewed-by: @odysseus0
2026-04-20 18:04:49 -07:00
Peter Steinberger
a112903802 test: use synthetic auto reply fixtures 2026-04-21 01:49:30 +01:00
poisk
32e8bca02c fix(telegram): honor removeAckAfterReply for status reactions (#68067)
Thanks @poiskgit.
2026-04-21 01:47:20 +01:00
Peter Steinberger
60a1f01a3e test: use synthetic agent infra fixtures 2026-04-21 01:46:33 +01:00
Peter Steinberger
442da01db4 test: use synthetic program status fixtures 2026-04-21 01:44:03 +01:00
Peter Steinberger
969ca8511d test: use synthetic cli provider fixtures 2026-04-21 01:42:29 +01:00
Peter Steinberger
66665eea6d test: use synthetic status session fixtures 2026-04-21 01:40:29 +01:00
Peter Steinberger
6bb6cfc68e test: use synthetic plugin channel fixtures 2026-04-21 01:32:27 +01:00
Peter Steinberger
97e528ed54 test: use synthetic agent session fixtures 2026-04-21 01:24:34 +01:00
Peter Steinberger
9f2f89320e test: use synthetic infra channel fixtures 2026-04-21 01:21:05 +01:00