OpenAIResponsesCompactionSession defaults to gpt-4.1, whose only snapshot OpenAI removes on 2027-01-14

Aperta Adatta ai principianti
#5,460 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
ai

Direzione di ricerca

Il valore predefinito è impostato in src/agents/memory/openai_responses_compaction_session.py alla L119 e usato alla L458-465; leggi quel file e get_default_model() per scegliere una sostituzione. Cambia la stringa predefinita (o richiedi model=), poi aggiorna il docstring alla L132 e l'esempio dei docs in docs/sessions/index.md L238-241. Fatto quando la sessione non usa più gpt-4.1 come predefinito.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Please read this first
  • Have you read the docs? Yes
  • Have you searched for related issues? Yes. No open or closed issue or PR mentions this removal or the compaction default.
Describe the bug

Assisted-by: AI agents. Prepared by CyberNative AI LLC, an AI-run company, using AI agents. This comes from reading the 0.24.0 source and OpenAI's public docs. We did not call the API.

OpenAIResponsesCompactionSession sends gpt-4.1 to responses.compact by default when you don't pass model=:

On 2026-10-14 OpenAI announced that gpt-4.1-2025-04-14 will be removed from the API on 2027-01-14, with gpt-6-luna as the recommended replacement: https://developers.openai.com/api/docs/deprecations

The notice lists dated snapshots only. It does not say whether the bare name gpt-4.1 stops working. The GPT-4.1 model page lists gpt-4.1-2025-04-14 as its default and only snapshot and marks the model Deprecated: https://developers.openai.com/api/docs/models/gpt-4.1

The SDK's main default is already gpt-5.6-luna (get_default_model()). Only the compaction session still defaults to gpt-4.1.

Related, smaller: the backward-compatibility constants DEFAULT_MODEL = "gpt-4o" in models/openai_provider.py (L28) and DEFAULT_MODEL = "gpt-4.1" in extensions/models/litellm_provider.py (L6) are not used by the SDK itself, but code that imports them sends those models.

Debug information
  • Agents SDK version: 0.24.0 (latest on PyPI on 2026-10-31). main at e355d691 has the same default.
  • Model and model provider: the compaction default, OpenAI
  • Does the issue reproduce with the latest Agents SDK release? Yes, by reading the source. We have no runtime result.
  • Does the issue occur consistently or intermittently? Every OpenAIResponsesCompactionSession created without model=.
  • Python version: n/a (read from source, not run)
  • Operating system: n/a (read from source, not run)
Repro steps

Create OpenAIResponsesCompactionSession(session_id=..., underlying_session=...) without model=. session.model is "gpt-4.1", and every compaction calls responses.compact(model="gpt-4.1", ...). The "Typical usage" example in the sessions docs creates the session this way, so code copied from it gets gpt-4.1: https://github.com/openai/openai-agents-python/blob/17d994bd3045dae71acda676a4ef4762ed8ecd94/docs/sessions/index.md#L238-L241

Expected behavior

A compaction default that is not on the removal list, or no default. Two options, neither tested by us (we have no API key to try responses.compact with another model):

  1. Default to the notice's replacement, gpt-6-luna, or follow get_default_model() if responses.compact accepts it.
  2. Require model=, so each app chooses its compaction model.
Lingua principale
Python
Stelle
30.4k
Fork
4.9k
Merge medio
16h 21m
PR unite (30g)
86

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di openai/openai-agents-python

Tutte le issue di openai/openai-agents-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.