fix: address Cubic P2 issues in doctor checks and agent overrides
This commit is contained in:
@@ -27,6 +27,10 @@ export function applyCategoryOverride(
|
||||
if (categoryConfig.top_p !== undefined) result.top_p = categoryConfig.top_p
|
||||
if (categoryConfig.maxTokens !== undefined) result.maxTokens = categoryConfig.maxTokens
|
||||
|
||||
if (categoryConfig.prompt_append && typeof result.prompt === "string") {
|
||||
result.prompt = result.prompt + "\n" + categoryConfig.prompt_append
|
||||
}
|
||||
|
||||
return result as AgentConfig
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { existsSync, readFileSync } from "node:fs"
|
||||
import { homedir } from "node:os"
|
||||
import { join } from "node:path"
|
||||
import { parseJsonc } from "../../../shared"
|
||||
import type { AvailableModelsInfo } from "./model-resolution-types"
|
||||
|
||||
function getOpenCodeCacheDir(): string {
|
||||
@@ -18,7 +19,7 @@ export function loadAvailableModelsFromCache(): AvailableModelsInfo {
|
||||
|
||||
try {
|
||||
const content = readFileSync(cacheFile, "utf-8")
|
||||
const data = JSON.parse(content) as Record<string, { models?: Record<string, unknown> }>
|
||||
const data = parseJsonc<Record<string, { models?: Record<string, unknown> }>>(content)
|
||||
|
||||
const providers = Object.keys(data)
|
||||
let modelCount = 0
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import { readFileSync } from "node:fs"
|
||||
import { homedir } from "node:os"
|
||||
import { join } from "node:path"
|
||||
import { detectConfigFile, parseJsonc } from "../../../shared"
|
||||
import { detectConfigFile, getOpenCodeConfigPaths, parseJsonc } from "../../../shared"
|
||||
import type { OmoConfig } from "./model-resolution-types"
|
||||
|
||||
const PACKAGE_NAME = "oh-my-opencode"
|
||||
const USER_CONFIG_DIR = join(homedir(), ".config", "opencode")
|
||||
const USER_CONFIG_BASE = join(USER_CONFIG_DIR, PACKAGE_NAME)
|
||||
const USER_CONFIG_BASE = join(
|
||||
getOpenCodeConfigPaths({ binary: "opencode", version: null }).configDir,
|
||||
PACKAGE_NAME
|
||||
)
|
||||
const PROJECT_CONFIG_BASE = join(process.cwd(), ".opencode", PACKAGE_NAME)
|
||||
|
||||
export function loadOmoConfig(): OmoConfig | null {
|
||||
|
||||
Reference in New Issue
Block a user