fix(usage): find Go logins in the configured data directory

Resolve relative database overrides against the OpenCode data directory so usage discovery follows the same store as the CLI.

Co-authored-by: Ivan Pantic <panta@talentkit.io>
This commit is contained in:
paseo-bot[bot]
2026-11-04 03:27:55 +00:00
co-authored by Ivan Pantic
parent 0ac8175015
commit 02168446fb
2 changed files with 30 additions and 2 deletions
@@ -28,7 +28,7 @@ const keySchema = z.object({ type: z.literal("key"), key: z.string().min(1) });
export function defaultStorePaths(env: NodeJS.ProcessEnv = process.env): StorePaths {
const dataHome = env.XDG_DATA_HOME || join(env.HOME || homedir(), ".local", "share");
const directory = join(dataHome, "opencode");
const database = env.OPENCODE_DB ? resolve(env.OPENCODE_DB) : join(directory, "opencode.db");
const database = resolve(directory, env.OPENCODE_DB || "opencode.db");
return { file: join(directory, "auth.json"), database };
}