Fix Codex import default mode
This commit is contained in:
@@ -1140,6 +1140,7 @@ test("resumeAgentFromPersistence keeps metadata config, applies overrides, and p
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
expect(client.lastResumeOverrides).toMatchObject({
|
expect(client.lastResumeOverrides).toMatchObject({
|
||||||
|
modeId: "auto",
|
||||||
systemPrompt: "new prompt",
|
systemPrompt: "new prompt",
|
||||||
mcpServers: {
|
mcpServers: {
|
||||||
paseo: {
|
paseo: {
|
||||||
|
|||||||
@@ -791,10 +791,19 @@ export class AgentManager {
|
|||||||
provider: handle.provider,
|
provider: handle.provider,
|
||||||
} as AgentSessionConfig;
|
} as AgentSessionConfig;
|
||||||
const normalizedConfig = await this.normalizeConfig(mergedConfig);
|
const normalizedConfig = await this.normalizeConfig(mergedConfig);
|
||||||
const resumeOverrides =
|
const resumeOverrides: Partial<AgentSessionConfig> = { ...overrides };
|
||||||
normalizedConfig.model !== mergedConfig.model
|
let hasResumeOverrides = overrides !== undefined;
|
||||||
? { ...overrides, model: normalizedConfig.model }
|
|
||||||
: overrides;
|
if (normalizedConfig.model !== mergedConfig.model) {
|
||||||
|
resumeOverrides.model = normalizedConfig.model;
|
||||||
|
hasResumeOverrides = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (normalizedConfig.modeId !== mergedConfig.modeId) {
|
||||||
|
resumeOverrides.modeId = normalizedConfig.modeId;
|
||||||
|
hasResumeOverrides = true;
|
||||||
|
}
|
||||||
|
|
||||||
const launchContext = this.buildLaunchContext(resolvedAgentId);
|
const launchContext = this.buildLaunchContext(resolvedAgentId);
|
||||||
const client = this.requireClient(handle.provider);
|
const client = this.requireClient(handle.provider);
|
||||||
const available = await client.isAvailable();
|
const available = await client.isAvailable();
|
||||||
@@ -803,7 +812,11 @@ export class AgentManager {
|
|||||||
`Provider '${handle.provider}' is not available. Please ensure the CLI is installed.`,
|
`Provider '${handle.provider}' is not available. Please ensure the CLI is installed.`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
const session = await client.resumeSession(handle, resumeOverrides, launchContext);
|
const session = await client.resumeSession(
|
||||||
|
handle,
|
||||||
|
hasResumeOverrides ? resumeOverrides : undefined,
|
||||||
|
launchContext,
|
||||||
|
);
|
||||||
return this.registerSession(session, normalizedConfig, resolvedAgentId, options);
|
return this.registerSession(session, normalizedConfig, resolvedAgentId, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user