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
@@ -8,6 +8,8 @@ import type {
|
||||
ContentPart,
|
||||
} from "../api/types";
|
||||
import type { paths, components } from "../api/opencode-types";
|
||||
import { parseNetworkError } from "../lib/opencode-errors";
|
||||
import { showToast } from "../lib/toast";
|
||||
|
||||
const titleGeneratingSessionsState = new Set<string>();
|
||||
const titleGeneratingListeners = new Set<() => void>();
|
||||
@@ -322,12 +324,18 @@ export const useSendPrompt = (opcodeUrl: string | null | undefined, directory?:
|
||||
|
||||
return { optimisticUserID, response, userPromptText };
|
||||
},
|
||||
onError: (_, variables) => {
|
||||
onError: (error, variables) => {
|
||||
const { sessionID } = variables;
|
||||
queryClient.setQueryData<MessageListResponse>(
|
||||
["opencode", "messages", opcodeUrl, sessionID, directory],
|
||||
(old) => old?.filter((msg) => !msg.info.id.startsWith("optimistic_")),
|
||||
);
|
||||
|
||||
const parsed = parseNetworkError(error);
|
||||
showToast.error(parsed.title, {
|
||||
description: parsed.message,
|
||||
duration: 5000,
|
||||
});
|
||||
},
|
||||
onSuccess: async (data, variables) => {
|
||||
const { sessionID } = variables;
|
||||
|
||||
Reference in new issue
Block a user