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>
* fix(maintainers): prevent duplicate merges after ambiguous responses
Retain exact native merge intent across process-lock recovery and record completion before comments or cleanup. Reconcile uncertain outcomes without replaying a mutation. Fixes#132138.
* fix(maintainers): validate rebase merge receipts
Bind rebase and queue results to the retained source fork base, verify merge content as well as ancestry, and align routing regressions with the split test owners. Addresses the review and CI failures for #132173.
* test(maintainers): distinguish cherry-picked fixture commits
* fix(active-memory): exclude error payloads from recall context
* fix(active-memory): prioritize failed recall status
* test(active-memory): cover failed recall cleanup and gateway flow
Co-authored-by: soltonigiri <kano.nests@gmail.com>
* test(active-memory): diagnose cleanup rejection and gateway startup
Co-authored-by: soltonigiri <kano.nests@gmail.com>
* fix(active-memory): preserve recall failures through timeout cleanup
Carry terminal and cleanup failure facts through the canonical partial-result
owner so timeout recovery cannot inject earlier memory from failed recall.
Preserve legitimate partial recovery, original cleanup errors and contributor
payload filtering. Cover direct recovery and declare the real Gateway test's
existing built-runtime prerequisite.
Co-authored-by: soltonigiri <kano.nests@gmail.com>
* fix(active-memory): finish cleanup and built Gateway verification
Name the canonical cleanup operation without changing error propagation, align the strict CI prerequisite expectation, and run the real recall proof through an isolated exact-build Gateway process. Preserve all behavioral assertions and deadlines; hosted verification remains required.
Co-authored-by: soltonigiri <kano.nests@gmail.com>
* test(active-memory): exercise authorized chat recall
Use the public interactive chat route, which supplies canonical turn tool authority, for the built Gateway recall regression. Preserve the real provider, memory, failed-status, prompt-isolation, and history assertions and their deadlines.
Co-authored-by: soltonigiri <kano.nests@gmail.com>
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
Co-authored-by: soltonigiri <kano.nests@gmail.com>
* fix(agents): restore prepared collector and harness execution
Carry collector output and noninteractive policy through shared tool
preparation. Register Copilot during discovery, initialize selected direct
credentials, retain canonical session IDs, and preserve failed-turn errors.
Keep retained catalog callbacks bound to their owner generation rather
than an expired publication transaction.
Cover the owner boundaries with failing/passing regressions and real
native, Codex, and Copilot Gateway runs, including credential recovery and
same-process worker-policy reloads. Reuse the native auth test fixture
instead of reloading the complete runner in every case.
Fixes#131552Fixes#131580Fixes#131591Fixes#131699Fixes#131700Fixes#131701
Thanks to @tmill313 for the original Codex collector report in #120077.
* test(agents): keep collector proofs on owned boundaries
Move real collector-tool and prepared-registry integration proof to core,
retain independent plugin SDK handoff regressions, and select the host
Copilot integration for plugin-only changes. Run the existing plugin-test
core-import guard in changed-file checks so local validation catches the
same boundary violation as CI.
The replacement regressions fail against their pre-fix owners. All 505
focused tests, the exact import guard, and the changed-file gate pass.
Independent review found no actionable P0-P2 findings. Runtime repair files
are unchanged.
* test(agents): load prepared harness through its public boundary
Evaluate the real Copilot entrypoint through the existing public-surface
loader and module-loader seam instead of importing plugin implementation
into the core typegraph. Remove the synthetic entrypoint and registration
global, while retaining real discovery and lazy-store assertions.
Include the existing core tsgo graph boundary in changed-file checks and
cover its ordinary and live-Docker routing paths.
* test(mcp): seed canonical SQLite session history
Use the installed candidate's public session APIs instead of creating
legacy session files rejected by doctor-only startup. Preserve message IDs,
parent ordering, delivery context, and canonical attachment metadata.
Add a built-SDK fixture regression using real SQLite reads and startup
validation. The full MCP client remains covered by the Docker CI lane.
* test(gateway): preserve queued writes across RPC fixtures
Stop clearing session writer queues before ordinary RPCs. Config fixtures
still synchronize, while canonical writers retain their own cache updates.
Prove queued-write ordering through a real connected Gateway against a raw
WebSocket control, and dispose the custom test database before file removal.
Preserve the underlying cause of the settlement timeout. That CI failure
was not reproduced on the exact synthetic merge locally; the independent
queue-reset defect is not being claimed as its established cause.
* test(agents): keep harness fixture coverage on focused boundaries
* test(imap): await committed watcher initialization
* perf(agents): index agent-event listeners by run instead of walking every run's closures
emitAgentEvent notified one process-global listener Set. Five subscribers
register a listener whose first statement discards other runs, so at N
concurrent runs every assistant delta walked N run-scoped closures to do useful
work in one of them - O(N) per delta, O(N^2) fleet-wide.
Add a runListeners bucket beside the global Set plus onAgentEventForRun, and
convert the five per-run sites (openai-http, openresponses-http,
cli-backend-dispatch, system-agent/agent-turn, acp-spawn-parent-stream), keeping
their runId guard as a harmless second check. Globals are notified first and
keep stock ordering; empty buckets are dropped on unsubscribe.
agent-job.ts stays global: it filters on stream, not runId.
* perf: route the shared CLI delivery bridge and approval wait through the run bucket
createAgentEventBridge and observeAgentRunApprovalWait still subscribed with
onAgentEvent and discarded foreign runs as their first action, so they kept the
per-delta cost this branch removes. The bridge is the highest-volume instance:
one CLI dispatch builds eight bridges from that shared factory, so N concurrent
runs left 8N run-filtered closures on the global set.
Both now subscribe with onAgentEventForRun. Their runId guards stay as a
fail-closed second check, matching the six sites already converted here.
Five remaining onAgentEvent callers are genuinely process-global (agent-job,
subagent registry, task registry lifecycle, plugin runtime bridge, TUI backend)
and are left alone.
* test(gateway): cover concurrent streamed agent events
Exercise token-authenticated Chat Completions and Responses streams through
the real Gateway, agent loop, local provider, WebSocket events, and agent.wait.
Expose existing startup diagnostics within the isolated test fixture.
Keep approval-wait subscriptions on the existing global path pending owner
review. This reduces the converted listeners' fanout but does not close the
remaining concurrency-dependent fanout issue.
Co-authored-by: Tran Quang <randytran8800@gmail.com>
* test: capture agent event ordering regressions
Exercise nested emission and unsubscribe through the real delivery bridge.
Prepare the existing runtime artifacts for the concurrent Gateway proof,
and correct its lint and formatting failures without changing its budget.
This diagnostic stage intentionally preserves the candidate dispatcher
until CI captures the ordering regressions; it is not ready to land.
Co-authored-by: Tran Quang <randytran8800@gmail.com>
* fix: preserve live order in run-indexed agent events
Merge global and matching-run subscriptions by registration order while
preserving live mutations, nested dispatch, and unsubscribe semantics.
Cover the observed delivery regressions and interleaved bridge isolation.
Run the authenticated concurrent-stream proof through the existing built
Gateway process harness with exact-checkout artifact provenance.
Related: #129173
Co-authored-by: Tran Quang <randytran8800@gmail.com>
* style: satisfy event dispatch lint rules
Use non-mutating sorting for the fresh listener cohort, initialize the
unsubscribe binding at its existing assignment, and distinguish unused
mapper parameters without changing the proved behavior or assertions.
Co-authored-by: Tran Quang <randytran8800@gmail.com>
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
Co-authored-by: Tran Quang <randytran8800@gmail.com>
* 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
* fix(onboard): honor secret-input-mode ref for the generated gateway token
`openclaw onboard --secret-input-mode ref` was silently ignored for
`gateway.auth.token`: onboarding generated the token and wrote it into
`openclaw.json` as a plaintext string, so `openclaw doctor` warned about
`gateway.auth.token` on the install it had just created. The flag was
honored for provider credentials, so an operator who explicitly opted into
references still ended up with a plaintext secret and a remediation
(`openclaw secrets configure`) that cannot migrate a self-generated value,
because it validates a ref by resolving one that already exists.
Setup mints this token itself, so reference mode now provisions it:
- an ambient OPENCLAW_GATEWAY_TOKEN keeps an `env` ref to that variable, so a
later rotation stays authoritative instead of being pinned by a stale copy
- anything else (freshly generated, or an existing plaintext token being
migrated) goes into the shared SQLite secret store as a write-only `secret`
entry, with config holding only `{source:"store",...}`
An existing store entry wins over a freshly generated one, so reruns never
rotate a token already paired with clients. The store write precedes the
config write: a ref persisted without its value would leave the gateway
unauthenticatable, while an orphaned entry is reused by the next run.
The interactive wizard had the same dead end and is fixed the same way.
Default (plaintext) onboarding is unchanged.
User impact: `--secret-input-mode ref` now keeps the gateway token out of
openclaw.json, and a fresh install no longer self-reports a plaintext-secret
warning.
* test(onboard): split gateway onboarding suite under the max-lines gate
The added gateway auth-token tests pushed
onboard-non-interactive.gateway.test.ts to 1014 lines, over the max-lines
limit (check-lint-core-3). Repo policy is to split, never suppress.
Extract the shared vi.mock/harness preamble into
onboard-non-interactive.gateway.test-mocks.ts, following the existing
agent-command.test-mocks.ts pattern, and move the four gateway auth-token
storage tests into their own suite. The reachability mock becomes a holder
object so both suites can swap it across the module boundary, and hoisted
mocks are re-exported in a separate export clause because Vitest rejects
exporting a vi.hoisted binding at its declaration.
Test set is unchanged: the it-declaration multiset matches the pre-split
file exactly, with no duplication across the two suites.
* test(onboard): give the shared gateway onboarding mocks unique export names
check-export-name-collisions flagged `runtime` and `readConfigFileSnapshotMock`
as colliding with program.test-mocks.ts and plugins-cli-test-helpers.ts once the
gateway onboarding preamble became a shared module. Rename the exports to
gatewayOnboardRuntime / gatewayOnboardConfigSnapshotMock per the repo's
unique-export-name rule; suites alias them locally so the assertions read the
same as before.
* test(tooling): route the new gateway auth-token suite from its test helper
test-projects asserts which suites a change to
onboard-non-interactive.test-helpers.ts should run. The new
onboard-non-interactive.gateway-auth-token.test.ts imports that helper, so it
belongs in the expected routing plan.
* fix(ci): stop codex lane cold-graph hangs
The side-question domain-policy test loaded the complete agent-harness tool graph inside a one-second readiness race, making the serial non-isolated Codex shard fail or stay silent under cold imports. Build the test's web_search marker and real web_fetch tool from the narrow implementation, then synchronize on turn startup before issuing the tool call. Cap each Codex test process at 12 files so CI gets bounded time-to-first-output as defense in depth.\n\nRefs #125839
* fix(test): keep codex web fetch fixture on sdk boundary
Load the real web_fetch factory on demand through the existing local-only plugin test runtime. This preserves the narrow cold-graph fix without letting a bundled plugin test reach into core internals.
* fix(agents): finalize guided creation safely
Run channel post-write hooks only after config publication, defer portable auth copying until agent creation succeeds without overwriting newer credentials, and provision existing workspaces before publishing updates.
Keep JSON-only guided creation interactive while routing wizard output to stderr so stdout remains one machine-readable summary.
* fix(terminal): preserve note call signature
* fix(agents): pass committed config to setup hooks
* ci: split heavy codex changed-test shards
Cap non-isolated Codex extension processes at 20 files so 4-vCPU changed-target jobs do not starve real-time watches or hit the no-output watchdog.
* test(ci): align codex shard cap fixture
* docs(cli): clarify agents add JSON mode
Five-file Telegram jobs finished the first file, then isolate re-imported the next graph in silence until the 300s watchdog killed the worker. Recycle the Vitest process after each file and keep five files per CI job.
Preserve externally scoped Telegram and Matrix test plans instead of expanding each CI shard back into the full extension suite. Keep broad runs bounded and retain external include ownership through directory run specs.
Co-authored-by: Ayaan Zaidi <hi@obviy.us>
Bound Telegram extension tests to five files per Vitest process across explicit config, directory, and full-suite routes while preserving serial isolated execution.
Co-authored-by: Ayaan Zaidi <hi@obviy.us>
Move llama.cpp chat and local embeddings onto a verified externally managed llama-server runtime. Remove the in-process native runtime, forked embedding workers, and node-llama-cpp dependency while preserving guided setup, local GGUF models, tool-capable agent runs, diagnostics, and operator docs.