mirror of
https://github.com/openclaw/openclaw.git
synced 2026-10-03 01:29:56 +00:00
* fix(update): preserve configuration and verify upgrade recovery Prefer npm before ClawHub only among declared plugin identities, preserving explicit source/version intent, artifact integrity and capability consent. Keep the exact installed beta cohort and require typed target absence before fallback. Preserve authored environment references through both Doctor writers, resolve snapshot destinations at operation time, and keep migration-only metadata out of redacted snapshots. Avoid loading channel runtimes for unused pairing account facts while retaining captured migration-owner attribution. Record activation safety at package/Git mutation boundaries. Keep installed-CLI recovery, verify runtime/native-service identity, fence Windows autostart, preserve child status, and avoid duplicating consumed notifications or rejecting completed install switches. Surface update-specific disconnect diagnostics without changing explicit-restart guidance in Model Setup. Retain the upgrade-survivor first-hop, approval and installed-version oracles. Repair CI's type-only Doctor cycle and stale source-policy, final-Doctor and Teams whitespace expectations without weakening timeouts, gates or the main-owned Markdown fix. PR: https://github.com/openclaw/openclaw/pull/134490 * test(msteams): align the corrected main whitespace fixture * perf(ui): remove unreachable update translations Remove superseded version-only verification copy and the unused idle label from the eager catalog. Keep identity-aware verification and all recovery guidance unchanged, align translation fixtures, and restore the existing merged startup budget without increasing its baseline or limits. * fix(update): retain consent failures and isolate validation homes Carry unresolved non-retained plugin capability refusals from missing-install repair through post-core convergence as typed outcomes, preserving the existing update failure and restart boundary. Keep usable retained artifacts and transient fetch failures on their existing notice/warning paths. Give test invocations a native process HOME before config imports and worker creation. Preserve bounded live/profile context, report selection, installed tool caches, and process-group/pipe-owned namespace cleanup or truthful retention. Keep unknown or mixed explicit real-home selections closed. Resolve the repo-owned staging helper from its owning cwd and await complete PID readiness before cancelling native report fixtures. Align the survivor recovery oracle with typed consent errors that intentionally have no Doctor reason. Preserve strict plugin/code/version/core-step checks and historical warning-only reports; successful-update admission still rejects refusals. Keep the local TestHomeMode alias private and satisfy helper lint. PR: https://github.com/openclaw/openclaw/pull/134490 * fix(plugins): preserve declared catalog identity during upgrade integration Carry the prepared, provenance-validated ClawHub package instead of discarding it into a boolean. Suppress the declared installed counterpart without deriving an npm identity from overlaid display metadata or hiding an npm namesake. Keep lazy prepared catalog facts and first-normalized-record icon behavior. Retain explicit ClawHub-only actions and npm-first dual-source actions, and cover the selected source's pinned inspection metadata with existing tables. The incoming duplicate-row cases fail before the provenance fact is retained. PR: https://github.com/openclaw/openclaw/pull/134490 * fix(ci): include home isolation in PR anchor closure Register the three runtime dependencies in the canonical extraction and trust inventory. Extracted planners and publishers now load the real home policy, context, and selection modules without stubs or weaker assertions. The existing extracted-anchor regression fails before this change and the full wrapper suite passes afterward. * fix(update): hand failed upgrades to local coding agents Route interactive update failures through triage after updater ownership is released. Preserve the captured installation, invocation directory, bounded diagnostics and original update result while the installed coding agent repairs and verifies the machine using its existing permissions. Keep background and JSON guidance consistent, preserve config references, and fix resolved consent failures and selected catalog source provenance. Validation: complete combined P2 review, 639 focused tests, 71 UI unit tests, and four Chromium scenarios passed. Full changed-code checks passed all typegraphs but stopped on one no-map-spread lint error in a test fixture. Local integration checkpoint: fix that fixture and combine the current main triage owner before final review, package proof, publication, or landing. * fix(update): preserve configuration and verify upgrade recovery Prefer npm before ClawHub only among declared plugin identities, preserving explicit source/version intent, artifact integrity and capability consent. Keep the exact installed beta cohort and require typed target absence before fallback. Preserve authored environment references through both Doctor writers, resolve snapshot destinations at operation time, and keep migration-only metadata out of redacted snapshots. Avoid loading channel runtimes for unused pairing account facts while retaining captured migration-owner attribution. Record activation safety at package/Git mutation boundaries. Keep installed-CLI recovery, verify runtime/native-service identity, fence Windows autostart, preserve child status, and avoid duplicating consumed notifications or rejecting completed install switches. Surface update-specific disconnect diagnostics without changing explicit-restart guidance in Model Setup. Retain the upgrade-survivor first-hop, approval and installed-version oracles. Repair CI's type-only Doctor cycle and stale source-policy, final-Doctor and Teams whitespace expectations without weakening timeouts, gates or the main-owned Markdown fix. PR: https://github.com/openclaw/openclaw/pull/134490 * test(msteams): align the corrected main whitespace fixture * perf(ui): remove unreachable update translations Remove superseded version-only verification copy and the unused idle label from the eager catalog. Keep identity-aware verification and all recovery guidance unchanged, align translation fixtures, and restore the existing merged startup budget without increasing its baseline or limits. * fix(update): retain consent failures and isolate validation homes Carry unresolved non-retained plugin capability refusals from missing-install repair through post-core convergence as typed outcomes, preserving the existing update failure and restart boundary. Keep usable retained artifacts and transient fetch failures on their existing notice/warning paths. Give test invocations a native process HOME before config imports and worker creation. Preserve bounded live/profile context, report selection, installed tool caches, and process-group/pipe-owned namespace cleanup or truthful retention. Keep unknown or mixed explicit real-home selections closed. Resolve the repo-owned staging helper from its owning cwd and await complete PID readiness before cancelling native report fixtures. Align the survivor recovery oracle with typed consent errors that intentionally have no Doctor reason. Preserve strict plugin/code/version/core-step checks and historical warning-only reports; successful-update admission still rejects refusals. Keep the local TestHomeMode alias private and satisfy helper lint. PR: https://github.com/openclaw/openclaw/pull/134490 * fix(plugins): preserve declared catalog identity during upgrade integration Carry the prepared, provenance-validated ClawHub package instead of discarding it into a boolean. Suppress the declared installed counterpart without deriving an npm identity from overlaid display metadata or hiding an npm namesake. Keep lazy prepared catalog facts and first-normalized-record icon behavior. Retain explicit ClawHub-only actions and npm-first dual-source actions, and cover the selected source's pinned inspection metadata with existing tables. The incoming duplicate-row cases fail before the provenance fact is retained. PR: https://github.com/openclaw/openclaw/pull/134490 * fix(ci): include home isolation in PR anchor closure Register the three runtime dependencies in the canonical extraction and trust inventory. Extracted planners and publishers now load the real home policy, context, and selection modules without stubs or weaker assertions. The existing extracted-anchor regression fails before this change and the full wrapper suite passes afterward. * fix(test): preserve source home when loading profiles Read the explicitly selected profile with a non-login Bash command so system and user login startup cannot replace the source HOME first. Keep positional profile quoting, child-only HOME/USERPROFILE, existing profile opt-in and test/native-home isolation unchanged. The existing six profile-home matrix cases failed on Linux CI run 33536959196, job 99953769387. New exact-head Linux CI remains required; this local repair does not refresh or admit the prior native proof. PR: https://github.com/openclaw/openclaw/pull/134490 * fix(update): complete failure triage integration Keep landed failure diagnosis after recovery and cleanup decisions without letting diagnostic exports authorize activation or overwrite updater exits. Preserve exact unsafe handoff and nested foreground results, consumed notifications, successful install-root switches, typed consent failures and update-specific disconnected guidance alongside main's triage takeover. Contain diagnostic read failures inside the diagnostic owner so a completed recovery still releases its lease and sensitive files. Retain phase-labelled updater, recovery and diagnostic exits plus helper terminal completion. Remove the trivial aggregate-error wrapper while preserving both failures, and consolidate launchd/notification coverage into canonical test support. Focused CLI, Doctor, handoff, UI and profile-home proof passed under external synthetic homes. Complete integrated P0 review is scoped-clean; exact-head Linux CI and native/package qualification remain with the parent workflow. The unchanged main models-cli auth-login test-type error remains a follow-up. PR: https://github.com/openclaw/openclaw/pull/134490 * test(update): split Doctor and service recovery fixtures Move the existing Windows Doctor recovery matrix and shared fixtures into focused files, and keep managed terminal-outcome tests in their existing result helper. Preserve all case bodies, assertions, and hook cleanup. Keep Windows restore failure in a local variable and narrow the triage prompt-write fixture path before string matching. Scoped type-aware lint, all affected existing suites, and independent follow-up review pass. The full repository gate and final packaged Crabbox recovery and upgrade proof remain required before landing. * fix(update): retain plugin attempt spec on consent failure * test(update): preserve runtime exports in option mocks --------- Co-authored-by: Jason (Json) <263060202+fuller-stack-dev@users.noreply.github.com>
51 lines
2 KiB
TypeScript
51 lines
2 KiB
TypeScript
// Shared by native launchers and worker setup; keep this closure free of application imports.
|
|
type TestHomeMode = "hermetic" | "live-aware";
|
|
export type TestHomeSelection = TestHomeMode | "mixed" | "unknown";
|
|
|
|
export function combineTestHomeSelections(modes: readonly TestHomeSelection[]): TestHomeSelection {
|
|
const unique = new Set(modes);
|
|
if (unique.size === 0 || unique.has("unknown")) {
|
|
return "unknown";
|
|
}
|
|
return unique.size === 1 ? [...unique][0]! : "mixed";
|
|
}
|
|
|
|
export const LIVE_TEST_TRIGGER_ENV_KEYS = [
|
|
"LIVE",
|
|
"OPENCLAW_LIVE_TEST",
|
|
"OPENCLAW_LIVE_GATEWAY",
|
|
] as const;
|
|
|
|
export function isTruthyTestEnvValue(value: string | undefined): boolean {
|
|
return Boolean(value && !["", "0", "false", "no", "off"].includes(value.trim().toLowerCase()));
|
|
}
|
|
|
|
export function resolveTestHomePolicy(
|
|
env: NodeJS.ProcessEnv,
|
|
mode: TestHomeSelection = "live-aware",
|
|
loadProfileEnv?: boolean,
|
|
) {
|
|
const hermetic = mode === "hermetic";
|
|
const live = !hermetic && LIVE_TEST_TRIGGER_ENV_KEYS.some((key) => env[key] === "1");
|
|
const allowRealHome = !hermetic && isTruthyTestEnvValue(env.OPENCLAW_LIVE_USE_REAL_HOME);
|
|
return {
|
|
hermetic,
|
|
live,
|
|
allowRealHome,
|
|
loadProfileEnv: !hermetic && (loadProfileEnv ?? (live || allowRealHome)),
|
|
};
|
|
}
|
|
|
|
export function assertTestHomeSelection(env: NodeJS.ProcessEnv, mode: TestHomeSelection): void {
|
|
const policy = resolveTestHomePolicy(env, mode);
|
|
if (policy.live && policy.allowRealHome && mode !== "live-aware") {
|
|
throw new Error(
|
|
"[vitest] explicit real-home live execution requires a known wholly live-aware selection; " +
|
|
`the selection is ${mode}. Run hermetic tests without LIVE, OPENCLAW_LIVE_TEST, ` +
|
|
"OPENCLAW_LIVE_GATEWAY and OPENCLAW_LIVE_USE_REAL_HOME " +
|
|
"(node scripts/run-vitest.mjs <test-path>), then run the intended live selection " +
|
|
"separately with node scripts/test-live.mts -- <live-test-path>. " +
|
|
"Custom configs are not evaluated to establish home policy.",
|
|
);
|
|
}
|
|
}
|