Commit Graph

1303 Commits

Author SHA1 Message Date
Peter Steinberger
555f4b6c32 refactor: remove legacy provider compat paths 2026-05-27 18:15:26 +01:00
Peter Steinberger
f5e64d2d5d refactor: remove static model and pi auth paths
Drop static model catalogs and Pi auth bridges, move model/provider facts to manifest-owned runtime contracts, and harden internal embedded-agent utilities.
2026-05-27 18:15:26 +01:00
Peter Steinberger
ea16dc7f37 refactor: tighten agent session runtime
Make agent-core/runtime dependencies explicit, consolidate compaction and session transcript helpers, and move model/session helpers behind OpenClaw-owned contracts.
2026-05-27 18:15:26 +01:00
Peter Steinberger
22bad620fc refactor: remove pi runtime internals
Rename remaining Pi-shaped agent surfaces to OpenClaw agent runtime names, delete obsolete Pi docs and package graph checks, and add the third-party notice for incorporated code.
2026-05-27 18:15:26 +01:00
Peter Steinberger
d84cbfa50e perf(gateway): cache manifest model catalog rows 2026-05-27 18:12:47 +01:00
Peter Steinberger
ca7b6be7cf perf(gateway): cache auto-enabled plugin config 2026-05-27 17:42:34 +01:00
Agustin Rivera
0d0bddf032 fix(gateway): require admin for device role approvals (#87146)
* fix(gateway): require admin for device role approvals

* fix(gateway): add trusted-proxy approval proof
2026-05-27 08:08:51 -07:00
rendrag-git
e153eceea5 fix(vllm): wire configured thinking params
Move vLLM Qwen thinking control onto configured model compat metadata and carry it through catalog/model-selection/runtime thinking contexts.

Also migrate legacy provider/default request params in doctor and keep Pi/runtime model rows buildable with explicit reasoning defaults.

Thanks @rendrag-git.

Co-authored-by: rendrag-git <253747599+rendrag-git@users.noreply.github.com>
2026-05-27 13:32:18 +01:00
Peter Steinberger
517ce3df75 fix: require admin for node device approvals 2026-05-27 13:18:50 +01:00
Peter Steinberger
1507a9701b refactor: centralize inbound supplemental context
* refactor: centralize inbound supplemental context

* refactor: trim supplemental finalizer typing

* docs: clarify supplemental context projection

* refactor: move inbound finalization into core

* refactor: simplify channel inbound facts

* refactor: fold supplemental media into inbound finalizer

* refactor: migrate channel inbound callers to builder

* docs: mark inbound finalizer compat types deprecated

* refactor: wire runtime turn context builder

* refactor: replace channel turn runtime API

* fix: respect discord quote visibility

* fix: avoid deprecated line dispatch helper

* refactor: deprecate channel message SDK seams

* docs: trim channel outbound SDK page

* test: migrate irc inbound assertion

* refactor: deprecate outbound SDK facades

* refactor: deprecate channel helper SDK facades

* refactor: deprecate channel streaming SDK facade

* refactor: move direct dm helpers into inbound SDK

* chore: mark legacy test-utils SDK alias deprecated

* refactor: remove unused allow-from read helper

* refactor: route remaining channel dispatch through core

* refactor: enforce modern extension SDK imports

* test: give slow image root tests more time

* ci: support node fallback on windows

* fix: add transcripts tool display metadata

* refactor: trim legacy channel test seams

* fix: preserve channel compat after rebase

* fix: keep deprecated channel inbound aliases

* fix: preserve discord thread context visibility

* fix: clean final rebase conflicts

* fix: preserve channel message dispatch aliases

* fix: sync channel refactor after rebase

* fix: sync channel refactor after latest main

* fix: dedupe memory-core subagent mock

* test: align clickclack inbound dispatch assertions

* fix: sync plugin sdk api hash after rebase

* fix: sync channel refactor after latest main

* fix: sync plugin sdk api hash after rebase

* fix: sync plugin sdk api hash after latest main

* test: remove stale inbound context awaits
2026-05-27 09:26:06 +01:00
Peter Steinberger
9c2a6a8df5 perf(gateway): borrow session reads on turn hot paths 2026-05-27 07:02:00 +01:00
Pablo Guardiola
0c867eef75 feat: expose plugin approval action metadata
Expose plugin approval action metadata so plugins can describe richer approval actions across gateway, SDK, channel, and UI surfaces.
2026-05-26 22:46:09 -07:00
Andy Tien
8246e91e92 fix(ui): show config open failure feedback (#87108)
Fixes #87020.

Summary:
- Surface config.openFile failures in the Control UI instead of silently doing nothing.
- Return actionable gateway errors for headless opener failures, including the config path.
- Add gateway and UI controller regression coverage for the failed-open path.

Verification:
- node scripts/run-vitest.mjs run --config test/vitest/vitest.gateway-methods.config.ts src/gateway/server-methods/config.test.ts --reporter=dot
- node scripts/run-vitest.mjs run --config test/vitest/vitest.ui.config.ts ui/src/ui/controllers/config.test.ts --reporter=dot
- pnpm check:changed via Blacksmith Testbox tbx_01ksktydqx6mk3n20yevcbkwtn
- autoreview --mode local

Thanks @Linux2010.

Co-authored-by: Linux2010 <35169750+Linux2010@users.noreply.github.com>
2026-05-27 05:45:45 +01:00
Peter Steinberger
8fa4fad3a7 perf(gateway): skip duplicate turn session touch 2026-05-27 05:28:10 +01:00
Peter Steinberger
f393ebe54e fix(gateway): remove redundant unknown union 2026-05-26 23:06:26 -04:00
Chunyue Wang
982e88821c fix(gateway): drop stale subagent announce history
Fix stale `subagent_announce` history hydration after `/new` by filtering pre-session-start announce/user reply pairs before `chat.history` projection.

Maintainer fixups added:
- require the adjacent assistant reply to carry a pre-session timestamp before dropping it
- preserve record timestamps for oversized transcript placeholders
- run the filter after Claude CLI history import and support imported timestamp/text fallback
- overread one local transcript message only as boundary context so limit-window edges do not leak stale assistant replies

Verification:
- `git diff --check`
- `node scripts/run-vitest.mjs src/gateway/server-methods/server-methods.test.ts src/gateway/session-utils.fs.test.ts src/gateway/session-history-state.test.ts src/gateway/cli-session-history.test.ts src/gateway/server.chat.gateway-server-chat-b.test.ts` -> 11 files, 463 tests passed
- `/Users/steipete/Projects/agent-scripts/skills/autoreview/scripts/autoreview --mode branch --base origin/main` -> clean, no accepted/actionable findings

Thanks @openperf.
2026-05-27 03:59:08 +01:00
Val Alexander
b4f69286fd fix(gateway): stop chat timeout fallback cascade
Fix gateway/chat timeout abort propagation so timed-out runs do not cascade through fallbacks. Preserve provider timeout errors when the gateway abort signal did not fire, and keep timeout stop reasons in async gateway agent results. Includes regression coverage for chat, follow-up, memory flush, fallback classification, and gateway agent timeout results. Fixes #83962.
2026-05-27 03:54:44 +01:00
Shakker
223655dfc4 fix: preserve provenance through user turn hooks 2026-05-27 02:38:58 +01:00
Shakker
2e8f1d439d fix: preserve user turn provenance metadata 2026-05-27 02:38:58 +01:00
Shakker
fafed256a6 fix: isolate chat transcript fallback failures 2026-05-27 02:38:58 +01:00
Shakker
9263e3887e fix: preserve inline image routing with staged media 2026-05-27 02:38:58 +01:00
Shakker
c86214345f fix: keep user turn enrichment off dispatch 2026-05-27 02:38:58 +01:00
Shakker
696fb41c5b fix: restore user turn persistence checks 2026-05-27 02:38:58 +01:00
Shakker
20d7bf7525 refactor: remove duplicate user turn handoff 2026-05-27 02:38:58 +01:00
Shakker
fe44ecd8f0 refactor: trim duplicated transcript tests 2026-05-27 02:38:58 +01:00
Shakker
d3465756f6 refactor: remove reply option user persistence callbacks 2026-05-27 02:38:58 +01:00
Shakker
e9d0ac2aba refactor: pass user turn recorder through reply options 2026-05-27 02:38:58 +01:00
Shakker
8a1b7710d7 refactor: add user turn transcript recorder 2026-05-27 02:38:58 +01:00
Shakker
662e5b67d5 fix: persist user turns after runtime mirror failures 2026-05-27 02:38:58 +01:00
Shakker
8caed9d66d fix: honor transcript hooks in user turn fallbacks 2026-05-27 02:38:58 +01:00
Shakker
b1b533c627 fix: prepare text chat send user turns 2026-05-27 02:38:58 +01:00
Shakker
a9e51732db fix: keep chat send transcript text clean 2026-05-27 02:38:58 +01:00
Shakker
7d3eabdee8 fix: harden chat send transcript fallback 2026-05-27 02:38:58 +01:00
Shakker
10f4096f11 fix: persist chat send user turns after hooked startup failures 2026-05-27 02:38:58 +01:00
Shakker
0f5ce05753 fix: dedupe user turn transcript appends 2026-05-27 02:38:58 +01:00
Shakker
8ad308d3e9 fix: keep pre-start chat send fallback persistence 2026-05-27 02:38:58 +01:00
Shakker
1c35ec6cd7 fix: preserve chat send user turns on started failures 2026-05-27 02:38:58 +01:00
Shakker
ce5adbd2c2 fix: keep gateway fallback tied to user persistence 2026-05-27 02:38:58 +01:00
Shakker
38b0984d33 refactor: centralize inline user turn persistence 2026-05-27 02:38:58 +01:00
Shakker
982c0aaa77 refactor: route chat send user transcripts through sessions 2026-05-27 02:38:58 +01:00
Shakker
91aee9cd51 fix: keep media transcript text clean 2026-05-27 02:38:58 +01:00
Shakker
928a75a365 refactor: route chat send media through user turn input 2026-05-27 02:38:58 +01:00
Shakker
5c69853cd6 refactor: use shared user turn message for chat send updates 2026-05-27 02:38:58 +01:00
Frederic David blum
1e1cf14da2 fix(gateway): reject RPCs from invalidated device-token clients durin… (#70707)
* fix(gateway): reject RPCs from invalidated device-token clients during rotation/revoke race

device.token.rotate, device.token.revoke and device.pair.remove all
respond 200 OK to the admin, then schedule disconnectClientsForDevice
via queueMicrotask so the response can flush before the socket close.
That microtask window plus the absence of a per-RPC re-check for
device-token auth (unlike shared-auth, which gets checked at
message-handler.ts:1444-1458) created a race: an attacker with RPCs
already pipelined in the WS socket buffer could land a few more
authenticated operations with the rotated/revoked token before the
socket actually closed.

Fix: add a cheap in-memory 'invalidated' flag on GatewayWsClient and
mark it synchronously *before* responding in the three handlers. Add
a mirror check at the start of the per-RPC dispatch that force-closes
the client if the flag is set, regardless of whether socket.close()
has taken effect yet. Disconnect still happens via queueMicrotask so
the admin's rotate/revoke response flushes normally.

Introduces context.invalidateClientsForDevice(deviceId, opts) as a
sync companion to the existing disconnectClientsForDevice. Also
defense-in-depth: disconnectClientsForDevice now sets the flag too,
so any other caller of the hard-disconnect path gets the per-RPC
gate for free.

* test(gateway): use vi.mocked instead of direct Mock casts in devices tests

check-test-types failed on the PR because direct 'as ReturnType<typeof vi.fn>' casts from RespondFn (or the optional context methods) don't structurally overlap with the Mock type — Mock has mockImplementation/mockReturnValue that RespondFn lacks, so strict tsgo rejects the conversion. vi.mocked() is the intended helper for reinterpreting an already-mocked function, and drops through to the Mock surface cleanly.

* test(gateway): align tests with upstream type/shape changes after rebase

After rebasing onto upstream main, two test surfaces drifted:

1. GatewayRequestContextParams gained two required fields upstream
   (getRuntimeConfig, broadcastVoiceWakeRoutingChanged). The
   makeContextParams test helper was missing them, so every consumer
   tripped tsgo with a missing-field error. Add both as vi.fn()
   stubs.

2. revokeDeviceToken's return shape changed upstream from a bare
   entry record to a discriminated union {ok: true, entry: ...} | {ok:
   false, reason}. The new device.token.revoke synchronous-invalidate
   test still mocked the old shape, so the production handler took the
   !revoked.ok branch and never reached the invalidateClientsForDevice
   call the test asserted. Update the mock to the new union shape.

Also fix three new Set([...] as never) sites in server-request-
context.test.ts that produced Set<unknown> rather than Set<never>.
Move the cast outside the Set constructor so the literal stays
inferred while the wrapper is type-erased to never, which is
assignable to the Partial<GatewayRequestContextParams> clients field.

* fix(gateway): export GatewayRequestContextParams for test access

* fix(ci): resolve check-test-types and lint failures from PR #70707 branch

- server-request-context.test.ts: hasConnectedMobileNode → hasConnectedTalkNode
  (field renamed in server-request-context.ts but test fixture not updated)
- status.summary.redaction.test.ts: add configuredModel/selectedModel/
  modelSelectionReason to createRecentSessionRow fixture
  (SessionStatus gained these fields in a13468320c; test was not updated)
- video-generation-providers.live.test.ts: replace empty {} fallbacks in
  conditional spreads with undefined (oxlint 1.65.0, 5 occurrences)
- music-generation-providers.live.test.ts: same fix for 4 occurrences

Remaining CI failures (FsSafeError/Python helper, media tests, Windows ACL,
session-memory hooks) are pre-existing infra failures unrelated to this PR.

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

* fix(ci): add missing GatewayRequestContextParams fields to test fixture

chatDeltaLastBroadcastText, agentDeltaSentAt, and bufferedAgentEvents are
required fields in GatewayRequestContextParams but were absent from the
makeContextParams fixture, causing TS2322 in check-test-types.

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

* fix(gateway): serialize credential invalidating RPCs

---------

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-05-26 23:09:56 +01:00
Thesaranshn8n
6729dea36f fix(codex): share native hook relay registry (#73950)
Co-authored-by: Sar Jeeves <sar-jeeves@example.com>
Co-authored-by: Kaspre <kaspre@gmail.com>
Co-authored-by: Dallin Romney <dallinromney@gmail.com>
2026-05-26 15:02:03 -07:00
Keshav's Bot
699c047c7d fix(reply): reduce visible reply delivery latency 2026-05-26 20:51:00 +01:00
Peter Steinberger
3548cff14b refactor: migrate validators to TypeBox (#86639)
* refactor: migrate validators to typebox

* fix: preserve json schema resource refs

* chore: clean schema preflight recursion

* refactor: remove lobster ajv shim

* fix: support schema array refs

* fix: validate schema dependencies

* fix: preserve schema contract checks

* fix: support same-document schema refs

* fix: preserve untyped map defaults

* fix: preserve schema default semantics

* test: avoid thenable schema literals

* test: build conditional schema key

* fix: defer resource id refs to typebox

* fix: reject invalid schema enum metadata

* fix: preserve default branch semantics

* fix: resolve schema resource refs

* fix: narrow conditional default fallback

* fix: preserve uri format validation

* fix: preserve validator compatibility

* test: avoid ajv cache lint violation

* fix: preserve typebox validation diagnostics

* fix: validate defaulted conditional schemas

* fix: normalize mcp draft schemas

* fix: preserve tuple schema defaults

* fix: resolve relative schema refs

* fix: scope typebox format semantics

* fix: align conditional format defaults

* fix: decode schema pointer refs

* fix: filter grouped secretref diagnostics

* fix: preserve default conditional compatibility

* fix: preserve nullable schema compatibility

* fix: settle defaults before conditionals

* fix: preserve default validation invariants

* fix: validate dynamic schema refs

* fix: reject malformed nullable schemas
2026-05-26 08:45:28 +01:00
Peter Steinberger
c59635ae97 fix: avoid compaction checkpoint transcript copies (#86666) 2026-05-26 00:59:20 +01:00
Peter Steinberger
65a210553b test: type child process spawn mock 2026-05-26 00:11:40 +01:00
Peter Steinberger
c1a026a976 fix: stabilize tests and reduce plugin memory churn 2026-05-26 00:01:30 +01:00