927 Commits
Author SHA1 Message Date
Peter Steinberger 4008690cec docs: clarify targeted tests in changed checks (#132330) 2026-08-28 20:58:50 -07:00
Vincent Koc 4e9c622eab fix(release): prove landed FRV controller commits (#132289) 2026-08-29 11:44:31 +08:00
Peter Steinberger 30772d5061 fix(sessions): preserve context and lifecycle when forking chats (#132227)
* fix(sessions): preserve fork lifecycle ownership and context

Preserve incognito storage, revalidate message-cut authority at commit, and keep late UI fork results scoped to their presentation. Carry prepared child identity and actual context through subagent cleanup and receipts. Verify native source cuts with canonical projection and preserve supervision connection and cleanup ownership. Document the separate canonical-descendant initialization limitation.

* refactor(agents): remove unused subagent prompt task input

* test(codex): validate native fork fixture request shapes

* fix(codex): avoid inherited labels in native session forks

* fix(test): align fork prompt fixtures and session type imports

* refactor(agents): reuse subagent attachment result type
2026-08-28 20:21:57 -07:00
Peter SteinbergerandVincent Koc 31baa67f98 fix(ci): avoid unnecessary release verification delays (#132271)
* fix(ci): avoid unnecessary release verification delays

* test(ci): align release phase guard with coverage identity

* fix(ci): canonicalize minimum release coverage lock

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-08-29 11:01:15 +08:00
Ayaan Zaidi cff996e413 feat(qa): add Convex-leased Telegram userbot proof (#131715)
Replace Telegram Desktop and Mantis proof plumbing with a repository-owned Telegram Test Server skill and ten Convex-leased headless user sessions. Workers keep full harness freedom while the broker owns only exclusive lease lifecycle.

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-08-29 07:56:30 +05:30
Peter Steinberger 85cefd0252 fix(compaction): preserve headroom for local chat follow-up turns (#132190)
* fix(agents): separate early memory flush from required compaction

* test(compaction): cover custom memory flush headroom
2026-08-28 19:00:01 -07:00
Peter Steinberger e4001d8914 fix(browser): native bootstrap stalls before replying (#132212)
* fix(browser): unblock compiled native-host bootstrap

Load canonical config and pairing only after native-host validation. Keep
pure Browser URL and port helpers out of transport and mixed runtime
barrels, register the existing private CDP SDK export, and remove obsolete
bridge exports.

Run the extracted compiled-host integration case in the existing artifact
CI job with exact report validation. Preserve the custom installation
context, native framing, private Node trampoline, and 10-second deadline.

* fix(build): map private Browser SDK declarations

Complete browser-cdp registration in the shared plugin package-boundary
paths and XAI's matching override. Keep the SDK JavaScript-only in the
published package while using package-built declarations inside the repo.

The unchanged package-boundary contract reproduced the missing mapping
before this fix. No native-host runtime, fixture, assertion, or deadline
changes are included.
2026-08-28 17:55:06 -07:00
24a8fe46be fix: size explicit forks for child model context (#132112)
Worked on by:
- @VACInc

Co-authored-by: roboclaw-bot <309084314+roboclaw-bot@users.noreply.github.com>
Co-authored-by: VACInc <3279061+VACInc@users.noreply.github.com>
2026-08-28 20:37:45 -04:00
Peter Steinberger 208f551542 fix(test): clean isolated homes across managed test runners (#132208) 2026-08-28 17:04:03 -07:00
Peter Steinberger cf2ede24f1 fix(plugins): load source artifacts without losing credential targets (#132166)
Use the canonical plugin loader for source and built public artifacts, retire transformed module dependencies with their cache generation, and report broken contracts during source credential-reference generation.

Fixes #132153
2026-08-28 15:59:46 -07:00
Vincent Koc f30e480a70 perf(release): pipeline full release validation (#131914)
* feat(release): split release child phases

* feat(release): acquire shared candidates once

* fix(release): seal candidate publisher identity

* fix(release): separate published package inputs

* fix(release): rebuild overridden acceptance images

* fix(release): preserve phased candidate identity

* test(release): cover phased validation workflows

* fix(release): integrate phased candidate acquisition

* fix(release): type phased recovery fixtures

* test(release): cover phased validation inputs
2026-08-29 05:11:05 +08:00
JeromeandAyaan Zaidi 7e05bd49ea fix(agents): stop retrying provider request ceilings (#130275)
Groq can report a per-request size ceiling as a TPM rate-limit error. Record the token-denominated Requested > Limit fact at failover classification so embedded recovery stops compaction and retry with reset guidance, while transport-owning fallbacks can still advance and ordinary TPM throttling retains backoff.

Co-authored-by: Jerome Queck <jeromequeck@jeromegroup.org>
Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-08-29 02:19:10 +05:30
Peter Steinberger 3209317a6a fix: declaration steps succeed with lingering subprocesses (#132070)
Fixes #132053. Verify POSIX process completion at each declaration owner before accepting success. Preserve Windows behavior without changing timeouts or shared defaults.
2026-08-28 13:25:42 -07:00
Vincent Koc 944cff7cef feat(release): reuse exact full release candidates (#131818)
* feat(release): reuse exact full release candidates

* test(release): satisfy candidate evidence types

* test(release): pin candidate artifact name

* fix(release): harden candidate reuse availability

* fix(release): bound candidate discovery time

* fix(release): enforce candidate download deadline

* fix(release): fail closed on candidate lookup uncertainty

* fix(release): block selected candidate fallback

* docs(release): clarify candidate discovery failures

* test(release): assert candidate miss gate

* fix(release): fail closed on candidate scan limits

* refactor(release): isolate candidate reuse library

* docs(release): clarify candidate recovery authority
2026-08-29 03:45:14 +08:00
Vincent Koc 1186e6a6f3 feat(release): seal full release candidate evidence (#131751)
* feat(release): seal full release candidate evidence

* fix(release): harden candidate evidence validation

* test(release): cover candidate digest tuples

* fix(release): retain candidate tooling closure

* test(ci): refresh release candidate guard inventories

* test(release): decouple candidate workflow fixture
2026-08-28 21:44:21 +08:00
Peter Steinberger b03d2e79e9 fix(sessions): prevent participant misattribution in Activity (#130986)
* fix(sessions): preserve participant identity and input provenance

Keep profile, agent, remote, observed, and legacy identities distinct in the existing participant table. Record accepted input at admission, including steering, instead of inferring a person from the session creator. Preserve historical membership and counts while leaving ambiguous profile timestamps unknown through stopped-writer Doctor migration.

Project full visibility-filtered person membership before preview limits so Activity does not misattribute channel identities or omit people outside the facepile. Keep participant membership separate from authorization and expose raw-selector ambiguity to memory operators.

Repair Doctor readiness reporting, generic Swift inline-union generation, direct-dispatch metadata handling, and fixture-owned database lifetimes. Verify namespace collisions, real provider input, accepted steering, visibility, backup/migration/reopen boundaries, native decoding, and the built-CLI lifecycle.

Fixes #130661

* fix(macos): isolate readiness and discovery lifecycles

Keep readiness fixtures private for their entire lifetime and give health readiness one deadline owner. Start and cancel slow host discovery with active discovery, not model construction.

Make native protocol, callback, onboarding, and process-cleanup tests observe their intended lifecycle phases without expanding deadlines or weakening assertions. Correct the documented signing default.

Validated with 1,839 parallel native tests, the release product build, causal negative controls, pinned Swift lint/format checks, and fresh isolated autoreview. Native production delta: -5 lines.

* docs(macos): clarify app profile isolation boundaries

* build(protocol): refresh generated Swift install models

* fix(protocol): preserve optional literal field presence

* fix(ci): bound SDK declarations and isolate test lifecycles

Discover the current declaration source graph in a joined child before normal eager emission, and track its complete source-bearing cache inputs. Repair shared jsdom focus teardown and native worker fixture request ordering without changing UI focus ownership or execution fallback policy.

* test(sessions): prove Goal participant upgrade boundaries
2026-08-28 06:04:18 -07:00
Vincent Koc c28cb02384 fix(release): resume failed validation without repeating green jobs (#128141)
* fix(release): resume failed FRV child attempts

* fix(release): harden FRV continuation controller

* fix(release): bind FRV continuation source evidence

* fix(release): support historical FRV source evidence

* fix(release): bind historical FRV source inputs

* fix(release): bind historical FRV source evidence

* fix(release): preserve historical FRV source identity

* fix(release): align FRV continuation CI checks

* fix(release): disable fail-fast for FRV continuations

* test(release): align FRV fail-fast expectation

* fix(release): classify missing FRV artifacts centrally

* fix(release): recover FRV state from workflow artifacts

* fix(release): overwrite recovered FRV plan artifact

* docs(release): clarify FRV plan recovery

* fix(release): harden FRV continuation recovery

* fix(release): revalidate FRV tooling ref before dispatch

* fix(release): authenticate historical FRV plans

* fix(release): fail FRV when temporary ref cleanup fails

* test(ci): update FRV workflow routing expectations

* fix(release): declare FRV workflow ref helper

* fix(release): keep FRV recovery on the same parent

* fix(release): verify original dispatch on parent recovery
2026-08-28 19:35:10 +08:00
Peter Steinberger 047470456f feat(control-ui): create and manage goals without slash commands (#131370)
* feat(control-ui): create and manage goals without slash commands

* fix(control-ui): keep goal composer contracts acyclic

* refactor(control-ui): tighten goal composer guidance

* fix(goals): admit fresh and completed local sessions

Create the first session with its Goal, input, run claim, and receipt in the existing transaction. Scope reply dispatch hooks consistently at admission and execution, and retain built-in runtime eligibility after completed turns. Preserve creator and lifecycle checks and cover the failures observed through the real Control UI flow.

* fix(ui): preserve button names during fade-in

* docs: defer Goal release notes to release generation
2026-08-28 04:31:48 -07:00
Vincent Koc 240b485326 fix(release): bound FRV polling cadence (#131714) 2026-08-28 19:31:25 +08:00
Peter Steinberger b576bb41cf fix(usage): retain reset history and unify accounting (#131667)
* fix(usage): retain reset history and unify accounting

Keep family selection within the recorded agent and assign each instance once.
Carry discovered SQLite or JSONL sources into batched loading, including empty
current sessions and history encountered before a current artifact.

Share Gateway and Control UI aggregation and total arithmetic, use canonical
pricing for detail logs, and invalidate both result caches on config changes.
Split calendar, cache, selection, and loading owners out of the usage handler.

Add failing-before regressions for reset history, overlapping families, mixed
sources, config replacement, missing-price exports, and log pricing.

* refactor(usage): keep accounting type imports acyclic

Make batched loading own its minimal input contract and import shared accounting
types from the leaf definition instead of the runtime barrel. Remove obsolete
current-JSONL fixture setup to keep the existing usage test within its line cap.

Verified both CI failures locally: zero Madge cycles and passing core lint with
the CI tsconfig. No runtime behavior or public protocol changes.

* refactor(usage): remove unused accounting type re-exports

The shared usage contracts now import their canonical leaf definitions. Remove
the six obsolete internal-barrel type re-exports left by that ownership repair.
2026-08-28 03:00:19 -07:00
f7a9a361d9 feat(comfy): support custom headers and per-request seed randomization (#130098)
* feat(comfy): support custom headers and per-request seed randomization

Local-mode ComfyUI requests only ever sent Content-Type, so a local
instance reachable behind HTTP auth (Basic auth, a bearer token) had no
way to authenticate. Add a generic headers config key, merged over the
plugin's own headers -- same shape as the ollama plugin's established
remote.headers pattern, rather than inventing a comfy-specific scheme.

Also add optional seedNodeId/seedInputName: without it, a static
workflow file's sampler seed never changes between submissions, so
every generation was silently identical whenever the operator's
workflow relies on a fresh random seed per run.

* fix(comfy): resolve headers through the SecretInput path, not plaintext-only

The new headers config accepted only literal strings, so a credential-bearing
value (Authorization for a gated ComfyUI instance) had no path to secret
storage -- unlike the existing apiKey field, which already resolves through
resolveSecretInputString with an env-backed fallback. Mirrors that same
pattern per-header, plus the ollama plugin's established header-secret
precedent: a header pointed at a SecretRef that can't be resolved fails the
request outright instead of silently sending it unauthenticated.

* fix(comfy): resolve non-env header SecretRefs, hide capability on unresolvable ones

resolveComfyHeadersConfig only ever resolved env-sourced SecretRefs (a
manual process.env fallback bolted onto inspect-mode); any file,
keychain, or plugin-backed reference always threw, despite the schema
and docs advertising the same SecretRef shape apiKey accepts. Now
resolves through resolveConfiguredSecretInputString (the same async
resolver the ollama plugin's own headers use) for the non-literal case,
so a real non-env credential provider actually works.

Separately, isComfyCapabilityConfigured returned true for local mode
without ever inspecting headers, so an unavailable Authorization
SecretRef advertised an image/video/music tool that would always throw
on invocation. Extends the same sync inspect-based veto
resolveComfyApiKey already applies for cloud mode's apiKey.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vk2cBRQdErwRtPea8VuhG6

* fix(comfy): don't veto a resolvable non-env header secret from provider selection

hasUnavailableComfyHeaderSecret treated any non-env SecretRef as
unavailable for the isComfyCapabilityConfigured gate, on the theory that
inspect mode can't confirm it -- but "can't confirm yet" isn't "won't
resolve": the async request path can and does resolve a real
file/keychain/plugin-backed ref. That made a perfectly valid,
already-working header credential permanently hide the image/video/music
tools from the agent, which is a worse outcome than a rare genuinely
broken ref surfacing its error at actual invocation. Only a definitely
missing/empty env var (decidable synchronously, no I/O) still vetoes.

Added a permanent committed integration test
(workflow-runtime.header-secrets.integration.test.ts) that proves this,
plus the env/non-env header resolution and fail-closed paths, over real
sockets with no SDK/ssrf-runtime mocking -- replacing the throwaway
proof script from the previous push, which was deleted after running and
therefore not rerunnable or reviewable.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vk2cBRQdErwRtPea8VuhG6

* fix(comfy): register header SecretRefs in the plugin secret contract

headers.* accepts and resolves SecretRef values, but the manifest never
declared configContracts.secretInputs for that path -- the canonical
plugin secret lifecycle (startup materialization, owner diagnostics,
audit/configure discovery, resolved-value redaction) only walks
manifest-declared paths, so this credential surface was invisible to
all of it despite working correctly at request time. apiKey doesn't
need the same declaration (it's covered by the separate, already-wired
provider-auth system via setup.providers.envVars/providerAuthChoices);
headers.* has no other declaration path.

Also fixes two smaller findings from the same review pass: the
seed-injection test asserted the freshly-generated seed is nonzero,
but randomInt(RANDOM_SEED_EXCLUSIVE_MAX) legitimately can (rarely)
return 0 -- a flaky assertion, removed; and documents that a configured
Content-Type header is ignored specifically on image-upload requests,
where the multipart boundary must come from the runtime.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vk2cBRQdErwRtPea8VuhG6

* docs(secrets): register comfy header SecretRefs in the credential matrix

The comfy plugin manifest change in e32863dc6cd registered
plugins.entries.comfy.config.headers.* as a secret-input target, but the
generated docs matrix and its paired markdown list weren't refreshed to
match, breaking the docs-sync CI check.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vk2cBRQdErwRtPea8VuhG6

* test(comfy): restore inherited header proof env

* fix(comfy): redact reflected request credentials across generation failures

Reuse the Ollama exact-header redactor through the provider HTTP SDK, scrub structured and truncated diagnostics before retaining them, and cover decoded Basic credentials observed in real ComfyUI proxy failures. Preserve optional header and seed behavior while consolidating tests and documenting the shared boundary.

Co-authored-by: Markus Hartung <mail@hartmark.se>

* fix(provider-http): handle optional Node header values safely

Skip undefined HeaderRecord values allowed by Node types and document the intentional omission of unsafe parser causes in the lint exception. Actual credential and no-header error behavior remain unchanged.

Co-authored-by: Markus Hartung <mail@hartmark.se>

* test(comfy): explicitly stringify reflected proxy header values

Keep the socket fixture compatible with the IncomingHttpHeaders union without changing its reflected-error behavior.

Co-authored-by: Markus Hartung <mail@hartmark.se>

* test(provider-http): register credential-safe parser error exception

Track the intentional preserve-caught-error suppression in the explicit inventory: raw JSON parser causes can quote request credentials. The focused inventory and provider HTTP tests pass; runtime behavior is unchanged.

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: Patrick Erichsen <patrick.a.erichsen@gmail.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-08-28 01:40:22 -07:00
weiqinlandPeter Steinberger 0fef6319fa fix(usage): preserve agent ownership for matching session IDs (#128803)
* fix(usage): attribute named sessions to their store owner in all-agent list

The all-agent `sessions.usage` list labeled durable (store-backed) session
rows with whichever agent discovery surfaced, instead of the store owner.
When a subagent spawned from a session left a discovery transcript that
reused the parent sessionId, the Sessions dashboard card showed the
subagent's id (e.g. `scout-research`) instead of the owning agent
(`main`).

Resolve the owner from the durable store key via
`resolveSessionStoreAgentId`, re-resolve the owner's transcript file, and
de-duplicate by store key so a reused subagent transcript cannot shadow or
duplicate the owner row. Unnamed discovery-only sessions keep using the
discovered agent id.

Closes #128755

* fix(usage): reject cross-agent transcript fallback for named sessions

Address the ClawSweeper review finding on #128755: when owner transcript
resolution returned no file, the `?? discovered.sessionFile` fallback
could load the subagent's reused transcript under the owner row, leaving
attribution and usage totals inconsistent.

Resolve only an owner-associated transcript for store-backed named rows.
When the owner transcript is absent the row stays attributed to the owner
with no usage loaded (cold cache) instead of substituting another agent's
transcript.

Move the two #128755 regression tests into a dedicated
`usage.sessions-usage-owner-attribution.test.ts` so the existing
oversized test file stays under the max-lines limit, and add a case
covering the unresolved-owner path.

* fix(usage): bind transcript resolution to the durable store owner marker

Address the ClawSweeper re-review finding on #128755: the owner-file
resolver accepted a store entry SQLite marker by sessionId alone, so a
marker reusing the sessionId under a different agent (e.g. a subagent)
could still substitute that agent's transcript for a main-owned row.

Guard the resolver call: parse the store entry marker and only forward the
entry when its embedded agent matches the resolved owner. When the marker
belongs to another agent, drop the entry so the resolver falls back to the
owner agent's own transcript directory (or no file), never the subagent's.

Add a regression covering a durable row whose stored marker names a
different agent.

* fix(usage): drop redundant type assertion for store entry sessionFile

SessionEntry already declares sessionFile?: string, so accessing it
directly avoids a non-const type assertion. Restores the assertion-safety
ratchet (8 > 7 baseline) without changing behavior.

* fix(usage): validate entry marker agent in transcript resolver

Move the store-entry SQLite marker ownership check into
resolveExistingUsageSessionFile itself: matchingEntryMarker now requires
entryMarker.agentId to equal the requested agentId, so a subagent marker
reusing a parent sessionId can no longer be substituted for the owner
transcript. This lets the all-agent usage list drop its redundant outer
guard (and its non-const type assertion) and simply request the owner
agent, restoring the assertion-safety ratchet baseline.

Adds a regression test in session-cost-usage.test.ts covering the mismatched
agent marker path.

* fix(usage): preserve selected-agent ownership for global list rows (#128755)

- Only resolve durable owner for agent-scoped named keys; keep discovered
  agentId for global/unknown so a scoped request keeps its own global row.
- Add scoped-global list-path regression test.
- Add real-state remote-proof test (no internal mocks) logging the RPC trace.
- Add positive marker-match test; trim verbose comments.

* fix(usage): drop unused eslint-disable directive in remote-proof test

* fix(usage): resolve global durable rows to owner in all-agent lists (#128755)

ClawSweeper P1: all-agent discovery is newest-first, so a subagent transcript
that reuses a global durable row's sessionId could still relabel the row.
Resolve global/unknown rows to their logical owner in all-agent lists while
keeping the explicitly requested agent for scoped lists.

- Add all-agent global-row regression test.
- Add authenticated Gateway WebSocket proof test capturing the RPC trace.

* test(usage): restore gateway token env after ws-proof server

* test(usage): add real-Gateway UI e2e proof for #128755 owner attribution

Add a real-Gateway Control UI e2e test that seeds the #128755 scenario
(main owns the durable telegram DM row; an opus subagent transcript reuses
its sessionId, discovery-only) and drives a real Chromium browser against a
loopback token-free Gateway. The Sessions usage dashboard must attribute the
Telegram DM card to its store owner (agent:main), never to the reused opus
subagent, with no duplicate/shadow row.

- Asserts the .session-bar-row for agent:main:telegram:dm shows agent:main
  in its meta and no agent:opus row appears.
- Captures a redacted isolated dashboard screenshot when
  OPENCLAW_CAPTURE_UI_PROOF=1 (sanitized test fixtures, loopback, no tokens).
- Registered in the checks-ui-e2e-real-gateway CI lane and excluded from the
  standard ui-e2e shard via uiE2eRealGatewayTestFiles.

* fix(usage): bind owner transcript to canonical durable target (#128755 P1)

ClawSweeper P1: resolveExistingUsageSessionFile still received storeMatch.entry,
whose sessionFile can hold a cross-agent legacy JSONL path. resolveSessionFilePathCore
intentionally accepts absolute paths from other agents, so a main-owned row
carrying an opus path would be labeled main while the opus transcript loaded
into main's usage group.

Resolve via the canonical durable owner target instead: pass a complete
sessionTarget (owner agentId + sessionId + store key + owner storePath) so
resolveExistingUsageSessionFile validates owner identity and returns the owner's
canonical SQLite marker, never consulting the cross-agent legacy file.

- Add regression: owner target rejects an existing cross-agent opus transcript
  file on the durable entry and returns the owner's sqlite:main: marker.

* fix(usage): join sessions by agent and transcript identity

Carry projected session ownership into usage reporting and preserve independent
cross-agent transcripts with equal IDs. Scope historical-family suppression to
the same identity, retaining canonical aliases within each agent.

Replace re-attribution and deduplication branches with one owner-aware join.
Add real-state ownership coverage and retain real-Gateway browser proof.
Stabilize neighboring cache range coverage by awaiting its real refresh.

Fixes #128755. Refines #128803. Thanks to @yetisoldier for the report.

Co-authored-by: LiuwqGit <liu.weiqin@xydigit.com>

* test(usage): seed browser transcripts within the active date window

* test(ui): assert reader anchoring across transcript growth

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-08-27 23:13:44 -07:00
Peter Steinberger 9a38b5ec8f fix(test): clean fallback SQLite state after test runs (#131313)
* fix(test): clean fallback SQLite state after test runs

* test: make temporary-state fixtures ownership-aware

* fix(scripts): resolve test temp helper in native Node
2026-08-27 23:04:57 -07:00
Peter Steinberger 60dc0203cd fix(auto-reply): persist context-pressure diagnostics (#131554) 2026-08-27 22:50:57 -07:00
Peter Steinberger 648d0c43c8 fix: reuse package-local plugin memory artifacts (#131538) 2026-08-27 22:22:21 -07:00
Peter Steinberger d83a53dd2f fix(ui): avoid standalone validator startup stalls (#131497)
* fix(ui): avoid standalone validator startup stalls

* test(ui): preserve fixture env overrides on Windows
2026-08-27 21:44:06 -07:00
Peter Steinberger 02f56eb6ce ci: replace hand-fitted shard timings with committed measurements (#131379)
* ci: use committed measurements for test sharding

Regenerate UI file and runner-specific compact weights from successful CI log medians, with outlier filtering and a 15% write threshold. Keep existing hints as cold-start fallbacks and account for per-file UI overhead without deriving membership from timing keys.

Add a daily standing-PR refit workflow, strict cached loading, fixture coverage, and operator docs. Verify all 302 UI files form identical complete partitions across 22 fresh processes.

* fix(ci): prune stale test timings and trust runner labels

Remove unobserved timing keys only after three sampled runs and report removals in the refit table. Bucket compact measurements using jobs API labels and include all main run attempts without counting retries as independent samples.

Document contended compact walls and the hosted cold-start fallback. Preserve committed timing data and existing sharding behavior; verify 70 focused tests, all 11 UI shards, five corruption fallbacks, live refit, changed checks, workflow checks, and Codex autoreview.

* fix(ci): prune timings per profile with observed evidence

Pruning used one global run count, so a profile with no observations in
the sampled window had its whole committed map deleted. Hosted weights
could never accumulate, and a partial log-fetch failure could drop every
UI E2E entry in a single refit.

* fix(ci): keep preflight timing validation dependency-free

PR preflight builds its manifest with bare Node before dependency installation. Replace the timing schema dependency with strict all-or-nothing validation and preserve the CiTestTimings type.

Walk workflow-derived planner imports in a bounded, cycle-safe regression guard. Keep the refit CLI outside that dependency-free boundary, and document the coercion-helper exception for preflight.

* test(ui): settle typography picker popup animations

* fix(ci): guard timing refit sampling and publication
2026-08-27 21:42:00 -07:00
Peter Steinberger a822351329 docs(test): include agent-plugin gateway in E2E aggregate (#131390) 2026-08-27 19:15:52 -07:00
Peter Steinberger 63ba751a2d test: separate GNU shell integration from portable coverage (#131339) 2026-08-27 18:28:04 -07:00
Peter Steinberger 61a47996d5 fix(memory): forgotten content survives retries and consolidation (#131179)
* fix(memory): preserve provenance until derived content is purged

* refactor(memory): simplify provenance key collections
2026-08-27 15:44:53 -07:00
Peter Steinberger ce0fafefce fix(tooling): avoid build and test startup stalls on shared tsx caches (#130924)
* fix(tooling): avoid shared tsx cache startup stalls

Use the shared preloader before tsx initializes so maintained build, check, and test commands retain memory transforms without scanning other checkouts' disk caches. Preserve changed-cwd forks and copied tooling closures.

* test: align command contracts with tooling bootstrap
2026-08-27 10:36:12 -07:00
Peter Steinberger ff3cf3de3b docs(start): correct headless credential handoff to the SQLite auth store (#131024) 2026-08-27 09:40:27 -07:00
Peter Steinberger 52750a2a65 fix(agents): restore direct-command proactive compaction (#130863)
Share usage-based maintenance with successful built-in command turns while
preserving diagnostic-only pressure estimates and native compaction ownership.
Carry the winning auth profile privately, fence session accounting, and retain
completed local replies when ordinary post-turn summarization fails.

Cover threshold, delivery, cancellation, successor, and routing boundaries;
clarify the documented scheduling behavior without adding configuration.

Closes #130716
2026-08-27 03:27:56 -07:00
Peter SteinbergerandVincent Koc 1ea2640f54 refactor(state): consolidate wide rows, plugin index, workspace attestations, and shared auth singletons at schema v13 (#130466)
* refactor(state): make cron and subagent rows JSON-canonical

* refactor(state): make gateway origin device tokens canonical at v13

The lazy ensure predates the table joining the canonical schema; at the
v13 bump the schema owns creation, so the feature-local DDL, WeakSet
dedupe, and lazy-list entry retire. The legacy-file guard the ensure
carried stays at each call site.

* test: drop obsolete lazy-ensure coverage for origin device tokens

The table is canonical at v13; same-version lazy creation no longer
exists to protect. Origin CRUD, isolation, and rotation coverage remains
in the surviving cases.

* refactor(state): fold installed_plugin_index into config_machine_state

The singleton index row becomes one JSON value under
plugins.installedIndex with its rollback-fencing revision inside the
value; reads, CAS restore, and the lease-held write transactions use
direct Kysely on config_machine_state so the state_leases assertion
stays in-transaction. The v13 migration imports the row and drops the
table; the additive workspace_dir entry folds with it. Doctor guidance,
docker staging, and the e2e probes name the machine-state row.

* refactor(state): merge workspace_attestations into workspace_setup_state

One row per workspace now carries both setup milestones and the
attestation clock: nullable setup columns represent attestation-only
workspaces (replaceWorkspaceAttestation can precede any setup write) and
setupExists derives from a non-null version. The bootstrap-hash FK
repoints to the merged table; migration receipts keep the historical
workspace_attestations discriminator string. The v13 migration grows and
rebuilds the table, merges attestation rows (orphans without a path
alias drop — their hashes re-derive at the next bootstrap attestation),
and the consolidation kind is renamed state-consolidation-v13 to cover
the batch.

* test(state): cover the workspace merge and consolidation fallout

The v12-to-v13 regression seeds merged, attestation-only, and orphan
attestation workspaces; the 13-to-12 downgrade fixture recreates
workspace_attestations and installed_plugin_index from the folded data;
the fold-in migration gates the additive workspace_dir column for
pre-additive rows; the workspace merge now triggers on the setup table's
own shape so stable-era databases without an attestations table still
reshape; the consolidation applied-message covers the batch.

* refactor(state): fold shared auth profile singletons into config_machine_state

The shared-state auth_profile_stores/auth_profile_state rows (fixed key
'shared') become authProfiles.store/authProfiles.state machine-state
values; the agent-DB tables of the same names are untouched. Git-backup
redaction moves from table-drop to the authProfiles. secret prefix with
seeded-secret absence proof; migration receipts keep the historical
table-name discriminators; the shared-auth relocation and receipt
verification project the KV cells back to the receipt-era row shapes so
persisted digests stay byte-compatible. mcp_oauth_stores stays a table —
its multi-key fold is a named follow-up.

* test(state): finish shared-auth fold coverage and annotate boundary casts

Auth seeders and assertions across the e2e/scripts/secrets suites target
the authProfiles machine-state cells; the v12-to-v13 regression proves
payload-byte fidelity, non-shared-row drop, and insert-if-absent
precedence; the downgrade fixture recreates and repopulates both v12
tables. Boundary type assertions in the plugin-index store carry SAFETY
invariants per the ratchet.

* chore: shrink assertion-safety baseline for plugin-index store

* refactor(doctor): delete the dead onboarding-recommendations migration

Its input — the unscoped 'primary' onboarding row — existed only between
9a93a52a8a and 473962b7de, a two-day beta window; no shipped stable
can produce it and the runtime table folded away at v12. The audit
backup list keeps recognizing system-agent.jsonl artifacts because beta
installs that ran that import may still carry its backups.

* docs: sync the 13-to-12 downgrade example with the executable fixture

* style: format the synced downgrade example

* style: drop unused import and duplicate union constituent

* fix(state): keep orphan attestations across the v13 workspace merge

The merged workspace_setup_state required a workspace path, but legacy
orphan hashed-key attestations never recorded one. workspace_path is now
nullable (setup rows still enforce it via CHECK), the v13 migration and
the doctor file import keep orphans with a NULL path that heals on the
next live access, and the 13-to-12 downgrade keeps attestation-owned
hashes. Doctor test seeds move to the folded KV row.

* perf(state): retire unused cron indexes

* fix(state): preserve v13 migration recovery

* fix(state): preserve v12 lazy-table upgrade

* docs(state): document v13 auth relocation

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-08-27 15:26:14 +08:00
Vincent Koc d62cb8aa07 fix(sqlite): safely discard retired commitments state (#130629)
* fix(sqlite): finalize commitments retirement

* fix(doctor): discard retired commitments json
2026-08-27 11:18:58 +08:00
Peter Steinberger 5153f25495 fix(memory): prevent forgotten session content from returning (#130451) 2026-08-26 16:26:00 -07:00
Peter Steinberger dcb20658fc fix(openshell): preserve file writes during concurrent mirror commands (#130447)
Lease complete mirror file operations through the workspace owner instead of locking only remote transport. Preserve successful writes across exec publication and share serialization across backend handles.

Proven with a real Docker red/green reproduction, 128-workflow mirror/remote stress matrix, exact inventories, failure recovery, 170 focused tests, and updated operator docs. Related: #127441; follow-up to #130031.
2026-08-26 15:59:31 -07:00
Peter Steinberger 1fc29beba2 refactor(state): fold singleton tables into config_machine_state at schema v12 (#129876)
* refactor(state): fold singleton tables into config_machine_state at schema v11

Eight singleton tables (skill_curator_state, update_check_state,
clawhub_promotions_feed_state, model_catalog_remote, voicewake_triggers,
voicewake_routing_config, voicewake_routing_routes,
onboarding_recommendations) were each one logical JSON value behind a
fixed key; their bespoke schemas, lazy ensures, and per-table accessors
collapse onto the shared config_machine_state KV under namespaced keys.
cron_store_epochs retires outright: it was born write-only in #114388
and no reader ever existed in any language. Durable values (update
check state, voicewake triggers and routing, per-workspace onboarding
answers) migrate insert-if-absent during the v10->v11 migration; cache
class contents rebuild on next use. Deferred with named reasons:
exec_approvals_config (macOS direct-SQL contract), installed_plugin_index
(same-tx lease fence), node_host_config and web_push_vapid_keys
(secret-table git-backup redaction).

# Conflicts:
#	src/skills/workshop/collection-review-state.ts
#	src/skills/workshop/collection-review.gateway-admission.test.ts

* test: register v11 guard carve-outs and suppression pin

The v11 migration module joins the raw-SQLite allowlist (migrations are
the named guardrail exception), the lint-suppression allowlist records
the second type-parameter suppression in config-machine-state, and the
identity module keeps only externally consumed exports.

* test: surface CLI stderr when migration-diagnostic assertion fails

* test: expect migration diagnostics on stderr for models plain commands

The #129037 pending-migration cases asserted that aliases/fallbacks
lists never open the state database, but config-health observation
(observeConfigSnapshot -> readConfigHealthStateFromStore) full-opens it
on any config read whose file exists — reproduced identically on clean
main with a main-built dist. The protected contract is exact stdout;
the diagnostic legitimately lands on stderr for every case.

* test: drop unused defaults import from CLI stdout e2e

* test: split session path derivation out of oversized session-files suite

#130016 pushed session-files.test.ts to 1008 lines, over the 1000-line
lint cap and red for every PR's check-lint. The sessionPathForFile
describe moves to a self-contained sibling following the existing
session-files.*.test.ts split pattern; no assertions change.

* refactor(state): fold four more singleton tables into schema v12

tui_last_sessions (cache-class, regenerates on next session switch),
sidebar_sections (persistent section order, migrated as one JSON array),
node_host_config, and web_push_vapid_keys join the v12 fold-in, taking
the retirement to thirteen tables at the same version. The two secret
singletons were blocked on table-granular git-backup redaction; backups
now exclude config_machine_state rows by secret key prefix (nodeHost.*,
webPush.vapidKeys) with a fail-closed row filter and regression proof,
so STATE_SECRET_TABLE_NAMES sheds both tables. The sidebar fold also
retires its lazy-ensure WeakSet and inline DDL; sidebar edits stay
inside the existing session-group write transaction via direct Kysely.

* fix(node-host): omit absent Cloudflare Access config like the column reader

The KV rewrite returned gateway.cloudflareAccess as an own undefined
property where the retired column reader omitted the key; toStrictEqual
consumers (state-migrations doctor-repair test) caught the shape drift.
Mirror the column reader's conditional spread at both construction
sites.

* fix(backup): disclose redacted machine-state prefixes after restore

The prefix-granular secret redaction recorded omitted key prefixes in
the backup manifest but the restore result exposed only excludedTables,
so a redacted restore looked complete while nodeHost.* and
webPush.vapidKeys configuration were intentionally absent. The restore
result and CLI output now disclose the omitted prefixes (JSON mode
carries them via the result shape), with restore-side regression
coverage.

* fix(tui): compare-and-delete retired session pointers

Doctor cleanup read matching pointer keys then deleted them
unconditionally, so a replacement pointer written between the scan and
the delete was erased. The delete now re-checks the stored value inside
the write transaction and only removes pointers that still name a
retired session; a live replacement survives (regression covered).
Also corrects the stale schema-version line in database-first.md.
2026-08-26 13:32:19 -07:00
Peter Steinberger 87b56458a1 feat(plugins): inbound IMAP email trigger (#130230)
* feat(plugin-sdk): add in-process hook agent dispatch seam

* feat(plugins): add imap inbound email trigger plugin

* fix(imap): coalesce sweep wakeups and drop test-only gate exports

* docs(imap): fix agents bindings command invocation

* fix(gateway): guard optional bound context in plugin hook dispatch

Post-rebase drift made resolveBoundGatewayContext possibly-undefined; the
plugin hook dispatch path invoked it unconditionally. Use the optional-call
guard consistent with sibling runtime accessors.

* fix(imap): bump mailparser to 3.9.16 off vulnerable deepmerge-ts

mailparser 3.9.15 pinned html-to-text@10.0.0 -> deepmerge-ts@7.1.6 (GHSA
HIGH, stack exhaustion, <8.0.0). 3.9.16 pins html-to-text@10.0.1 ->
deepmerge-ts@8.0.2, clearing the production audit gate.

* refactor(gateway): extract plugin hooks runtime to keep server-plugins under max-lines

The dispatchHookAgentTurn seam pushed server-plugins.ts to 702 effective lines
(cap 700). Extract createGatewayHooksRuntime into the sibling runtime-helpers
module, mirroring createGatewayNodesRuntime/createGatewaySubagentRuntime; no
suppression added.

* docs(secrets): register imap plugin password in secretref credential matrix

The bundled imap plugin declares a secretInput (accounts.*.password); regenerate
the user-supplied credentials matrix and surface list so the target-registry docs
sync test stays green.
2026-08-26 12:24:02 -07:00
Peter Steinberger 8e39f58365 docs(memory): add memory provenance and deletion concepts page (#130278)
* docs(memory): add memory provenance and deletion concepts page

New concepts/memory-provenance page tells the operator policy story end to end: recorded session lineage through consolidation, the admission policy and its pipeline-only boundary, memory forget guarantees (whole-entry purge, derived-artifact sweep, forgotten tombstones) and reported boundaries (transcripts, curated writes, paraphrased prose), plus the person/source purge workflow. Cross-linked from memory architecture, dreaming, builtin, overview, CLI, and config reference; registered in docs navigation.

* docs(i18n): add glossary terms for the memory provenance page

* docs(memory): distinguish curated entries from missing lineage in the provenance page
2026-08-26 11:36:39 -07:00
Peter Steinberger 9d9dc31275 feat(memory): session provenance, admission policy, and openclaw memory forget (#130151)
* feat(state): add memory entry origins and session tombstone tables with session-aware write provenance

Additive same-version per-agent tables (memory_entry_origins, memory_session_tombstones) declared canonically with lazy idempotent ensure; read-only agent DB access exposed through the SDK; memory-write observers and the session-memory hook record the authoring session; archived narrative transcripts classified by authoritative run identity.

* feat(memory): admission policy, entry provenance, and openclaw memory forget

memoryPolicy.excludeSessions keeps configured sources out of the dreaming pipeline with recorded exclusions; promotion writes are marker-addressable and carry per-session origins through consolidation; memory forget purges whole entries and every derived artifact (corpus lines, diary quotes, index/FTS/vec/cache, short-term state, backups), reports curated agent writes from transcripts, and tombstones purged sessions so ingestion, backfill, and transcript indexing never re-admit them.

* docs(memory): document admission policy, memory forget, and provenance boundaries

* fix(memory): open the vec probe through openNodeSqliteDatabase

Kysely guardrail forbids direct node:sqlite constructors in production; the in-memory extension probe now uses the canonical opener.

* fix(memory): resolve archived and explicit sessions in memory forget

Explicit --session selectors union live session windows, transcript archives, and exact unresolved ids so an operator-named session always purges and tombstones instead of silently no-oping after lifecycle archival; reports carry per-session resolution sources. ClawSweeper P1 on #130151.

* fix(memory): reconcile consolidation origins for every workspace agent

Shared workspaces record entry origins per source agent; consolidation now re-keys and prunes origins in each participating agent's database (membership from the authoritative dreaming workspace mapping), so a non-owner agent's later memory forget still finds the live consolidated entry. ClawSweeper re-review P1 on #130151.
2026-08-26 10:57:04 -07:00
44d60a29e6 fix: preserve unread reminder for open sessions (#129386)
* fix: preserve manual unread markers in open sessions

* fix: distinguish explicit session reads

* fix(ui): gate unread contract on gateway capability

* perf(ui): keep server capabilities out of startup bundle

* test(gateway): keep agent fixtures roster-consistent

* fix(sessions): preserve legacy read compatibility

* test(gateway): type agent fixture configs

* fix(ui): remove unread gateway fallback

Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>

* test(infra): avoid fixed SSH tunnel port

* fix(ui): acknowledge unread after history commit

* docs: clarify unread upgrade boundary

* test(ui): drive mobile session menu by tap

* fix(ios): remove stale read reconciliation call

---------

Co-authored-by: roboclaw-bot <309084314+roboclaw-bot@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
2026-08-26 05:04:39 -07:00
Peter Steinberger 49d916e8e9 fix(memory): preserve session recall when upgrading from QMD (#130016)
* fix(memory): preserve QMD session search across builtin migration

* fix(memory): migrate agent defaults to canonical memory owner
2026-08-26 03:18:42 -07:00
Peter Steinberger 4bd8859126 fix(skills): record skill usage again and retire dead curator tables (#129769)
* fix(scripts): see SAFETY comments after template substitutions

The assertion ratchet scanned each file with a raw ts.createScanner, which
reads the `}` closing a template-literal substitution as a block close. The
scanner desynced there, so every `// SAFETY:` comment after a file's first
`${...}` was invisible and its annotated assertions were counted as bare.

Track substitution brace depth and rescan the closing brace the way the parser
does. The fix uncovers already-annotated assertions in eight files, so the
baseline shrinks accordingly.

* fix(skills): record skill usage again and retire dead curator tables

Skill lifecycle curation shipped in 2026.7.1 with two producers: a trusted
`skill.used` consumer writing `skill_usage`, and a daily sweep aging skills
into `skill_lifecycle`. The weekly collection review (#121653) replaced that
policy and deleted both producers, but left every reader in place. Since then
`skill_usage` has had no writer, so curator status reported `lastUsedAtMs:
null` and `useCount: 0` forever, and `skill_lifecycle` had no writer either, so
pin/unpin/restore either threw "not found" on fresh installs or, worse,
"succeeded" on upgraded ones while gating nothing at all.
`skill_workshop_proposal_origin_runs` was never read in any revision; proposal
provenance is authoritative in `record_json`.

Restore the usage producer at its owner and retire what has no owner:

- `skill.used` events populate `skill_usage` again, registered with the
  collection-review maintenance it belongs beside. Curator status derives
  curated skills from applied Workshop create proposals and reports real usage.
- Weekly review receives bounded `useCount` / `lastUsedDaysAgo` evidence, with
  prompt text stating usage supports keeping a procedure and never alone
  justifies a drop.
- State schema 10 drops `skill_lifecycle` and
  `skill_workshop_proposal_origin_runs`. Previously archived skills return to
  the active collection, where review judges them by content; the migration
  logs how many. Reconcile now clears usage only for skills it actually drops.
- `skills.curator.pin`/`unpin`/`restore` stay registered for existing clients
  but fail with an explicit retirement message instead of silently doing
  nothing.

Retirement code moves to openclaw-state-db-table-retirements.ts to keep the
schema-repair module under max-lines; that split is a pure relocation.

Production delta is +23 raw: about -46 for the change itself, +44 for the file
split, +25 for the ratchet fix in the previous commit.
2026-08-26 01:06:06 -07:00
Peter SteinbergerandAmp 0229fe7a2a improve: verify packaged runtime on Bun 1.4 (#129552)
* test: exercise packaged OpenClaw under Bun

Amp-Thread-ID: https://ampcode.com/threads/T-01a037b7-66db-71f0-91e7-1578b383afb2

* docs: align Bun runtime guidance

Amp-Thread-ID: https://ampcode.com/threads/T-01a037b7-66db-71f0-91e7-1578b383afb2

---------

Co-authored-by: Amp <amp@ampcode.com>
2026-08-25 23:41:05 -07:00
Peter Steinberger 3d0df74b0f fix(openshell): sandbox cleanup, workspace sync, and gateway setup failures (#129641)
* fix(openshell): harden sandbox lifecycle and workspace sync

* fix(openshell): preserve shipped workspace root layouts

* test(gateway): reset shared agent harness state between cases

* test(qa): measure channel health startup grace directly

* chore(release): leave changelog updates to release automation
2026-08-25 18:08:55 -07:00
Peter Steinberger 6a246f70d1 refactor(state): retire six dead shared-state tables at schema v10 (#129626)
* refactor(state): retire six dead shared-state tables at schema v10

agent_model_catalogs, android_notification_recent_packages,
command_log_entries, diagnostic_stability_bundles, media_blobs, and
model_capability_cache landed with the database-first squash but their
runtime writers never reached main; every stable since v2026.6.10 created
them empty (agent_model_catalogs held only rebuildable catalog cache rows
until #111173 removed its writer). State schema 10 drops all six tables
and seven indexes through both the runtime-open and doctor migration
paths, records the retirements, bumps the native reader ceiling, and
corrects stale database-first doc claims that still named these tables
as canonical stores.

* test: move cross-lane schema-version pins to v10

The v10 retirement missed current-version pins outside src/state: the
native guard vitest wrapper, placement-move and node-worker-launch
same-version assertions, and the audit outbound-progress tripwire. The
pinned pre-C04 audit reader is a v9-era build that now refuses v10
databases by the version contract, so the test projects the file back to
the exact v9 shape with the documented 10-to-9 downgrade fixture before
the reader proof; the shared fixture also seeds the v10 retirement
regression.

* test: keep only the used downgrade fixture export
2026-08-25 17:31:32 -07:00
Peter Steinberger 6a1dedb00c refactor(agents): remove redundant heartbeat system prompts (#129642)
* refactor(agents): remove redundant heartbeat system prompts

* test(agents): align heartbeat cleanup checks and prompt snapshots
2026-08-25 16:10:22 -07:00
Peter Steinberger 9b7c95a0f0 fix(anthropic): keep automated heartbeats on subscription usage (#129513)
* fix(anthropic): keep automated heartbeats on subscription usage

* test(agents): align retired heartbeat template expectations

* fix(anthropic): avoid heavyweight policy bootstrap imports

* chore(config): prune retired template assertion baseline

* test(vitest): cover Codex startup test family

* refactor(anthropic): remove obsolete thinking-profile re-export
2026-08-25 14:11:38 -07:00
Peter Steinberger 72b06b0077 fix(release): keep polling before decision artifacts exist (#129166)
Handle GitHub's current missing-artifact message without abandoning active full validation, while preserving early blocker decisions. Covers #129104.
2026-08-25 01:55:19 -07:00