Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/drivers/src/sqlserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import type { ConnectionConfig, Connector, ConnectorResult, SchemaColumn } from
export async function connect(config: ConnectionConfig): Promise<Connector> {
let mssql: any
try {
// @ts-expect-error — mssql has no type declarations; installed as optional peerDependency
mssql = await import("mssql")
mssql = mssql.default || mssql
} catch {
Expand Down
6 changes: 5 additions & 1 deletion packages/opencode/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,11 @@ export namespace Config {
}

export async function update(config: Info) {
const filepath = path.join(Instance.directory, "config.json")
// Find an existing project config file, or default to opencode.json.
// ConfigPaths.projectFiles("opencode", ...) looks for opencode.jsonc and opencode.json,
// so we must write to one of those — not config.json which is never loaded by state().
const projectFiles = await ConfigPaths.projectFiles("opencode", Instance.directory, Instance.worktree)
const filepath = projectFiles[projectFiles.length - 1] ?? path.join(Instance.directory, "opencode.json")
const existing = await loadFile(filepath)
await Filesystem.writeJson(filepath, mergeDeep(existing, config))
await Instance.dispose()
Expand Down
2 changes: 1 addition & 1 deletion packages/opencode/test/config/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ test("updates config and writes to file", async () => {
const newConfig = { model: "updated/model" }
await Config.update(newConfig as any)

const writtenConfig = await Filesystem.readJson(path.join(tmp.path, "config.json"))
const writtenConfig = await Filesystem.readJson(path.join(tmp.path, "opencode.json"))
expect(writtenConfig.model).toBe("updated/model")
},
})
Expand Down
Loading