mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 10:21:24 +00:00
fix: run BOOT.md for each configured agent at startup (#20569)
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: 9098a4cc64
Co-authored-by: mcaxtr <7562095+mcaxtr@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
@@ -7,6 +7,7 @@ import { agentCommand } from "../commands/agent.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import {
|
||||
resolveAgentIdFromSessionKey,
|
||||
resolveAgentMainSessionKey,
|
||||
resolveMainSessionKey,
|
||||
} from "../config/sessions/main-session.js";
|
||||
import { resolveStorePath } from "../config/sessions/paths.js";
|
||||
@@ -138,6 +139,7 @@ export async function runBootOnce(params: {
|
||||
cfg: OpenClawConfig;
|
||||
deps: CliDeps;
|
||||
workspaceDir: string;
|
||||
agentId?: string;
|
||||
}): Promise<BootRunResult> {
|
||||
const bootRuntime: RuntimeEnv = {
|
||||
log: () => {},
|
||||
@@ -157,7 +159,9 @@ export async function runBootOnce(params: {
|
||||
return { status: "skipped", reason: result.status };
|
||||
}
|
||||
|
||||
const sessionKey = resolveMainSessionKey(params.cfg);
|
||||
const sessionKey = params.agentId
|
||||
? resolveAgentMainSessionKey({ cfg: params.cfg, agentId: params.agentId })
|
||||
: resolveMainSessionKey(params.cfg);
|
||||
const message = buildBootPrompt(result.content ?? "");
|
||||
const sessionId = generateBootSessionId();
|
||||
const mappingSnapshot = snapshotMainSessionMapping({
|
||||
|
||||
Reference in New Issue
Block a user