Files
openclaw/src/agents/bootstrap-mode.ts
Tak Hoffman 62703d8430 fix(bootstrap): workspace bootstrap prompt routing (#68000)
* fix(bootstrap): workspace bootstrap prompt routing

* Fix bootstrap routing edge cases

* Refine bootstrap mode routing and reset prompts

* Fix bootstrap workspace routing for embedded runs

* Fix embedded bootstrap compile follow-up

* Align bare reset bootstrap file access

* Honor reset override model for bootstrap gating

* Align chat reset bootstrap topology
2026-04-17 10:18:50 -05:00

25 lines
690 B
TypeScript

export type BootstrapMode = "full" | "limited" | "none";
export function resolveBootstrapMode(params: {
bootstrapPending: boolean;
runKind?: "default" | "heartbeat" | "cron";
isInteractiveUserFacing: boolean;
isPrimaryRun: boolean;
isCanonicalWorkspace: boolean;
hasBootstrapFileAccess: boolean;
}): BootstrapMode {
if (!params.bootstrapPending) {
return "none";
}
if (params.runKind === "heartbeat" || params.runKind === "cron") {
return "none";
}
if (!params.isPrimaryRun || !params.isInteractiveUserFacing) {
return "none";
}
if (!params.hasBootstrapFileAccess) {
return "none";
}
return params.isCanonicalWorkspace ? "full" : "limited";
}