[FEATURE]: Claude Agent: per-session cap on provider requests

Đang mở
#66,866 1 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ó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
20/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
ai-infra-agents

Hướng nghiên cứu

The payload names no source files, so start by locating where OpenCode's Claude Agent transport issues provider requests and how its retry hook interacts with the Claude Code subprocess. The issue asks for an opt-in per-session cap that blocks any second model request, including retries, continuation and fallback, before it is sent, and that returns a redacted attempt count. Done means a local fake-provider test showing zero requests during setup and exactly one request for success, a retryable error, an empty reply, and a disconnect after receipt, with default behavior unchanged.

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

Mô tả

area/providers type/feature version/v2
Feature hasn't been suggested before.
  • I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request

Please add an opt-in per-session provider-request cap for Claude Agent. With a cap of one, the transport must stop a second model request before it is sent, including retries, continuation calls, and model or account fallback. If it cannot enforce the cap, reject the session request before sending anything. Return a redacted count of actual attempts and preserve the normal assistant result and existing connection. Leave default behavior unchanged.

In OpenCode 2.4.2 with Claude Code 2.1.330, OpenCode's retry hook can veto host retries, but its HTTP hooks do not see requests from the Claude Code subprocess. The Claude Agent library's maxTurns option limits conversation turns, not provider attempts. A hard cap would let test and quota-sensitive automation make a single model request without risking a hidden retry.

Suggested test: with a local fake provider, verify zero requests during setup and one per case for success, a retryable error, an empty reply, and a disconnect after receipt. Related: #64749 covers rate-limit waiting, not a transport-level cap.

Ngôn ngữ chính
TypeScript
Star
230k
Fork
31.3k
Merge trung bình
5 giờ 32 phút
Pull request đã merge (30 ngày)
453

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

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 anomalyco/opencode

Tất cả issue của anomalyco/opencode

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.