Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

`trace-codex` keeps the first model after a resumed session switches models

Aperta
#17 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
shell, typescript

Direzione di ricerca

Inizia da noteModel e dal percorso del processore che legge turn_context.model, quindi traccia come lo scope viene mantenuto e ripristinato per le sessioni riprese. Aggiungi una trascrizione di regressione con due turni completati che utilizzano modelli diversi, incluso il ripristino di uno snapshot, e verifica che ogni turno e ogni span LLM mantengano i propri metadati del modello e la propria stima dei costi, mentre gli span precedenti rimangono invariati.

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

Descrizione

Summary

trace-codex records later LLM spans with the first model seen in the transcript,
even when a resumed Codex turn uses a different model. This makes the span metadata,
name, and Braintrust cost estimate incorrect for the later request.

Environment

  • trace-codex: 0.1.0
  • Codex CLI: 0.146.0
  • Platform: Linux x64
  • Current main is also affected

Reproduction

  1. Start a traced session using gpt-5.6-terra.
  2. Resume the same session using codex exec resume -m gpt-5.6-sol <session-id> ....
  3. Inspect the rollout transcript and the resulting Braintrust trace.

The resumed transcript correctly contains:

{
  "type": "turn_context",
  "payload": {
    "model": "gpt-5.6-sol"
  }
}

But the resumed request's Braintrust LLM span is still named and tagged
gpt-5.6-terra. Braintrust consequently estimates that request using the wrong
model pricing.

A minimal processor-level regression also fails:

expected gpt-5.6-sol, got gpt-5.5

when two turns in one transcript use gpt-5.5 and gpt-5.6-sol.

Cause

noteModel() only sets scope.model when it is undefined:

if (model === undefined || scope.model !== undefined) return;
scope.model = model;

The scope is persisted and restored on resume. Later turn and LLM spans read
scope.model, so a new turn_context.model cannot replace the original value.

Expected behavior

Each turn and LLM call should use the model from the applicable turn_context.
Changing models on resume should:

  • label the resumed turn and LLM spans with the new model;
  • calculate estimated cost using the new model;
  • leave earlier spans labeled with their original model.

The root span may keep the initial model or expose a multi-model summary, but it
must not be the source of truth for child LLM-span pricing.

Suggested regression test

Build a transcript containing two completed turns with different
turn_context.model values and assert that each LLM span has its corresponding
model name and metadata. Repeat through snapshot restore to cover codex resume.

Lingua principale
Shell
Stelle
2
Fork
1
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 braintrustdata/braintrust-codex-plugin

Tutte le issue di braintrustdata/braintrust-codex-plugin

Issue simili

Altre issue su Shell/Bash

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.