Commit Graph

35767 Commits

Author SHA1 Message Date
Vincent Koc
420a0e6fce fix(doctor): ignore unknown profile preview grants 2026-06-23 02:24:29 +08:00
Vincent Koc
96c6f8022c fix(auto-reply): suppress quoted silent replies 2026-06-23 02:24:29 +08:00
Peter Steinberger
03ba09bfa8 fix(doctor): accept missing profile policies 2026-06-22 14:20:09 -04:00
Vincent Koc
24fc2e9a88 refactor(doctor): reuse TTS plugin location matcher 2026-06-23 02:13:31 +08:00
Vincent Koc
a1181023ba refactor(plugins): share provider catalog filter 2026-06-23 02:10:20 +08:00
NIO
be43c55398 fix(control-ui): rewrite manifest hrefs for configured base path (#94204)
Serve Control UI index.html with base-path-prefixed public asset links so
browsers do not prefetch /manifest.webmanifest at the host root behind
reverse proxies.

Fixes #94157
2026-06-22 18:09:25 +00:00
Amer Sheeny
b8434386b8 fix(acp): recover stale persistent sessions by structured resume-required code (#93547)
Persistent ACP threads died on the second turn for Kiro: when the backend
can no longer resume a stale session, acpx raises a SessionResumeRequiredError
whose reason text varies by backend ("Resource not found" for Claude,
"Internal error" / RequestError -32603 for Kiro). The recovery gate matched
the human reason text and required "resource not found", so Kiro's "Internal
error" never triggered the fresh-session retry and the thread produced no
reply (ACP_TURN_FAILED).

Recover by acpx's structured detail code instead of the reason text: acpx
tags every such failure with detailCode "SESSION_RESUME_REQUIRED"
(retryable), independent of wording. The two AcpRuntimeError construction
seams were discarding detailCode, so preserve it on AcpRuntimeError and match
it across the error and its cause chain. This fixes every backend's
resume-required failure and is more precise than the reason regex — a generic
"Internal error" without the code is still surfaced rather than silently
retried.

Fixes #87830. Reported by @chouzz.
2026-06-22 18:08:56 +00:00
zhouhe-xydt
7c8ca26364 fix(setup): point non-interactive health hints at onboard flags (#93994)
The recovery hint printed by setup --non-interactive referenced --install-daemon
and --skip-health, which are only registered on openclaw onboard. Update the
message to reference openclaw onboard --install-daemon and
openclaw onboard --skip-health.

Fixes #93947
2026-06-22 18:07:13 +00:00
Vincent Koc
8f2882f94a refactor(tools): consolidate provider policy resolution 2026-06-23 02:00:04 +08:00
Vincent Koc
25090056dc refactor(gateway): remove unused device auth normalizer 2026-06-23 01:50:57 +08:00
JC
e90fb67641 fix(agents): recover message-tool mirror replay poison (#84708)
* fix(agents): recover message-tool mirror replay poison

Rebase-style refresh onto current upstream main.

* fix(auto-reply): narrow conversation-state 400 classification
2026-06-22 17:49:57 +00:00
Amer Sheeny
9fbc8a74ef fix(llm): collapse cumulative openai-responses message snapshots instead of concatenating [AI-assisted] (#92399)
* fix(llm): collapse cumulative openai-responses message snapshots instead of concatenating

Some openai-responses providers (observed: Bedrock Mantle with GPT-5.x
reasoning enabled, confirmed server-side via raw curl) re-emit the
assistant message as many cumulative snapshot items — each a
prefix-superset of the previous one — instead of a single final message
item. Both stream consumers appended one text block per item, so the
final visible reply, transcript, and replay context repeated the answer
once per snapshot (observed 49-80x).

Treat a same-phase message item whose text extends the immediately
preceding text block as a replacement: the prior block takes the longer
text, the duplicate block is dropped, and the first item's signature is
kept so replay and stream-item identity stay stable. Shrinking or
identical adjacent snapshots are dropped. Any non-message output item
(reasoning, tool call) is a real boundary that resets the collapse, so
distinct post-tool messages and reasoning replay pairing are untouched,
as are different-phase (commentary/final_answer) items. Applies to the
agent transport stream, the shared LLM consumer, and completed-response
backfill.

Fixes #91959. Reported by @phoenixyy with server-side evidence from
@DaiMingNJ.

* test(llm): drop redundant stream drains from responses snapshot tests

* fix(llm): collapse only strict snapshot extensions and keep newest item signature

Address ClawSweeper P1 review findings on #92399: text-prefix relation
alone was broader than the observed corruption. Equal or shrinking
adjacent same-phase message items are now always kept as distinct blocks
(the Responses protocol allows multiple message items per response —
verified against the sibling Codex parser, codex-rs/codex-api/src/sse/
responses.rs, which emits every output_item.done message as an
independent item). With extension-only collapse a false positive can
only merge rendering of two messages; it can never remove text.

The merged block now carries the newest item's signature instead of the
first one's, so replay associates the final content with the item that
actually produced it.

* fix(llm): defer snapshot-candidate message blocks to keep the event lifecycle balanced

Address the remaining ClawSweeper P1 on #92399: collapsing a snapshot
used to pop a block whose text_start had already been emitted, leaving
per-index stream subscribers tracking a phantom block.

A message item that follows a finalized text block now defers its public
block: no text_start is emitted and deltas are withheld until the item
either diverges from the prior text (then the block opens and the
withheld prefix replays as one delta) or completes. A collapsed snapshot
therefore never starts a block — it only re-ends the prior index with
grown content, the documented resend shape — and a distinct deferred
item opens and closes its own block normally. No block is ever removed,
so every text_start has exactly one matching text_end at a live index.

Tests now assert the complete ordered event sequence for the collapse,
distinct-item, and divergence cases in both consumers.

* fix(llm): treat any non-message item as a collapse boundary in completed-response backfill

The streaming consumer resets the snapshot-collapse anchor on every
non-message output item ("any other item is a real boundary"), but the
transport's completed-response backfill only dispatched message and
function_call items, so a reasoning item between two strict-prefix
message items did not reset the anchor and the later message could
collapse across it — an asymmetry with the streaming path's documented
invariant. Reset lastTextBlock for every non-message item in the backfill
loop (one canonical place; the per-tool-call reset is now redundant and
removed). Covered by a backfill reasoning-boundary regression test.
2026-06-22 17:49:19 +00:00
Goutam Adwant
734f2aa009 fix(model-fallback): coalesce auth decision logs (#94233) 2026-06-22 17:49:06 +00:00
Evgeni Obuchowski
50e7a546a1 fix(plugins): cache plugin setup registry to fix the /models stall regression shipped since v2026.5.28 (#93356)
Since #85341 the per-model visibility probes behind the chat /models command
(isCliRuntimeProvider({ includeSetupRegistry: true }) in commands-models.ts)
rebuild the plugin setup registry on every call: a synchronous ~65ms manifest
re-scan plus plugin setup module re-execution, issued hundreds of times per
listing. On the stock bundled plugin set this pins a CPU core for ~49s per
workflow step (list -> pick provider -> pick model), in every chat channel.

Cache the manifest scan and the resolved registry in bounded PluginLruCaches
keyed by the control-plane fingerprint, discovery-env fingerprint, metadata
snapshot identity, cwd, and pluginIds scope, with clone-on-store/clone-on-hit
isolation; invalidation rides the existing plugin-metadata lifecycle clear.
Output is identical; the /models data build drops from ~49s to ~150ms and the
per-model probe from ~65ms to ~0.2ms.
2026-06-22 17:48:47 +00:00
Vincent Koc
31941f3e92 refactor(cron): remove unused sync store alias 2026-06-23 01:44:04 +08:00
Vincent Koc
305a44388b refactor(auth): centralize OAuth identity matching 2026-06-23 01:40:54 +08:00
Vincent Koc
65adb13581 refactor(doctor): dedupe configured tool grant filtering 2026-06-23 01:35:18 +08:00
David
3ff0c29f9d fix: handle terminal chat send acknowledgements (#91049)
* test: cover terminal chat send acknowledgements

* test: cover Swift terminal chat send acknowledgement

* fix: handle terminal chat send acknowledgements

* fix: align terminal ack web lifecycle options

* test: fix Android terminal ack style

* fix: tidy Android terminal ack helpers

* fix: clear mic pending run after terminal ack

* fix: handle terminal talk mode chat send acks

* fix: handle terminal tui chat send acks

* fix: handle terminal acp chat send acks

* test: add Swift chat message text helper

* test: cover steer terminal chat send acknowledgements

* fix: handle terminal steer chat send acks

* test: cover terminal realtime consult send acks

* fix: reject terminal realtime consult send acks

* test: cover Swift terminal ok chat send ack

* fix: clear Swift pending run on terminal ok ack

* test: cover terminal ack helper callers

* fix: preserve terminal ack helper semantics

* fix: narrow terminal ack type guard

* test: cover mic terminal ack statuses

* fix: preserve mic terminal ack status

* fix: keep mic ack contract internal

* test: fix mic ack import order

* test: cover acp terminal ok ack

* test: narrow acp ok ack assertion

* test: cover redirect terminal acknowledgements

* fix: handle redirect terminal acknowledgements

* fix: settle terminal ack reconnect prompts

* fix: surface Android terminal ack timeouts

* fix(tui): handle detached terminal chat acknowledgements

* fix(tui): report terminal timeout send failures

* fix: satisfy iOS talk-mode SwiftFormat

* fix: keep iOS talk logs compile-safe
2026-06-22 17:27:54 +00:00
Vincent Koc
daa382611f refactor(doctor): dedupe legacy TTS location scans 2026-06-23 01:27:35 +08:00
thomas.szbay
9bf681d663 feat(channels): add directUserId support for per-DM model override (#95120)
Add optional directUserId field to ChannelModelOverrideParams so the
shared channels.modelByChannel resolver can match DM-specific config
entries. Callers pass sessionEntry.origin?.nativeDirectUserId.

Closes #53638

Co-authored-by: Thomas Zhengtao <thomas.zhengtao@gmail.com>
2026-06-22 17:26:01 +00:00
Vincent Koc
feb3694243 refactor(agents): dedupe prompt boundary construction 2026-06-23 01:23:26 +08:00
Yuval Dinodia
c854e4e93f fix(cron): stop add/remove from dropping a due recurring job's pending run (#94323)
cron.add recomputed every job's next-run time via recomputeNextRuns after
appending the new job. recomputeNextRuns advances nextRunAtMs whenever
now >= nextRun, so an unrelated add advanced any sibling recurring job whose
slot was due but had not yet fired, discarding that occurrence with no error
and no log. lastRunAtMs stayed unchanged while nextRunAtMs jumped one interval
forward, so the run was silently lost.

Switch add and remove onto recomputeNextRunsForMaintenance plus
ensureLoaded(state, { skipRecompute: true }), matching every other ops.ts
caller (read ops, update, finalize, reload, startup). Maintenance recompute
backfills missing next-run times but never advances a present past-due slot,
preserving the invariant introduced for the timer/read/startup paths in
#13992 / #16156 / #17852.

Adds a regression test that fails on main (the due slot advances a full
interval) and passes with the fix.
2026-06-22 17:22:06 +00:00
xydt-tanshanshan
a9d40b64bc [AI] fix(main-session): skip current-gen abort controllers for completed sessions (#95472)
A completed session (status: done/success) whose abort controller expires
during maintenance was incorrectly matched by markRestartAbortedMainSessions.
The matched activeRun's lifecycleGeneration matched the current generation
(no restart occurred), but entry.updatedAt < run.observedAt allowed the
entry to be marked as running+aborted, triggering a false restart recovery.

Fix: require that the timing condition (updatedAt < observedAt) only applies
for stale-generation runs (provenance: pre-restart). Current-generation runs
with observedAt after the session's updatedAt are maintenance-expired abort
controllers and must not reopen completed sessions.

Related to #95443
2026-06-22 17:20:34 +00:00
imadalin
e0d7c4c548 fix(logging): use run progress age for embedded recovery (#94701) 2026-06-22 17:20:24 +00:00
pick-cat
1f89d6d7f7 fix(agents): clean Gemini tool schemas by model id (#91559) 2026-06-22 17:19:55 +00:00
litang9
17aa9d9967 fix(reply): preserve usage footer across rollover (#95322)
* feat(reply): persist session preferences

* fix(reply): clear stale persisted preference markers

* fix(reply): preserve usage footer across rollover
2026-06-22 17:19:16 +00:00
Vincent Koc
92b283da84 refactor(process): remove unused orphan reconciliation API 2026-06-23 01:13:13 +08:00
Vincent Koc
9616035a91 refactor(skills): dedupe remote probe failure context 2026-06-23 01:10:00 +08:00
Vincent Koc
a9c7397cde refactor(process): remove unused supervisor registry methods 2026-06-23 01:07:40 +08:00
wood fish
cb84041cab fix(ui): render persisted history text blocks (#93841)
Merged via squash.

Prepared head SHA: bfe4f67ccf
Co-authored-by: mushuiyu886 <266724580+mushuiyu886@users.noreply.github.com>
Co-authored-by: steipete <58493+steipete@users.noreply.github.com>
Reviewed-by: @steipete
2026-06-22 10:07:09 -07:00
xiaobao-k8s
5d892e484d fix(agents): restore model-fetch info logs (#89648)
* fix(agents): restore model-fetch info logs

* docs(logging): document [model-fetch] default info-level visibility

[model-fetch] response metadata is always emitted at info level
regardless of OPENCLAW_DEBUG_MODEL_TRANSPORT, so users see basic
model transport hygiene (provider, API, model, status, latency)
without needing debug flags.

* docs(logging): clarify model-fetch start metadata visibility
2026-06-22 17:02:16 +00:00
Vincent Koc
8c8eb86fff fix(llm): preserve browser-safe provider imports 2026-06-23 00:59:33 +08:00
Vincent Koc
5636c6044b refactor(runtime): share error normalization helper 2026-06-23 00:59:33 +08:00
Andy Ye
0a9b1526ac fix(provider-usage): honor proxy env for usage fetch (#93943)
* fix(provider-usage): honor proxy env for usage fetch

* refactor(mcp): remove unused Claude permission type
2026-06-22 16:56:07 +00:00
snowzlmbot
604d607311 fix(onboard): refresh provider plugin registry after setup installs (#95792)
Merged via squash.

Prepared head SHA: c99d09f762
Co-authored-by: snowzlmbot <293528334+snowzlmbot@users.noreply.github.com>
Co-authored-by: steipete <58493+steipete@users.noreply.github.com>
Reviewed-by: @steipete
2026-06-22 09:55:08 -07:00
Peter Steinberger
303e7781c1 fix(plugin-sdk): bound live model catalog success body (#95827)
Merged via squash.

Prepared head SHA: 870ef762c9
Co-authored-by: steipete <58493+steipete@users.noreply.github.com>
Reviewed-by: @steipete
2026-06-22 09:54:37 -07:00
Sahibzada
de60f42767 fix(sessions): clarify cross-agent visibility guidance (#90489)
* fix(sessions): clarify cross-agent visibility guidance

* fix(sessions): clarify optional agent allow policy

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-06-22 16:45:01 +00:00
Vincent Koc
c6aa355b5c refactor(core): share error normalization helper 2026-06-23 00:43:50 +08:00
Vincent Koc
f00f42abf7 refactor(process): share error normalization helper 2026-06-23 00:40:45 +08:00
Vincent Koc
af7797b0ad refactor(media): share error normalization helper 2026-06-23 00:38:07 +08:00
Vincent Koc
80805ad7a5 refactor(agents): share error normalization helpers 2026-06-23 00:36:31 +08:00
Vincent Koc
7f6a93eb8e refactor(agents): share embedded runner error normalization 2026-06-23 00:29:48 +08:00
Vincent Koc
aa79ab1403 refactor(outbound): reuse channel action context builder 2026-06-23 00:25:53 +08:00
Vincent Koc
a87aed4108 refactor(agents): reuse shared error normalization 2026-06-23 00:23:13 +08:00
Hannes Rudolph
69c4d1aa85 Revert "feat(discord): add server management helper actions"
This reverts commit ae22f485ec.
2026-06-22 10:20:19 -06:00
Vincent Koc
7c90351ff3 refactor(gateway): share MCP bearer token classification 2026-06-23 00:20:11 +08:00
zerone0x
3a7cdaf32c fix: include persisted plugin contracts for migrations (#89612) 2026-06-22 16:18:48 +00:00
Hannes Rudolph
ae22f485ec feat(discord): add server management helper actions 2026-06-22 10:18:28 -06:00
Vincent Koc
dab145ef76 refactor(infra): share Windows port inspection 2026-06-23 00:16:38 +08:00
Vincent Koc
336494c863 refactor(agents): share session tool output rendering 2026-06-23 00:14:44 +08:00