Skip to content
18 changes: 18 additions & 0 deletions packages/opencode/src/cli/cmd/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { Instance } from "../../project/instance"
import type { Hooks } from "@opencode-ai/plugin"
import { Process } from "../../util/process"
import { text } from "node:stream/consumers"
import { Filesystem } from "../../util/filesystem"

type PluginAuth = NonNullable<Hooks["auth"]>

Expand Down Expand Up @@ -214,6 +215,23 @@ export const AuthListCommand = cmd({
const results = Object.entries(await Auth.all())
const database = await ModelsDev.get()

const rawAuth = (await Filesystem.readJson<Record<string, unknown>>(authPath).catch(() => ({}))) as Record<
string,
unknown
>
if (rawAuth.$schema) {
prompts.log.info(`Schema ${UI.Style.TEXT_DIM}${rawAuth.$schema}`)
}

if (rawAuth.provider) {
const providerSection = rawAuth.provider as Record<string, unknown>
for (const [providerID, config] of Object.entries(providerSection)) {
const name = (config as any)?.name || providerID
const hasCredentials = results.some(([id]) => id === providerID)
prompts.log.info(`${name} ${UI.Style.TEXT_DIM}${hasCredentials ? "(configured)" : "(not configured)"}`)
}
}

for (const [providerID, result] of results) {
const name = database[providerID]?.name || providerID
prompts.log.info(`${name} ${UI.Style.TEXT_DIM}${result.type}`)
Expand Down
2 changes: 1 addition & 1 deletion packages/opencode/src/session/processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ export namespace SessionProcessor {
})
const error = MessageV2.fromError(e, { providerID: input.model.providerID })
if (MessageV2.ContextOverflowError.isInstance(error)) {
// TODO: Handle context overflow error
needsCompaction = true
}
const retry = SessionRetry.retryable(error)
if (retry !== undefined) {
Expand Down
2 changes: 1 addition & 1 deletion packages/opencode/src/util/locale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export namespace Locale {
export function datetime(input: number): string {
const date = new Date(input)
const localTime = time(input)
const localDate = date.toLocaleDateString()
const localDate = date.toLocaleDateString("en-CA")
return `${localTime} · ${localDate}`
}

Expand Down
Loading