DEV Community

Cuelark
Cuelark

Posted on

GPT-6.2 in a React chat: get the timestamp out of your system prompt

By the Cuelark Team. Every model detail below comes from OpenAI's own announcement and API docs, and the SDK details come from the Vercel AI SDK's release notes and published package, all checked on 19 November 2026. The code ran on our machine against a local mock of the documented Responses stream. We had no OpenAI API key for this test, so read it as a wiring test, not a quality review.

OpenAI released gpt-6.2-astra and gpt-6.2-sol on November 17. The headline numbers are about price and benchmarks. For anyone running a chat UI, though, the more important line is in the migration guide: starting with GPT-6.2, the Responses API drops reasoning items when you edit anything that came before them. A very common chat pattern, putting today's date and the current page into the system prompt, counts as that kind of edit. Nothing errors. The model just loses its earlier reasoning on every turn.

Here's what changed, what we saw in a two-turn test with the AI SDK, and the small fix.

What the docs say

From the announcement and the model pages for Astra and Sol:

  • Price per 1M tokens: Astra costs $8 input, $0.40 cached input and $40 output. Sol costs $2, $0.10 and $10, the same rates as GPT-6.1 Sol. Requests over 272K input tokens cost more.
  • Context: a 1,050,000-token window, up to 922,000 input tokens, and 128,000 max output tokens. Input is text and images, output is text.
  • Endpoints: both models work with Responses and Chat Completions, but tool calling needs the Responses API.
  • Removed settings: a reasoning effort of none is rejected, and temperature and top_p should be dropped. Flex processing isn't supported. Instead, background mode now has discounted two-hour and eight-hour completion windows (public beta).

The Using GPT-6.2 guide lists two behaviour changes that matter for chat apps:

  1. Prefix edits drop reasoning. If you edit earlier history, the API drops the reasoning items that came after the edit. It does the same when you switch to certain other models or when the end user changes. The guide warns that "answer quality can decline and the model may use more tokens to repeat earlier work."
  2. Top-level instructions moved. GPT-6.2 appends instructions after input. Reusable instructions should go in a developer message at the start of input. Top-level instructions are now meant for guidance that applies to the current request only.

The reasoning guide also lists end_user_mismatch. If the safety_identifier changes between requests, or is sent on only one of them, earlier reasoning is removed too.

What happened with the AI SDK

We used ai@7.0.177 and @ai-sdk/openai@4.0.121. 4.0.120 added the GPT-6.2 model IDs. 4.0.121 started returning input_transformations in provider metadata, which is how you can see dropped reasoning at all.

Our mock uses fetch, streams the documented SSE events, and applies the documented checks: prefix_mismatch and end_user_mismatch. It's built from the docs. It isn't a captured OpenAI response.

The "before" route is one you've probably written:

system: `You are Acme's support assistant. Today is ${new Date().toISOString()}. The user is on the ${user.page} page.`,
Enter fullscreen mode Exit fullscreen mode

The AI SDK sends system as the first developer item in input. That's the right place for stable text, but this text isn't stable. On turn two, input[0] had a new timestamp and page, so it no longer matched what came before the turn-one reasoning item. The response reported:

[{ "id": "rs_1", "type": "reasoning", "action": "removed", "reason": "prefix_mismatch" }]
Enter fullscreen mode Exit fullscreen mode

The prompt caching guide gives the same advice for cache hits: move timestamps and user-specific content to the end, not the beginning.

The fix: a static system prompt, per-turn context in instructions

// app/api/chat/route.js
import { streamText, convertToModelMessages } from 'ai';
import { openai } from '@ai-sdk/openai';
import { createHash } from 'node:crypto';

const SYSTEM = "You are Acme's support assistant. Answer from the order data you are given.";

export async function POST(req) {
  const { messages, user } = await req.json();

  const result = streamText({
    model: openai('gpt-6.2-sol'),
    system: SYSTEM, // never changes, so it stays a stable, cacheable prefix
    messages: await convertToModelMessages(messages),
    providerOptions: {
      openai: {
        reasoningSummary: 'auto',
        // GPT-6.2 appends this after input, so it can change every turn
        instructions: `Today is ${new Date().toISOString()}. The user is on the ${user.page} page.`,
        // send it on every request, with the same value for the whole conversation
        safetyIdentifier: createHash('sha256').update(user.id ?? user.sessionId).digest('hex').slice(0, 32),
      },
    },
  });

  return result.toUIMessageStreamResponse({
    sendReasoning: true,
    messageMetadata: ({ part }) =>
      part.type === 'finish-step'
        ? { dropped: part.providerMetadata?.openai?.inputTransformations ?? [] }
        : undefined,
  });
}
Enter fullscreen mode Exit fullscreen mode

We drove both routes the way useChat does: post the UI messages, rebuild the assistant message with readUIMessageStream, append it, and ask a follow-up. With the fixed route, input[0] was byte-identical on both turns, the new page name arrived in top-level instructions, and dropped was empty. The turn-one reasoning went back as an item_reference and was kept.

One detail we got wrong at first: inputTransformations is on the finish-step part's provider metadata, not on finish. Read it there, or you'll see nothing.

On the client, your shadcn chat stays the same. Show reasoning parts in a collapsible block and text parts as the answer. In development, it helps to log message.metadata.dropped.

Honest limits

  • We didn't call the real API. The checks in our mock follow the docs. Before you ship, run one real two-turn request and look at input_transformations.
  • Signing in mid-chat still drops reasoning. If the identifier goes from a session hash to a user hash, that's an end_user_mismatch, and our fixed route hit it too. Decide whether a conversation keeps the identifier it started with.
  • instructions aren't cached. OpenAI bills those tokens at the uncached input rate on every request, so keep them short.
  • History trimming counts as an edit. Rewriting or shortening old tool outputs, or summarising old turns at the front, changes the prefix. The keep-the-prefix guide suggests compaction, or placing summaries at the end. Deleting whole items without editing the rest doesn't trigger prefix_mismatch on its own.
  • Changing settings mid-chat. Changing reasoning.effort, tools or text.format between requests can also change the prefix. The docs suggest appending configuration_update or additional_tools items instead. We didn't test those here.

Sources

If you'd rather not hand-build the reasoning block and message list, Cuelark UI has shadcn-style components for AI chat that work with this setup.

Top comments (1)

Collapse
 
alexshev profile image
Alex Shev •

Moving volatile time data out of the system prompt also makes debugging cleaner: a transcript can show the exact tool or context value the model saw, rather than hiding it inside a prompt template. I’d log the timezone source and clock version with each turn so cache behavior and incorrect-date reports are reproducible.