#11624·langchainjs

ChatOpenAI drops explicit reasoning for gpt-6-astra despite reasoning-enabled model profile

Author: pichillilorenzoCreated Sep 13, 2026Updated Sep 16, 2026
Labelsbug

Checked other resources

  • This is a bug, not a usage question. For questions, please use the LangChain Forum (https://forum.langchain.com/).
  • I added a very descriptive title to this issue.
  • I searched the LangChain.js documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain.js rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

Example Code

This is network-free; it inspects the request produced by ChatOpenAI.

typescript
import { ChatOpenAI } from "@langchain/openai";

let body: Record<string, unknown> | undefined;

const model = new ChatOpenAI({
  model: "gpt-6-astra",
  apiKey: "test",
  useResponsesApi: true,
  reasoning: {
    effort: "max",
    summary: "auto",
  },
  configuration: {
    fetch: (_input, init) => {
      body = JSON.parse(String(init?.body));
      return Promise.resolve(
        Response.json(
          { error: { message: "stop after request capture" } },
          { status: 400 },
        ),
      );
    },
  },
});

await model.invoke("hello").catch(() => undefined);
console.log(body?.reasoning);

Actual output: undefined

Expected output: { "effort": "max", "summary": "auto" }

The same configuration is forwarded for a model name already accepted by the reasoning predicate, such as o3.

Error Message and Stack Trace (if applicable)

No response

Description

Checked version

@langchain/[email protected]

The current main branch still appears affected. Commit ac2e45c added gpt-6-astra to the model profile/catalog as reasoning-enabled, but Responses request construction still filters explicit reasoning through a separate model-name predicate that does not recognize this model.

Cause

The model profile/catalog identifies gpt-6-astra as reasoning-capable, but BaseChatOpenAI._getReasoningParams() first applies the separate reasoning-model name predicate. That predicate recognizes o* models and non-chat gpt-5* models, but excludes gpt-6-astra. As a result, explicit reasoning supplied by the caller is discarded before ChatOpenAIResponses.invocationParams() builds the request. This leaves the profile and request-construction paths inconsistent.

Suggested fix

Use the resolved model profile as the source of truth when deciding whether to forward explicitly configured reasoning. A narrow gpt-6-astra predicate update would also fix the immediate regression, but profile-driven behavior would avoid the same mismatch for future reasoning models.

Please add request-construction tests covering:

  1. gpt-6-astra with explicit reasoning forwards the object unchanged.
  2. A model without configured reasoning does not gain a reasoning field.
  3. Existing reasoning-model behavior remains unchanged.

NOTE: This bug has beed found by an AI agent while using your deepagents library and trying to call a GPT 6 Astra model. This whole issue has been written by that AI agent.

System Info

I'm running it inside Deno runtime 2.9.6 on macOS 26.6

Source: langchain-ai/langchainjs