Skip to content

Conversation

@Sg312
Copy link
Contributor

@Sg312 Sg312 commented Nov 21, 2025

Summary

Add gpt 5.1 and codex to the copilot

Type of Change

  • New feature

Testing

Manual

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Nov 21, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Nov 21, 2025 6:50pm

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 21, 2025

Greptile Overview

Greptile Summary

This PR adds support for GPT-5.1 and Codex model variants to the copilot feature. The changes systematically add 6 new model types (gpt-5.1-fast, gpt-5.1, gpt-5.1-medium, gpt-5.1-high, gpt-5-codex, gpt-5.1-codex) across all necessary layers:

  • Backend validation schemas accept the new model types
  • TypeScript type definitions include the new models
  • Default model configuration enables GPT 5.1 and GPT 5.1 Codex by default
  • UI constants expose GPT 5.1 Medium and GPT 5.1 Codex to users with improved label formatting
  • The change also updates gpt-5-medium default state from enabled to disabled

All changes are consistent across the codebase and properly integrated with existing architecture. The PR improves label formatting for better UX (e.g., "gpt-5-medium" → "GPT 5 Medium").

Confidence Score: 5/5

  • This PR is safe to merge with no identified risks
  • The changes are straightforward model additions with consistent implementation across all required files. No logical errors, security issues, or breaking changes were identified. All type definitions, validation schemas, and configurations are properly synchronized.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/app/api/copilot/chat/route.ts 5/5 Added 6 new model types to schema validation enum (gpt-5.1-fast, gpt-5.1, gpt-5.1-medium, gpt-5.1-high, gpt-5-codex, gpt-5.1-codex) - straightforward addition with no issues
apps/sim/app/api/copilot/user-models/route.ts 5/5 Updated DEFAULT_ENABLED_MODELS with new models and changed default state for gpt-5-medium from true to false - clean implementation
apps/sim/lib/copilot/api.ts 5/5 Added 6 new model types to SendMessageRequest interface - simple type extension with no issues
apps/sim/stores/panel/copilot/types.ts 5/5 Added 6 new model types to CopilotState selectedModel union type - consistent with other changes
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/user-input/constants.ts 5/5 Updated MODEL_OPTIONS with improved labels (added proper capitalization) and exposed gpt-5.1-medium and gpt-5.1-codex to UI - good UX improvement
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components-new/settings-modal/components/copilot/copilot.tsx 5/5 Updated commented-out code to reflect new models for future reference - maintains consistency in documentation

Sequence Diagram

sequenceDiagram
    participant UI as User Input Component
    participant Store as Copilot Store
    participant API as Chat API Route
    participant Models as User Models API
    participant Agent as Sim Agent

    Note over UI,Agent: Model Selection & Configuration Flow
    
    UI->>Models: GET /api/copilot/user-models
    Models->>Models: Load DEFAULT_ENABLED_MODELS<br/>(includes new GPT-5.1 & Codex)
    Models-->>UI: Return enabled models list
    
    UI->>UI: Render MODEL_OPTIONS<br/>(GPT 5.1 Medium, GPT 5.1 Codex, etc.)
    
    Note over UI,Store: User selects new model
    UI->>Store: setSelectedModel(gpt-5.1-codex)
    Store->>Store: Update selectedModel state
    
    Note over UI,Agent: Send Message Flow
    UI->>API: POST /api/copilot/chat<br/>{model: gpt-5.1-codex, ...}
    API->>API: Validate with ChatMessageSchema<br/>(includes new model types)
    API->>Agent: Forward to Sim Agent<br/>with selected model
    Agent-->>API: Stream response
    API-->>UI: Forward SSE stream
    
    Note over Models: Model Preferences Sync
    UI->>Models: PUT /api/copilot/user-models<br/>{enabledModels: {...}}
    Models->>Models: Update copilotEnabledModels<br/>in settings table
    Models-->>UI: Confirm update
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@Sg312 Sg312 merged commit 3be57af into staging Nov 21, 2025
14 of 15 checks passed
@waleedlatif1 waleedlatif1 deleted the improvement/copilot-more-models branch November 22, 2025 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants