



























@@ -115,6 +115,7 @@ async function runAuthContractAttempt(params: {
115115authProfileProvider: string;
116116authProfileOverride: string;
117117cfg?: OpenClawConfig;
118+sessionHasHistory?: boolean;
118119}) {
119120const cfg = params.cfg ?? ({} as OpenClawConfig);
120121const sessionEntry: SessionEntry = {
@@ -154,7 +155,7 @@ async function runAuthContractAttempt(params: {
154155authProfileProvider: params.authProfileProvider,
155156 sessionStore,
156157storePath: params.storePath,
157-sessionHasHistory: false,
158+sessionHasHistory: params.sessionHasHistory ?? false,
158159});
159160160161return {
@@ -403,4 +404,31 @@ describe("Auth profile runtime contract - Pi and CLI adapter", () => {
403404authProfileId: AUTH_PROFILE_RUNTIME_CONTRACT.openAiCodexProfileId,
404405});
405406});
407+408+it("preserves configured Codex harness when a skeleton session entry is considered history", async () => {
409+await runAuthContractAttempt({
410+ tmpDir,
411+ storePath,
412+providerOverride: AUTH_PROFILE_RUNTIME_CONTRACT.openAiProvider,
413+authProfileProvider: AUTH_PROFILE_RUNTIME_CONTRACT.openAiCodexProvider,
414+authProfileOverride: AUTH_PROFILE_RUNTIME_CONTRACT.openAiCodexProfileId,
415+sessionHasHistory: true,
416+cfg: {
417+agents: {
418+list: [
419+{
420+id: "main",
421+embeddedHarness: { runtime: "codex", fallback: "none" },
422+},
423+],
424+},
425+} as OpenClawConfig,
426+});
427+428+expect(runEmbeddedPiAgentMock).toHaveBeenCalledTimes(1);
429+expect(runEmbeddedPiAgentMock.mock.calls[0]?.[0]).toMatchObject({
430+agentHarnessId: "codex",
431+authProfileId: AUTH_PROFILE_RUNTIME_CONTRACT.openAiCodexProfileId,
432+});
433+});
406434});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。