`trace-codex` keeps the first model after a resumed session switches models
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
mainis also affected
Reproduction
- Start a traced session using
gpt-5.6-terra. - Resume the same session using
codex exec resume -m gpt-5.6-sol <session-id> .... - 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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue tương tự
-
Remove delay in startup?Đang mở0. to triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
EchoTools/nevr-runtime#171 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Shell installer: updating PATH replaces symlinked profiles and changes existing file permissionsĐang mởbug CLI
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area/testing kind/cleanup priority/backlog triage/accepted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
lexfrei/cloudflare-tunnel-gateway-controller#999 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày