mirror of
https://github.com/simstudioai/sim.git
synced 2026-02-12 23:45:07 -05:00
Compare commits
2 Commits
staging
...
fix/copilo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04820a0075 | ||
|
|
09c9477091 |
@@ -85,7 +85,7 @@ const ChatMessageSchema = z.object({
|
||||
chatId: z.string().optional(),
|
||||
workflowId: z.string().optional(),
|
||||
workflowName: z.string().optional(),
|
||||
model: z.string().optional().default('claude-opus-4-6'),
|
||||
model: z.string().optional().default('claude-opus-4-5'),
|
||||
mode: z.enum(COPILOT_REQUEST_MODES).optional().default('agent'),
|
||||
prefetch: z.boolean().optional(),
|
||||
createNewChat: z.boolean().optional().default(false),
|
||||
@@ -238,7 +238,7 @@ export async function POST(req: NextRequest) {
|
||||
let currentChat: any = null
|
||||
let conversationHistory: any[] = []
|
||||
let actualChatId = chatId
|
||||
const selectedModel = model || 'claude-opus-4-6'
|
||||
const selectedModel = model || 'claude-opus-4-5'
|
||||
|
||||
if (chatId || createNewChat) {
|
||||
const chatResult = await resolveOrCreateChat({
|
||||
|
||||
@@ -38,7 +38,7 @@ import {
|
||||
|
||||
const logger = createLogger('CopilotMcpAPI')
|
||||
const mcpRateLimiter = new RateLimiter()
|
||||
const DEFAULT_COPILOT_MODEL = 'claude-opus-4-6'
|
||||
const DEFAULT_COPILOT_MODEL = 'claude-opus-4-5'
|
||||
|
||||
export const dynamic = 'force-dynamic'
|
||||
export const runtime = 'nodejs'
|
||||
|
||||
@@ -8,7 +8,7 @@ import { resolveWorkflowIdForUser } from '@/lib/workflows/utils'
|
||||
import { authenticateV1Request } from '@/app/api/v1/auth'
|
||||
|
||||
const logger = createLogger('CopilotHeadlessAPI')
|
||||
const DEFAULT_COPILOT_MODEL = 'claude-opus-4-6'
|
||||
const DEFAULT_COPILOT_MODEL = 'claude-opus-4-5'
|
||||
|
||||
const RequestSchema = z.object({
|
||||
message: z.string().min(1, 'message is required'),
|
||||
|
||||
@@ -1042,7 +1042,7 @@ const cachedAutoAllowedTools = readAutoAllowedToolsFromStorage()
|
||||
// Initial state (subset required for UI/streaming)
|
||||
const initialState = {
|
||||
mode: 'build' as const,
|
||||
selectedModel: 'anthropic/claude-opus-4-6' as CopilotStore['selectedModel'],
|
||||
selectedModel: 'anthropic/claude-opus-4-5' as CopilotStore['selectedModel'],
|
||||
agentPrefetch: false,
|
||||
availableModels: [] as AvailableModel[],
|
||||
isLoadingModels: false,
|
||||
@@ -2381,17 +2381,17 @@ export const useCopilotStore = create<CopilotStore>()(
|
||||
(model) => model.id === normalizedSelectedModel
|
||||
)
|
||||
|
||||
// Pick the best default: prefer claude-opus-4-6 with provider priority:
|
||||
// Pick the best default: prefer claude-opus-4-5 with provider priority:
|
||||
// direct anthropic > bedrock > azure-anthropic > any other.
|
||||
let nextSelectedModel = normalizedSelectedModel
|
||||
if (!selectedModelExists && normalizedModels.length > 0) {
|
||||
let opus46: AvailableModel | undefined
|
||||
let opus45: AvailableModel | undefined
|
||||
for (const prov of MODEL_PROVIDER_PRIORITY) {
|
||||
opus46 = normalizedModels.find((m) => m.id === `${prov}/claude-opus-4-6`)
|
||||
if (opus46) break
|
||||
opus45 = normalizedModels.find((m) => m.id === `${prov}/claude-opus-4-5`)
|
||||
if (opus45) break
|
||||
}
|
||||
if (!opus46) opus46 = normalizedModels.find((m) => m.id.endsWith('/claude-opus-4-6'))
|
||||
nextSelectedModel = opus46 ? opus46.id : normalizedModels[0].id
|
||||
if (!opus45) opus45 = normalizedModels.find((m) => m.id.endsWith('/claude-opus-4-5'))
|
||||
nextSelectedModel = opus45 ? opus45.id : normalizedModels[0].id
|
||||
}
|
||||
|
||||
set({
|
||||
|
||||
Reference in New Issue
Block a user