mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
Bump version to 0.8.21 (#99)
* Add timeout handling and recovery for OpenCode upgrade/install operations - Extract DEFAULT_AGENTS_MD to constants file - Add 90s timeout for opencode upgrade/install commands - Implement server recovery when upgrade/install fails - Update frontend error handling for recovery status - Add settings route tests * Add centralized query cache invalidation utility * Bump version to 0.8.21
This commit is contained in:
1 parent
3661f0a271
commit
a02f7a2e98
14 files changed
+1100
-126
No files matched your search
@@ -1,7 +1,6 @@
|
||||
import { useMemo } from 'react'
|
||||
import { useMessages } from './useOpenCode'
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
import { useSessionAgent } from './useSessionAgent'
|
||||
import { useModelSelection } from './useModelSelection'
|
||||
|
||||
interface ContextUsage {
|
||||
@@ -43,11 +42,8 @@ async function fetchProviders(opcodeUrl: string): Promise<ProvidersResponse> {
|
||||
|
||||
export const useContextUsage = (opcodeUrl: string | null | undefined, sessionID: string | undefined, directory?: string): ContextUsage => {
|
||||
const { data: messages, isLoading: messagesLoading } = useMessages(opcodeUrl, sessionID, directory)
|
||||
const sessionAgent = useSessionAgent(opcodeUrl, sessionID, directory)
|
||||
const { modelString: globalModelString } = useModelSelection(opcodeUrl, directory)
|
||||
const modelString = sessionAgent.model
|
||||
? `${sessionAgent.model.providerID}/${sessionAgent.model.modelID}`
|
||||
: globalModelString
|
||||
const modelString = globalModelString
|
||||
|
||||
const { data: providersData } = useQuery({
|
||||
queryKey: ['providers', opcodeUrl],
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
|
||||
import { toast } from 'sonner'
|
||||
import { settingsApi } from '@/api/settings'
|
||||
import { useMutation } from '@tanstack/react-query'
|
||||
import { useQueryClient } from '@tanstack/react-query'
|
||||
import { invalidateConfigCaches, invalidateSettingsCaches } from '@/lib/queryInvalidation'
|
||||
|
||||
interface HealthResponse {
|
||||
status: 'healthy' | 'degraded' | 'unhealthy'
|
||||
@@ -34,8 +33,7 @@ export function useServerHealth(enabled = true) {
|
||||
return await settingsApi.reloadOpenCodeConfig()
|
||||
},
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ['health'] })
|
||||
queryClient.invalidateQueries({ queryKey: ['opencode', 'agents'] })
|
||||
invalidateConfigCaches(queryClient)
|
||||
toast.success('Server configuration reloaded successfully')
|
||||
},
|
||||
onError: (error: unknown) => {
|
||||
@@ -53,9 +51,7 @@ export function useServerHealth(enabled = true) {
|
||||
return await settingsApi.rollbackOpenCodeConfig()
|
||||
},
|
||||
onSuccess: (data) => {
|
||||
queryClient.invalidateQueries({ queryKey: ['health'] })
|
||||
queryClient.invalidateQueries({ queryKey: ['settings'] })
|
||||
queryClient.invalidateQueries({ queryKey: ['opencode', 'agents'] })
|
||||
invalidateSettingsCaches(queryClient)
|
||||
toast.success(data.message)
|
||||
},
|
||||
onError: () => {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
|
||||
import { settingsApi } from '@/api/settings'
|
||||
import type { UserPreferences } from '@/api/types/settings'
|
||||
import { invalidateConfigCaches } from '@/lib/queryInvalidation'
|
||||
|
||||
export function useSettings(userId = 'default') {
|
||||
const queryClient = useQueryClient()
|
||||
@@ -43,8 +44,8 @@ export function useSettings(userId = 'default') {
|
||||
}
|
||||
},
|
||||
onSettled: () => {
|
||||
// Refetch to ensure server state
|
||||
queryClient.invalidateQueries({ queryKey: ['settings', userId] })
|
||||
invalidateConfigCaches(queryClient)
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user