Skip to content

Commit ab787cd

Browse files
authored
gpt 5.2 model on vibe coding platform (#1359)
### Description <!-- ✍️ Write a short summary of your work. Screenshots and videos are welcome! --> ### Demo URL <!-- Provide a URL to a live deployment where we can test your PR. If a demo isn't possible feel free to omit this section. --> ### Type of Change - [ ] New Example - [ ] Example updates (Bug fixes, new features, etc.) - [ ] Other (changes to the codebase, but not to examples) ### New Example Checklist - [ ] 🛫 `npm run new-example` was used to create the example - [ ] 📚 The template wasn't used but I carefuly read the [Adding a new example](https://github.com/vercel/examples#adding-a-new-example) steps and implemented them in the example - [ ] 📱 Is it responsive? Are mobile and tablets considered?
1 parent b95c065 commit ab787cd

File tree

8 files changed

+37
-26
lines changed

8 files changed

+37
-26
lines changed

apps/vibe-coding-platform/ai/constants.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ export enum Models {
66
AnthropicClaude45Sonnet = 'anthropic/claude-sonnet-4.5',
77
GoogleGeminiFlash = 'google/gemini-2.5-flash',
88
MoonshotKimiK2 = 'moonshotai/kimi-k2',
9-
OpenAIGPT5 = 'gpt-5',
9+
OpenAIGPT52 = 'openai/gpt-5.2',
1010
XaiGrok3Fast = 'xai/grok-3-fast',
1111
}
1212

13-
export const DEFAULT_MODEL = Models.AnthropicClaude45Sonnet
13+
export const DEFAULT_MODEL = Models.OpenAIGPT52
1414

1515
export const SUPPORTED_MODELS: GatewayModelId[] = [
16+
Models.OpenAIGPT52,
1617
Models.AmazonNovaPro,
1718
Models.AnthropicClaude4Sonnet,
1819
Models.AnthropicClaude45Sonnet,
1920
Models.GoogleGeminiFlash,
2021
Models.MoonshotKimiK2,
21-
Models.OpenAIGPT5,
2222
Models.XaiGrok3Fast,
2323
]
2424

apps/vibe-coding-platform/ai/gateway.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ export interface ModelOptions {
1818

1919
export function getModelOptions(
2020
modelId: string,
21-
options?: { reasoningEffort?: 'minimal' | 'low' | 'medium' }
21+
options?: { reasoningEffort?: 'low' | 'medium' | 'high' }
2222
): ModelOptions {
2323
const gateway = gatewayInstance()
24-
if (modelId === Models.OpenAIGPT5) {
24+
if (modelId === Models.OpenAIGPT52) {
2525
return {
2626
model: gateway(modelId),
2727
providerOptions: {

apps/vibe-coding-platform/ai/tools/generate-files/get-contents.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export async function* getContents(
3636
const generated: z.infer<typeof fileSchema>[] = []
3737
const deferred = new Deferred<void>()
3838
const result = streamObject({
39-
...getModelOptions(params.modelId, { reasoningEffort: 'minimal' }),
39+
...getModelOptions(params.modelId, { reasoningEffort: 'low' }),
4040
maxOutputTokens: 64000,
4141
system:
4242
'You are a file content generator. You must generate files based on the conversation history and the provided paths. NEVER generate lock files (pnpm-lock.yaml, package-lock.json, yarn.lock) - these are automatically created by package managers.',

apps/vibe-coding-platform/ai/tools/run-command.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Use Run Command when:
4646
## Other Rules
4747

4848
- When running `pnpm dev` in a Next.js or Vite project, HMR can handle updates so generally you don't need to kill the server process and start it again after changing files.
49+
- NEVER use `pnpm run dev -- -p 3000` for Next.js. The `--` causes Next.js to interpret `-p` as a directory path, resulting in an error. Just use `pnpm run dev` (port 3000 is the default).
4950

5051
## Examples
5152

apps/vibe-coding-platform/app/api/chat/prompt.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ CRITICAL Next.js Requirements:
2222
- Global styles should be in app/globals.css (not styles/globals.css) when using App Router
2323
- Use the App Router structure: app/layout.tsx, app/page.tsx, etc.
2424
- Import global styles in app/layout.tsx as './globals.css'
25+
- To start the dev server, use `pnpm run dev` (defaults to port 3000). NEVER use `pnpm run dev -- -p 3000` as the `--` causes Next.js to treat `-p` as a directory path.
26+
27+
CRITICAL ESM/CommonJS Requirements:
28+
29+
- When package.json has `"type": "module"`, all .js config files are treated as ESM
30+
- postcss.config.js MUST use `export default { ... }` syntax, NOT `module.exports`
31+
- tailwind.config.js MUST use `export default { ... }` syntax, NOT `module.exports`
32+
- Alternatively, use .cjs extension (postcss.config.cjs) to use CommonJS syntax
33+
- Always check package.json for "type": "module" before generating config files
2534

2635
Files that should NEVER be manually generated:
2736

@@ -54,6 +63,7 @@ You are equipped with the following tools:
5463
- Executes commands asynchronously in a stateless shell within the sandbox. Each execution provides a `commandId` for tracking purposes.
5564
- Never combine commands with `&&` or assume persistent state; commands must be run sequentially with `Wait Command` used for dependencies.
5665
- Use `pnpm` for package management whenever possible; avoid `npm`.
66+
- NEVER use `pnpm run dev -- -p 3000`. The `--` causes Next.js to interpret `-p` as a directory. Just use `pnpm run dev` (port 3000 is the default).
5767

5868
4. **Wait Command**
5969

apps/vibe-coding-platform/app/api/errors/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ export async function POST(req: Request) {
1919

2020
const result = await generateObject({
2121
system: prompt,
22-
model: Models.OpenAIGPT5,
22+
model: Models.OpenAIGPT52,
2323
providerOptions: {
2424
openai: {
2525
include: ['reasoning.encrypted_content'],
26-
reasoningEffort: 'minimal',
26+
reasoningEffort: 'low',
2727
reasoningSummary: 'auto',
2828
serviceTier: 'priority',
2929
},

apps/vibe-coding-platform/components/chat/message-part/generate-files.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ export function GenerateFiles(props: {
3131
</span>
3232
</ToolHeader>
3333
<div className="text-sm relative min-h-5">
34-
{generated.map((path) => (
35-
<div className="flex items-center" key={'gen' + path}>
34+
{generated.map((path, index) => (
35+
<div className="flex items-center" key={index}>
3636
<CheckIcon className="w-4 h-4 mx-1" />
3737
<span className="whitespace-pre-wrap">{path}</span>
3838
</div>
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
import { Models } from '@/ai/constants'
2-
import { Checkbox } from '@/components/ui/checkbox'
3-
import { Label } from '@/components/ui/label'
4-
import { useModelId, useReasoningEffort } from './use-settings'
1+
import { Models } from "@/ai/constants";
2+
import { Checkbox } from "@/components/ui/checkbox";
3+
import { Label } from "@/components/ui/label";
4+
import { useModelId, useReasoningEffort } from "./use-settings";
55

66
export function ReasoningEffort() {
7-
const [modelId] = useModelId()
8-
const [effort, setEffort] = useReasoningEffort()
9-
if (modelId !== Models.OpenAIGPT5) {
10-
return null
7+
const [modelId] = useModelId();
8+
const [effort, setEffort] = useReasoningEffort();
9+
if (modelId !== Models.OpenAIGPT52) {
10+
return null;
1111
}
1212

1313
return (
1414
<div
15-
className="flex items-center justify-between cursor-pointer hover:bg-accent/50 rounded p-2 -m-2"
16-
onClick={() => setEffort(effort === 'medium' ? 'low' : 'medium')}
15+
className="flex justify-between items-center p-2 -m-2 rounded cursor-pointer hover:bg-accent/50"
16+
onClick={() => setEffort(effort === "medium" ? "low" : "medium")}
1717
>
18-
<div className="space-y-1 flex-1 pointer-events-none">
18+
<div className="flex-1 space-y-1 pointer-events-none">
1919
<Label className="text-sm text-foreground" htmlFor="effort-level">
2020
Higher Effort Level
2121
</Label>
22-
<p className="text-sm text-muted-foreground leading-relaxed">
23-
With GPT-5, you can request higher reasoning effort level.
22+
<p className="text-sm leading-relaxed text-muted-foreground">
23+
With GPT-5.2, you can request higher reasoning effort level.
2424
</p>
2525
</div>
2626
<Checkbox
2727
id="effort-level"
2828
className="ml-3 pointer-events-none"
29-
checked={effort === 'medium'}
29+
checked={effort === "medium"}
3030
onCheckedChange={(checked) =>
31-
setEffort(checked === true ? 'medium' : 'low')
31+
setEffort(checked === true ? "medium" : "low")
3232
}
3333
/>
3434
</div>
35-
)
35+
);
3636
}

0 commit comments

Comments
 (0)