Commit Graph

168 Commits

Author SHA1 Message Date
Peter Steinberger c70aee247e refactor(scripts): migrate JavaScript tools to TypeScript (#121005)
* refactor(scripts): migrate JavaScript tools to TypeScript

* fix(ci): keep changed-scope preflight zero-install

* fix(ci): preserve zero-install script owners

* fix(ci): complete script migration follow-through

* fix(release): keep stable closeout zero-install

* fix(scripts): preserve standalone execution boundaries

* fix(scripts): repair standalone loader boundaries

* fix(scripts): normalize gateway observation ids

* fix(scripts): keep Docker packager standalone

* test(scripts): preserve rebase cleanup helpers

* test(sessions): use tracked temp directory
2026-08-09 07:21:35 -07:00
Vincent Koc c8a99f7aab test(gateway): cover rolling node compatibility (#119991)
Punchcard-Session: calm-lantern-timber-wa
2026-08-09 18:45:08 +08:00
Peter Steinberger 73bdb4b924 feat(agents): record run-end worktree cleanup outcome; prove Workboard dirty retention (#120434)
* feat(agents): record run-end worktree cleanup outcome

Persist removed, retained, and failed run-end cleanup outcomes on managed worktree records. Operators and QA can inspect the durable fact through worktrees.list and openclaw worktrees list --json.

Release note: Managed worktree run-end cleanup now records why a checkout was removed or retained in worktree list JSON.

* test(qa): prove dirty worktree retention outcome

* chore(protocol): regenerate swift gateway models

* fix(agents): harden worktree cleanup recovery

Register run_end_cleanup_json as a lazy compatible column so same-version v6 index repair and read-only doctor migration can recover databases created before the column existed.

Type removal contention at the registry boundary; unexpected claim failures now best-effort record a bounded failed outcome and rethrow the original error.

* fix(ci): clear repo-wide lint debt blocking merge gates

The red-main landing rule requires this PR to repair repository-wide merge-gate debt instead of bypassing it. Apply the current lint contracts mechanically and split turn-transition coverage into a concept-named sibling with per-file-safe test state.

Exact line delta: +676/-574 (net +102) across 44 test/support files.

* fix(ci): preserve cached health refresh proof

Require the public refresh call to exist before accepting that sensitive fields were omitted, so the boundary proof cannot pass on a missing call.

* fix(ci): correct test typing left by the lint sweep

Literal-widened totalTokensVersion fixtures, a WebSocket RawData overload
mismatch, and the protocol schema document cast broke check-test-types
after the repo-wide lint repair. Aligns the fixtures with SessionEntry,
narrows Buffer handling per RawData, and keeps the JSON-shaped undefined
omission under structuredClone.

* test(agents): reuse upstream resource-loader test support

The session-loop split and #120463's helper extraction landed the same
createResourceLoader/createCompactionHandlers twice; the rebase kept both,
orphaning main's agent-session-loop-resource-loader.test-support.ts and
failing the dead-code gate. Import the upstream helpers and delete the
duplicates.

* fix(agents): reject finalized rows at the worktree removal claim

Address the accepted ClawSweeper late-claim finding by rereading and rejecting missing or finalized worktree rows inside the synchronous removal-claim transaction.

Preserve the authoritative cleanup invariant: finalized contenders record nothing, while retained-busy is written only while the row remains live.

* refactor(agents): reuse registry update for busy outcomes

Keep the live-row conditional write in the canonical registry update path so the finalized-claim repair stays below the registry max-lines ratchet without weakening the authoritative-outcome invariant.

* test(agents): drop session test duplicates after rebase

Keep current main as the canonical owner of next-turn lifecycle coverage and correctness test support after replaying the older lint-debt split.

* fix(agents): guard post-abort cleanup outcomes against finalization

After abortWorktreeRemoval releases a stale remover's claim, its retained or
failed write raced a finalizing remover and could overwrite the authoritative
removed-lossless fact. Route every retained/failed write through the live-row
condition; only the finalizing remover's own removed-lossless write stays
unconditional.

* fix(agents): persist the removal outcome atomically with finalization

A delayed removed-lossless write after remove() finalized could race a
restore plus newer cleanup and overwrite the newer operator-visible fact.
The run-end outcome now rides remove()'s finalization update; every other
cleanup write stays live-row conditional, so no post-finalize write path
remains.

* test(qa): restore strict cached-health contract assertions

The lint sweep's Boolean() coercions let truthy non-booleans satisfy the
wire-typed cached-meta contract. Assert the literal boolean for unknown-typed
fields and use nullish-coalesced strict equivalents for boolean chains.

* fix(agents): clear the stale cleanup outcome when restoring a worktree

A restored checkout begins a new lifecycle; leaving the removed-lossless
fact on the live row showed operators a stale result until the next
cleanup. Restore clears the recorded outcome and the regression asserts
the cleared state before the next cleanup records fresh truth.

* fix(agents): scope stale cleanup outcomes to their observed lifecycle

A stale remover's retained/failed write raced a concurrent remove-plus-
restore: the revived row is live again, so the live-row condition alone
could stamp a prior-lifecycle outcome. Condition those writes on the
activity stamp the remover observed; restore bumps lastActiveAt, making
any prior-lifecycle write a no-op.

* fix(agents): advance the restore activity stamp within one millisecond

Stale cleanup writes fence on the activity stamp they observed; a restore
completing in the same millisecond could revive the row with an identical
stamp and let the fence match. Restore now always advances past the
stored value, and the ABA regression pins the clock to prove the
same-millisecond case.
2026-08-08 20:32:11 -07:00
licheer-zte a32e81c8e8 fix(model-fallback): treat empty non-GPT completions as failed candidates (#120132) (#120148)
* fix(model-fallback): treat empty non-GPT completions as failed candidates (#120132)

Empty and whitespace-only completions from non-GPT models were counted as
candidate_succeeded, silently dropping the turn on visible channels. Apply
the empty/reasoning-only classification to every model; deliberate silent
replies and committed outbound deliveries remain successful.

* fix(model-fallback): classify mixed reasoning-plus-blank completions as failed (#120148)

A completion like [{ isReasoning: true, text: "thinking" }, { text: " " }]
carries no user-visible reply: reasoning text is invisible to the shared
visibility test (includeReasoningPayloads: false), so counting it as visible
made the run look successful and silently ended visible-channel turns.

Filter reasoning payloads out of the empty/whitespace predicate so mixed
reasoning-plus-blank results classify as empty_result (fallback-worthy),
while mixed reasoning-plus-visible-text results stay successful.

Regression tests: mixed reasoning+blank -> empty_result; mixed
reasoning+visible -> success.

* fix(model-fallback): require deliverable assistant results

Use one owner-boundary deliverability predicate for fallback classification, preserve intentional terminal outcomes, and add a mock-channel Gateway scenario for mixed reasoning-plus-blank recovery.\n\nCo-authored-by: 李琪0668001400 <li.qi16@xydigit.com>

* chore: preserve contributor credit

Co-authored-by: 李琪0668001400 <li.qi16@xydigit.com>

* test(qa): cover default model fallback scenario

Make the mixed reasoning-plus-blank fixture recover through both the catalog default alternate and the explicit proof model.

Co-authored-by: 李琪0668001400 <li.qi16@xydigit.com>

---------

Co-authored-by: licheer-zte <licheer-zte@users.noreply.github.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-08-08 07:48:17 -07:00
Peter Steinberger 6a6cd7859f test(qa): cover session and Workboard managed-worktree lifecycles; fix symlinked state-dir lock blindness (#120362)
* fix(agents): canonicalize managed worktree paths

* test(qa): cover managed worktree owner lifecycles

* test(agents): split worktree canonical-path regression into focused file

* fix(doctor): canonicalize persisted managed-worktree paths for symlinked state dirs

* fix(doctor): keep worktree path migration detection read-only

* test(doctor): bound managed-worktree migration product proof

* fix(doctor): keep worktree path detection from creating state dirs

* test(doctor): allow state migration detection under CI load

* test(agents): split embedded-runner steering runs into focused file

Unblocks the check-lint gate broken by #120285's max-lines overflow.
2026-08-07 18:57:36 -07:00
Peter Steinberger 45b1dbf962 test(qa): add managed-worktrees CLI lifecycle scenario coverage (#120335)
* test(qa): add managed-worktrees CLI lifecycle scenario coverage

Managed worktrees had zero QA scenario-pack coverage despite being a
headline feature. Mint agent-runtime.managed-worktrees-lifecycle in the
taxonomy, add a runtime scenario, and prove the real child CLI through
create with .worktreeinclude provisioning and the .openclaw setup hook,
dirty removal pinning a snapshot ref, restore rebuilding tracked,
untracked, and provisioned files with their modes, and gc preserving
manual worktrees.

* fix(qa): align model-switch catalog assertion with expectedAlternate flow

qa/scenarios/models/model-switch-follow-up.yaml switched to
expectedAlternate.model in 5a795f4dda but the catalog test still greps
for the retired alternate?.model literal; the test is outside the PR
change-classification lanes, so the break only surfaces on direct runs.

* test(qa): narrow managed-worktrees taxonomy description to proven manual-owner gc

ClawSweeper P2 on #120335: the scenario proves manual-owner gc retention
only; session and Workboard cleanup lifecycles are not exercised, so the
coverage description must not claim them.
2026-08-07 14:18:12 -07:00
Dallin Romney b5369f8e5d fix(qa): replace false Codex pin compatibility evidence (#118012)
* test(qa): replace synthetic Codex pin evidence

* test(qa): update core runtime-pair count

* test(qa): cover official Codex plugin drift

* test(qa): preserve frozen candidate scenario ids
2026-08-07 08:45:26 +08:00
Onur Solmaz 1f10ef8050 fix(agents): recover once from critical tool loops (#118647)
* feat(agents): add bounded tool-loop recovery

* feat(agents): wire loop detection into batch recovery

* test(agents): cover bounded tool-loop recovery

* fix(agents): enforce loop thresholds within tool batches

* fix(agents): retain rejected loop batch evidence

* test(agents): update embedded session recovery fixture

* fix(agents): surface terminal loop recovery failures

* fix(agents): preserve loop recovery across retries

* fix(agents): isolate rejected loop evidence

* fix(agents): terminate native critical tool loops

* fix(agents): canonicalize tool loop actions

* fix(agents): preserve tool loop recovery guidance

* fix(agents): preserve code mode tool identity

* fix(agents): preserve prebatch loop evidence

* fix(agents): order native loop termination

* fix(agents): clean up rebased tool validation

* fix(agents): interrupt codex side turns on critical tool loops

* fix(agents): tighten loop recovery batch lifecycle

* fix(agents): drop unconsumed loop detector type export

* fix(agents): drop unconsumed loop relay exports

* test(agents): add agent subscribe to embedded session doubles

* fix(agents): scope critical loop recovery to embedded runs
2026-08-06 14:09:10 +08:00
Vincent Koc ae54355087 fix(qa): preserve profile execution contracts (#119519)
Punchcard-Session: silver-valley-valley-dt
2026-08-05 15:07:40 +08:00
Jesse Merhi 95d7d95515 feat(tools): support batched tool search queries (#118623)
* feat(tools): support batched tool search queries

* fix(tools): harden batched tool search

* fix(tools): preserve batch search contracts

* fix(tools): bound batch search processing

* fix(tools): bound batch candidate metadata

* fix(tools): preserve callable batch candidates

* docs(tools): align batch search QA proof

* refactor(tools): isolate search request parsing

* test(qa): strengthen structured search proof

* test(qa): align structured directory proof

* fix(tools): preserve scalar search compatibility

* test(qa): disable batch scenario retries

* test(qa): allow direct-only tools in structured proof

* test(qa): verify nested catalog call result

* test(qa): remove obsolete result scanner
2026-08-05 16:28:10 +10:00
Peter Steinberger dc93ea6d69 fix(qa): follow durable finals after streamed previews (#119378)
* test(qa): isolate memory scenario evidence

* test(qa): follow durable progress completion

* test(qa): run doctor migration noninteractively

* test(qa): split active memory follow-up

* test(qa): wait for preview retirement

* test(qa): require ordered preview retirement

* test(qa): record ordered durable reply evidence

* test(qa): preserve durable delivery budgets

* test(qa): isolate durable lifecycle by account

* test(qa): scope durable reply assertions by account

* test(qa): preserve durable conversation identity
2026-08-04 22:29:15 -07:00
Vincent Koc fd1662f49c fix(cli): retire invalid secret flags and prove doctor recovery (#118926)
* test(qa): add doctor CLI recovery coverage

* test(qa): secure doctor exec SecretRef proof

* test(qa): gate doctor systemd recovery proof

* test(qa): normalize doctor terminal output

* test(qa): close doctor probe sockets

* test(qa): classify doctor probe as foreign

* test(qa): track doctor probe sockets

* test(qa): retain doctor instance narrowing

* test(qa): preserve observed doctor recovery proof

* test(qa): keep doctor recovery on stable dist

* test(qa): honor Windows exec ACL blocking

* test(qa): use canonical home for systemd recovery

* test(qa): follow bounded gateway recovery

* test(qa): accept lifecycle service label

* test(qa): align doctor recovery contract

Punchcard-Session: crisp-lantern-orchard-nv

* docs(secrets): remove retired provider bypasses

Punchcard-Session: crisp-lantern-orchard-nv

* test(qa): isolate doctor recovery target

Punchcard-Session: crisp-lantern-orchard-nv

* fix(cli): retire invalid secret provider flags

Punchcard-Session: crisp-lantern-orchard-nv

* test(qa): isolate doctor supervisor mode

Punchcard-Session: crisp-lantern-orchard-nv

* fix(plugins): remove dead secret path bypass

Punchcard-Session: crisp-lantern-orchard-nv

* chore: drop release-owned changelog entry

Punchcard-Session: crisp-lantern-orchard-nv

* test(qa): isolate doctor sudo scope

Punchcard-Session: crisp-lantern-orchard-nv

* fix(secrets): remove dead path bypass

Punchcard-Session: crisp-lantern-orchard-nv

* test(qa): isolate systemd user bus

Punchcard-Session: crisp-lantern-orchard-nv
2026-08-05 11:20:23 +08:00
Vincent Koc 6a8e11e63c fix(qa): repair release validation scenarios (#119150)
* fix(qa): repair parity and matrix media setup

Punchcard-Session: silver-valley-valley-dt

* test(qa): accept token-budgeted compaction suffix

Punchcard-Session: silver-valley-valley-dt

* test(qa): scope request diagnostics

Punchcard-Session: silver-valley-valley-dt

* test(qa): prove thread-memory causality

Punchcard-Session: silver-valley-valley-dt

* test(qa): configure Matrix image generation and fail fast

Punchcard-Session: silver-valley-valley-dt

* fix(qa): require memory get before thread recall

Punchcard-Session: silver-valley-valley-dt

* fix(qa): unify mock provider dispatch

Punchcard-Session: silver-valley-valley-dt

* fix(qa): repair Anthropic IDs and compaction causality

Punchcard-Session: silver-valley-valley-dt

* fix(qa): authenticate compaction wire causality

Punchcard-Session: silver-valley-valley-dt

* fix(qa): preserve Responses tool item identity

Punchcard-Session: silver-valley-valley-dt

* fix(qa): scope restart heartbeat proof

Punchcard-Session: silver-valley-valley-dt

* test(qa): assert causal traces before delivery

Punchcard-Session: silver-valley-valley-dt

* fix(qa): validate code mode completion evidence

Punchcard-Session: silver-valley-valley-dt

* test(qa): split causal catalog checks

Punchcard-Session: silver-valley-valley-dt

* style(qa): format matrix scenario tests

Punchcard-Session: silver-valley-valley-dt
2026-08-05 09:56:06 +08:00
Josh Avant 618fba92bf feat(audit): add execution identity inspection (#117034)
* feat(audit): add opt-in execution identity inspection

* fix(audit): gate recovery identity retention

* fix(audit): keep recovery identity type private

* test(audit): type internal recovery fixture

* test(audit): split recovery identity coverage

* docs(audit): define operator read trust boundary

* test(qa): register identity scenario child

* fix(audit): enforce shared identity retention bounds

* fix(audit): seal public ingress identity boundary

* fix(audit): keep ingress guard lint-clean

* fix(gateway): preserve advertised method order

* chore(protocol): sync advertised method order

* fix(protocol): encode audit selector invariants

* test(audit): prove exact execution guard

* fix(audit): keep identity storage lazy
2026-08-04 20:05:15 -05:00
Peter Steinberger f15120c6d1 fix(qa): carry selected runtime into flow scenarios (#119324)
* fix(qa): carry selected runtime into flow scenarios

* test(qa): align compaction runtime fact assertion
2026-08-04 13:51:35 -07:00
Vincent Koc aa07d55ec9 fix(qa): align release scenario setup and compaction proof (#119188)
* fix(qa): align release scenarios with runtime contracts

* fix(qa): retain inferred model provider plugins

* fix(qa): accept default OpenClaw compaction runtime
2026-08-05 03:32:49 +08:00
Vincent Koc 6d88ec5248 fix(agents): recover from invalid compaction summaries (#119137) 2026-08-04 19:43:25 +08:00
Vincent Koc 7aa3642f6d test(qa): repair QA catalog integrity (#119140) 2026-08-04 15:28:02 +08:00
Vincent Koc e0799199b3 test(qa): cover sandboxed exec behavior (#119053) 2026-08-04 14:36:03 +08:00
Vincent Koc 3f2fb7e365 test(qa): cover gateway plugin approvals (#119128) 2026-08-04 14:07:29 +08:00
Vincent Koc 2ca01fb618 test(qa): prove overflow compaction pruning (#119033) 2026-08-04 12:15:11 +08:00
Vincent Koc 12beeb7b29 test(qa): cover packaged browser profiles (#119043) 2026-08-04 11:13:05 +08:00
Vincent Koc 7f766550a1 test(qa): prove agent tool approval controls (#119029) 2026-08-04 11:02:17 +08:00
Vincent Koc fc1913defe test(qa): prove workspace mutation tools (#119021) 2026-08-04 09:52:31 +08:00
Vincent Koc 5a59bb07b3 test(qa): cover sandbox workspace isolation (#119038) 2026-08-04 09:21:54 +08:00
Vincent Koc bf61c4c581 test(qa): cover progress followthrough evidence (#119039)
* test(qa): cover progress task followthrough

* test(qa): cover progress evidence
2026-08-04 09:20:50 +08:00
Vincent Koc b4faa5aa5e chore(gateway): cover update and setup RPCs
* test(gateway): cover update and setup RPCs

* test(gateway): cover target wizard lifecycle

* test(gateway): normalize QA fixture ownership

* test(gateway): include historical dist closure

* test(gateway): isolate historical update fixture

* test(qa): align target wizard lifecycle proof

* test(qa): read structured gateway call errors
2026-08-04 09:15:55 +08:00
Vincent Koc 79dac911f6 test(qa): prove failure recovery visibility (#119034) 2026-08-04 09:02:33 +08:00
Vincent Koc e928762b9d test(qa): close external app SDK proof gaps (#118978)
* test(qa): close external app SDK proof gaps

* test(qa): close external app SDK proof gaps
2026-08-04 09:00:22 +08:00
Vincent Koc a85d3bbc5c test(qa): prove container health endpoints (#119012) 2026-08-04 08:49:51 +08:00
Vincent Koc 36b681344c test(qa): claim sessionless heartbeat coverage (#119027) 2026-08-04 08:47:49 +08:00
Vincent Koc 1520b839f3 test(qa): prove gateway chat RPCs (#118988) 2026-08-04 08:19:14 +08:00
Vincent Koc d8caec4de5 test(qa): cover composed tool result consumption (#118991) 2026-08-04 07:28:06 +08:00
Vincent Koc e110b56007 test(qa): cover Gateway usage and memory APIs (#118995) 2026-08-04 07:10:56 +08:00
Vincent Koc ba2764a256 test(qa): cover remote logging boundaries (#118951)
* test(qa): cover remote logging boundaries

* test(qa): tolerate gateway log interleaving

* test(qa): satisfy logging type guards

* test(qa): always stop log follow child
2026-08-04 06:53:49 +08:00
Vincent Koc 1be662aa9d test(tasks): cover TaskFlow registry lifecycle (#118983) 2026-08-04 06:38:41 +08:00
Vincent Koc 2da6cb0f01 test(gateway): verify SSH tunnel fallback (#118818)
* test(gateway): cover SSH tunnel fallback

* test(gateway): expose SSH startup diagnostics

* test(gateway): permit key auth for Testbox user

* test(gateway): remove unused SSH target helper

* test(gateway): serialize shared SSH state

* test(gateway): coordinate overlapping SSH producers

* test(gateway): isolate SSH trust state

* test(gateway): require Testbox for SSH fixture
2026-08-04 06:38:23 +08:00
Vincent Koc 0483ca712b test(qa): cover runtime telemetry evidence (#118950)
* test(qa): add telemetry runtime evidence

* test(qa): fix telemetry evidence typecheck
2026-08-04 06:11:07 +08:00
Vincent Koc a2e0eea58c test(gateway): cover node exec approval relay (#118825)
Adds real Gateway QA coverage for node exec approval get/set forwarding, malformed payload rejection, and paired-node ownership fencing.
2026-08-04 06:06:25 +08:00
Vincent Koc 59982714ee test(qa): promote package-backed Docker artifact proof (#118826) 2026-08-04 06:01:59 +08:00
Vincent Koc aff3909db6 test(qa): cover diagnostic event boundary (#118844) 2026-08-04 06:01:56 +08:00
Vincent Koc 6ab556919e test(gateway): cover WebSocket runtime contracts (#118797) 2026-08-04 06:01:34 +08:00
Vincent Koc d0194ee7e1 test(gateway): prove TLS certificate pinning (#118812)
* test(gateway): prove TLS certificate pinning

* test(gateway): fix TLS pinning proof types

* test(gateway): observe published TLS fingerprint

* test(gateway): load TLS discovery probe explicitly

* test(gateway): keep QA assertion typed
2026-08-04 05:44:00 +08:00
Vincent Koc 082e9e793e test(qa): cover tool policy and sandbox gates (#118925) 2026-08-04 05:43:33 +08:00
Vincent Koc 7daf990688 test(qa): cover Prometheus install and runtime export (#118867) 2026-08-04 05:38:23 +08:00
Vincent Koc a36aa23c2c test(gateway): cover hosted web surfaces (#118870)
* test(gateway): cover hosted web surfaces

* test(gateway): use shared temp cleanup

* test(gateway): respect plugin test boundaries
2026-08-04 05:31:06 +08:00
Vincent Koc 16635fa9c7 test(qa): cover gateway exec approvals (#118872) 2026-08-04 05:23:28 +08:00
Vincent Koc 99c5ea79ab test(gateway): cover task and automation RPCs (#118966) 2026-08-04 05:23:15 +08:00
Vincent Koc 622b5eaf8e test(tasks): add durable task operations QA (#118943) 2026-08-04 05:20:12 +08:00
Vincent Koc e4b6bde45a test(gateway): cover agent and artifact APIs (#118889) 2026-08-04 05:18:47 +08:00