mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
Add config sync mode to prevent config file overwrites on startup (#63)
Fixes #62 - Config file in workspace volume is now the source of truth * Preserve raw config content with comments instead of re-stringifying parsed JSON * Sync provider credentials to OpenCode server when adding or removing API keys * Add error handling for session errors with toast notifications and inline message display * Refactor provider settings to manage API keys directly with edit/delete support
This commit is contained in:
1 parent
f3505de0e1
commit
078fbd1a05
13 files changed
+605
-240
No files matched your search
@@ -0,0 +1,37 @@
|
||||
import { memo } from 'react'
|
||||
import { AlertCircle, KeyRound, XCircle, Clock } from 'lucide-react'
|
||||
import { parseOpenCodeError, type OpenCodeError } from '@/lib/opencode-errors'
|
||||
|
||||
interface MessageErrorProps {
|
||||
error: OpenCodeError
|
||||
}
|
||||
|
||||
const getErrorIcon = (errorName: string) => {
|
||||
switch (errorName) {
|
||||
case 'ProviderAuthError':
|
||||
return KeyRound
|
||||
case 'MessageAbortedError':
|
||||
return XCircle
|
||||
case 'MessageOutputLengthError':
|
||||
return Clock
|
||||
default:
|
||||
return AlertCircle
|
||||
}
|
||||
}
|
||||
|
||||
export const MessageError = memo(function MessageError({ error }: MessageErrorProps) {
|
||||
const parsed = parseOpenCodeError(error)
|
||||
if (!parsed) return null
|
||||
|
||||
const Icon = getErrorIcon(error.name)
|
||||
|
||||
return (
|
||||
<div className="flex items-start gap-2 p-3 rounded-md bg-destructive/10 border border-destructive/30 text-destructive">
|
||||
<Icon className="h-4 w-4 mt-0.5 flex-shrink-0" />
|
||||
<div className="flex-1 min-w-0">
|
||||
<div className="font-medium text-sm">{parsed.title}</div>
|
||||
<div className="text-xs text-destructive/80 mt-0.5">{parsed.message}</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
Reference in new issue
Block a user