mirror of
https://github.com/openclaw/openclaw.git
synced 2026-09-28 05:54:09 +08:00
Cloud session Desktop availability could remain stale after approval, replace an explicitly selected source during placement changes, or lose a dispatched worker to its discovery deadline. Offline Continue on Gateway also needed to retire the exact old owner while retaining cleanup responsibility, and aborted model calls could be reported as ordinary transport failures.
Consolidate Desktop inventory and session updates, retain explicit source/control/popout intent through placement updates, and retire the discovery deadline after dispatch. Move teardown orchestration to its canonical owner, preserve the exact abandonment decision through retries, and keep ordinary reclaim dependent on physical cleanup acknowledgment. Reuse the canonical diagnostic terminal owner and remove the duplicate adapter.
Apply the maintainer-approved, exact-version noVNC 1.7.0 repair: consume ignored extended-clipboard payloads so the following framebuffer message is parsed correctly. Load Desktop-only English with the existing lazy viewer, consolidate package-bin resolution, and register the unchanged retention subprocess with the existing compiled test-fixture owner.
Proof on head 8211f9f3: 57 Desktop unit and 39 real-browser tests; full runtime-change gate plus focused fixture checks; full package/install verification; one real Linux model turn completing five CUA select-all/type cycles with 13 computer results and 20 uninterrupted passive WebVNC observations. Normal reclaim synchronized the exact 300-byte file and completed provider cleanup with no pending reconciliation. Earlier native Windows/macOS, stale-authority and offline-continuation proof retains its original build identity in the PR. The AWS Mac and Dedicated Host remain intentionally retained.
Related: #136018; openclaw/crabbox#1724, openclaw/crabbox#1740, openclaw/crabbox#1743, openclaw/crabbox#1782. No configuration, SQLite schema, or public protocol change. See PR #136297 for dependency provenance, review dispositions, production/test LOC classification, and explicitly unresolved diagnostic follow-ups.
32 lines
1.1 KiB
TypeScript
32 lines
1.1 KiB
TypeScript
import { readFileSync } from "node:fs";
|
|
import { createRequire } from "node:module";
|
|
import path from "node:path";
|
|
import { pathToFileURL } from "node:url";
|
|
|
|
export function resolveNodePackageBin(
|
|
tool: string,
|
|
requireFromPackage: ReturnType<typeof createRequire>,
|
|
): string {
|
|
// Hoisting can leave executable local shims pointing at removed packages.
|
|
// Resolve the declared bin from the caller's actual dependency scope instead.
|
|
const manifestPath = requireFromPackage.resolve(`${tool}/package.json`);
|
|
const { bin } = JSON.parse(readFileSync(manifestPath, "utf8")) as {
|
|
bin: Record<string, string>;
|
|
};
|
|
const entry = bin[tool];
|
|
if (!entry) {
|
|
throw new Error(`${tool} does not declare its executable`);
|
|
}
|
|
return path.resolve(path.dirname(manifestPath), entry);
|
|
}
|
|
|
|
if (import.meta.main) {
|
|
const tool = process.argv[2];
|
|
if (!tool) {
|
|
throw new Error("Usage: node scripts/run-node-package-bin.mts <package> [...args]");
|
|
}
|
|
const entry = resolveNodePackageBin(tool, createRequire(path.resolve("package.json")));
|
|
process.argv.splice(1, 2, entry);
|
|
await import(pathToFileURL(entry).href);
|
|
}
|