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

🤖 perf: Token Budget rolls over again when a fresh window's own estimate already reaches the hard ceiling

Đang mở
#7,331 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

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
66/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
backend

Hướng nghiên cứu

Start with src/node/services/contextManagement/strategies/tokenBudget.ts, the file named in the issue, and trace how a rollover handles a fresh window whose estimate reaches the hard ceiling. Find the related tests and add coverage for the next send after that rollover. Done means it warns or blocks and does not roll over again.

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

Mô tả

Split out of #5223 (its "Livelock guard" item). No fix is in the #5223 PR.

Problem

In Token Budget mode, a rollover starts a fresh context window. If that fresh window's own next-request estimate already reaches the hard ceiling, the next send rolls over again, and so does every send after it. Nothing stops the loop.

#5223 states the guard as: "when a fresh window's own estimate already reaches the ceiling, warn and continue or block instead of rolling over again."

Evidence (from #5223)

  • Live UAT on a 60k window: one session fell into an 8-rollover livelock. The fresh window's own estimate (51.8k) reached the hard ceiling (51,808), so every send rolled over again.
  • On a 200k window the fresh window is about 56k by estimate, so the livelock needs an unusually small window.
  • Main has no guard for this today (checked in src/node/services/contextManagement/strategies/tokenBudget.ts at 8c31fc7ac2).

Options

  1. Warn and continue: send the request without another rollover and show a warning that the window is too small for the fresh context.
  2. Block: refuse the send with an error that says the fresh context does not fit this model's window.

Acceptance

  • Test: a fresh window whose own estimate reaches the hard ceiling does not roll over again on the next send. It warns or blocks, as chosen.

Refs #5223, #4858.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $523.18

Ngôn ngữ chính
TypeScript
Star
2.1k
Fork
140
Merge trung bình
3 giờ 24 phút
Pull request đã merge (30 ngày)
954

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

  • Có Dockerfile hoặc tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

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 khác của coder/xum

Tất cả issue của coder/xum

Issue tương tự

Thêm issue về TypeScript

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.