mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-23 23:41:15 +00:00
* perf(sdk): load Claude CLI identity from a narrow plugin artifact src/plugin-sdk/anthropic-cli.ts snapshots CLAUDE_CLI_BACKEND_ID at module scope through the sync facade loader, which jiti-evaluates the full anthropic api.js barrel on source checkouts: 130.86s of self time per cold worker on CI (Testbox import profile), silently stalling every job whose graph reaches cli-runner/prepare.ts. A narrow cli-api.js artifact carries the two static facts; Testbox proof: the reliability+helpers agents-core pair drops from 157.6s to 14.3s. * perf(ci): stripe unit-fast and tooling node tests on the full plan core-fast ran the import-bound unit-fast graph as one job (247s vitest, 181s module evaluation) and core-tooling as one serial job (241s); both now stripe on the full plan like the compact plan, so the compact-only expansion is deleted and the docker helper config rides with the isolated shard on both plans. Group hints refreshed from main run 29551077288; stale per-file commands hints dropped (the consolidation landed); cache-writer selection and the warm workflow track the stripe names. * fix(state): tolerate vanished sqlite sidecars in agent-db permission sweep existsSync+chmodSync raced SQLite's own WAL/SHM cleanup: a checkpoint or close between the two calls throws ENOENT (observed from the transcript reconcile worker in server-startup-web-fetch-bind on CI). chmod directly and swallow only ENOENT, which removes the TOCTOU window.
23 lines
1023 B
TypeScript
23 lines
1023 B
TypeScript
// Manual facade. Keep loader boundary explicit.
|
|
import { loadBundledPluginPublicSurfaceModuleSync } from "./facade-loader.js";
|
|
|
|
type FacadeModule = {
|
|
CLAUDE_CLI_BACKEND_ID: string;
|
|
isClaudeCliProvider: (providerId: string) => boolean;
|
|
};
|
|
|
|
function loadFacadeModule(): FacadeModule {
|
|
// cli-api.js, not api.js: this facade evaluates at module scope, and the
|
|
// full barrel costs ~130s per cold jiti worker on source checkouts.
|
|
return loadBundledPluginPublicSurfaceModuleSync<FacadeModule>({
|
|
dirName: "anthropic",
|
|
artifactBasename: "cli-api.js",
|
|
});
|
|
}
|
|
/** Anthropic plugin backend id for Claude CLI provider detection. */
|
|
export const CLAUDE_CLI_BACKEND_ID: FacadeModule["CLAUDE_CLI_BACKEND_ID"] =
|
|
loadFacadeModule()["CLAUDE_CLI_BACKEND_ID"];
|
|
/** Returns whether a provider id belongs to the Claude CLI backend family. */
|
|
export const isClaudeCliProvider: FacadeModule["isClaudeCliProvider"] = ((...args) =>
|
|
loadFacadeModule()["isClaudeCliProvider"](...args)) as FacadeModule["isClaudeCliProvider"];
|