Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đã đóng
#17 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
shell, typescript
Lĩnh vực
observability-sre

Hướng nghiên cứu

Bắt đầu tại noteModel và đường dẫn của processor đọc turn_context.model, sau đó lần theo cách scope được persist và khôi phục cho các session được tiếp tục. Thêm một transcript hồi quy với hai lượt đã hoàn tất sử dụng các model khác nhau, bao gồm cả việc khôi phục snapshot, và xác minh rằng mỗi lượt và mỗi LLM span giữ metadata model và ước tính chi phí riêng, trong khi các span trước đó vẫn không thay đổi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Shell
Star
2
Fork
1
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue tương tự

Thêm issue về Shell/Bash

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.