Revert "Merge pull request #2797 from code-yeongyu/fix/2353-model-selection-persistence"

This reverts commit e691303919, reversing
changes made to d4aee20743.
This commit is contained in:
YeonGyu-Kim
2026-03-24 17:59:21 +09:00
parent e691303919
commit 4bba924dad
2 changed files with 1 additions and 83 deletions

View File

@@ -2,10 +2,8 @@ import { createBuiltinAgents } from "../agents";
import { createSisyphusJuniorAgentWithOverrides } from "../agents/sisyphus-junior";
import type { OhMyOpenCodeConfig } from "../config";
import { log, migrateAgentConfig } from "../shared";
import { getMainSessionID } from "../features/claude-code-session-state";
import { AGENT_NAME_MAP } from "../shared/migration";
import { getAgentDisplayName } from "../shared/agent-display-names";
import { getSessionModel } from "../shared/session-model-state";
import {
discoverConfigSourceSkills,
discoverOpencodeGlobalSkills,
@@ -29,28 +27,6 @@ type AgentConfigRecord = Record<string, Record<string, unknown> | undefined> & {
plan?: Record<string, unknown>;
};
function resolveCurrentModel(config: Record<string, unknown>): string | undefined {
const configModel = config.model;
if (typeof configModel === "string") {
const trimmedModel = configModel.trim();
if (trimmedModel.length > 0) {
return trimmedModel;
}
}
const mainSessionID = getMainSessionID();
if (!mainSessionID) {
return undefined;
}
const sessionModel = getSessionModel(mainSessionID);
if (!sessionModel?.providerID || !sessionModel.modelID) {
return undefined;
}
return `${sessionModel.providerID}/${sessionModel.modelID}`;
}
function getConfiguredDefaultAgent(config: Record<string, unknown>): string | undefined {
const defaultAgent = config.default_agent;
if (typeof defaultAgent !== "string") return undefined;
@@ -101,7 +77,7 @@ export async function applyAgentConfig(params: {
const browserProvider =
params.pluginConfig.browser_automation_engine?.provider ?? "playwright";
const currentModel = resolveCurrentModel(params.config);
const currentModel = params.config.model as string | undefined;
const disabledSkills = new Set<string>(params.pluginConfig.disabled_skills ?? []);
const useTaskSystem = params.pluginConfig.experimental?.task_system ?? false;
const disableOmoEnv = params.pluginConfig.experimental?.disable_omo_env ?? false;