diff --git a/internal/infrastructure/egress/modelproxy.go b/internal/infrastructure/egress/modelproxy.go index a5c7451b2..30b78549f 100644 --- a/internal/infrastructure/egress/modelproxy.go +++ b/internal/infrastructure/egress/modelproxy.go @@ -81,18 +81,19 @@ func ProviderHost(class, baseURL string) (string, error) { // classBaseURL mirrors the default base URL each ai-sdk provider class uses // when a provider sets none. var classBaseURL = map[string]string{ - "openai": "https://api.openai.com", - "openaiobject": "https://api.openai.com", - "anthropic": "https://api.anthropic.com", - "cohere": "https://api.cohere.com", - "deepseek": "https://api.deepseek.com", - "gemini": "https://generativelanguage.googleapis.com", - "groq": "https://api.groq.com", - "minimax": "https://api.minimax.io", - "mistral": "https://api.mistral.ai", - "perplexity": "https://api.perplexity.ai", - "xai": "https://api.x.ai", - "togetherai": "https://api.together.xyz", + "openai": "https://api.openai.com", + "openaiobject": "https://api.openai.com", + "anthropic": "https://api.anthropic.com", + "cohere": "https://api.cohere.com", + "deepseek": "https://api.deepseek.com", + "gemini": "https://generativelanguage.googleapis.com", + "gemini-interactions": "https://generativelanguage.googleapis.com", + "groq": "https://api.groq.com", + "minimax": "https://api.minimax.io", + "mistral": "https://api.mistral.ai", + "perplexity": "https://api.perplexity.ai", + "xai": "https://api.x.ai", + "togetherai": "https://api.together.xyz", } // ModelProxyEnvFor is the environment entry list naming the proxy, its hosts diff --git a/internal/webui/chat.go b/internal/webui/chat.go index fc5361771..8fc81ac99 100644 --- a/internal/webui/chat.go +++ b/internal/webui/chat.go @@ -120,6 +120,7 @@ type chatUpdateRequest struct { type chatTurnView struct { TurnID string `json:"turn_id"` + InputMessageID string `json:"input_message_id,omitempty"` AssistantMessageID string `json:"assistant_message_id,omitempty"` Status messaging.TurnStatus `json:"status"` Error string `json:"error,omitempty"` @@ -263,7 +264,7 @@ func (a *chatAPI) handleChatTurns(w http.ResponseWriter, r *http.Request) { views := make([]chatTurnView, 0, len(turns)) for _, turn := range turns { view := chatTurnView{ - TurnID: turn.TurnID, AssistantMessageID: turn.AssistantMessageID, + TurnID: turn.TurnID, InputMessageID: turn.InputMessageID, AssistantMessageID: turn.AssistantMessageID, Status: turn.Status, Error: turn.Error, ToolCalls: make([]chatToolView, 0, len(turn.ToolCalls)), } diff --git a/ui/src/accounts/PersonalTokensCard.vue b/ui/src/accounts/PersonalTokensCard.vue index ee97d1048..9ebc4e5e1 100644 --- a/ui/src/accounts/PersonalTokensCard.vue +++ b/ui/src/accounts/PersonalTokensCard.vue @@ -65,12 +65,18 @@ const create = () => const copy = () => navigator.clipboard.writeText(created.value); +// The token is kept until the next Revoke: Reka closes the dialog before the +// action's click runs, so clearing it on close would drop the revoke. const pending = ref(null); +const dialogOpen = ref(false); const revoke = (id: string) => run(async () => { await api.revokeToken(id); await load(); }); +const confirmRevoke = () => { + if (pending.value) revoke(pending.value.id); +}; onMounted(load); @@ -106,11 +112,11 @@ onMounted(load); Created Expires Last used - + - + Revoke token? @@ -118,7 +124,7 @@ onMounted(load); Cancel - Revoke token + Revoke token diff --git a/ui/src/chat/state.ts b/ui/src/chat/state.ts index 11f5ff99b..dac2a203f 100644 --- a/ui/src/chat/state.ts +++ b/ui/src/chat/state.ts @@ -353,13 +353,27 @@ async function readTranscript(id: string): Promise { api.chatTurns(id), ]); const byAssistantMessage = new Map(); + // A failed turn records no reply, so its error follows the message it failed on. + const failedByInput = new Map(); for (const turn of turns || []) { const assistantID = turn.assistant_message_id || turn.AssistantMessageID; if (assistantID) byAssistantMessage.set(assistantID, turn); + else if (turn.status === "failed" && turn.input_message_id) + failedByInput.set(turn.input_message_id, turn); } - return (msgs || []).map((message) => { + return (msgs || []).flatMap((message) => { const messageID = message.message_id || message.MessageID; const turn = messageID ? byAssistantMessage.get(messageID) : undefined; + const failed = messageID ? failedByInput.get(messageID) : undefined; + if (failed) + return [ + message, + { + from: "assistant", + text: `Unable to complete that turn: ${failed.error || "unknown error"}`, + tool_calls: failed.tool_calls || [], + }, + ]; return turn ? { ...message, tool_calls: turn.tool_calls || turn.ToolCalls || [] } : message; @@ -395,6 +409,9 @@ function isCurrentSession(id: string): boolean { /** One recorded turn, as GET /api/chat/sessions/{id}/turns returns it. */ interface ChatTurnView { + input_message_id?: string; + status?: string; + error?: string; assistant_message_id?: string; AssistantMessageID?: string; tool_calls?: ChatToolCall[];