Proposal: opt-in server request admission and response budgets
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 12/100
Hướng nghiên cứu
This is a design proposal, not a bug or a scoped change. The payload names only the proposed Server.Configuration and StdioTransport.Configuration shapes, so start by reading the existing Server and stdio transport configuration types to see how limits are currently handled. Done means maintainers agree on the admission, budget and shutdown contracts before any patch. Do not start an implementation from this issue alone.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
After verifying #266's stdio serialization and #298's early-cancellation changes,
there is a separate resource-control need for hosts that expose deterministic tools
with bounded input and output contracts. A bounded input frame alone does not bound
SDK-created request tasks, queued calls, or an aggregate JSON-RPC batch response.
Would an opt-in configuration surface along these lines fit the SDK?
Server.Configuration(
strict: true,
maxConcurrentRequests: 4,
maxQueuedRequests: 8,
maxBatchItems: 8,
maxResponseBytes: 65_535,
maxPendingControlResponses: 64)
// Separate proposed transport configuration, naming still to be agreed:
StdioTransport.Configuration(
maxInboundFrameBytes: 16_384,
maxOutboundFrameBytes: 65_536,
maxBufferedMessages: 1,
maxPendingWrites: 4)
The numbers are host policy examples. Existing callers would retain unlimited
execution/batch/response defaults. This is a distinct proposal from #266/#298 and
would benefit from agreement on the contracts before an upstream patch:
- Reserve request ownership and admission before any suspending context lookup.
Queue request values without allocating handler tasks. Return explicit overload
errors when capacity is full. A separately bounded control-reply queue keeps
reception available for cancellation while those errors await output. Count
cancelled active work until it actually exits; retain correlation IDs through
delayed batch delivery, separately from execution slots. - Allow cancellation notifications through while admitted work executes. Remove
cancelled queued calls before their handlers start. Scope correlation/admission
by the appropriate Server/session boundary; preserve HTTP transport routing
rather than assuming a bare wire ID is globally unique. - Bound both per-item responses and the encoded aggregate batch envelope. Preserve
IDs in explicit overflow errors; close the connection when even an error cannot
fit. Never truncate a success payload. Count bytes before transport framing. - Retain completed batch results separately under a bounded accumulator, so a batch
larger than the execution limit can finish. The final item holds a delivery slot
while sending the aggregate. Define how configuration changes affect work already
admitted; immutable per-connection limits would make the contract simpler. - Define host-driven shutdown completion and EOF cleanup. Waiting is cooperative;
process deadlines remain a host responsibility. Avoid a handler awaiting a
shutdown operation that itself waits for that handler.
The transport configuration should reject an oversized frame before accumulating
beyond its bound, count the delimiter consistently, bound pending/buffered messages,
and preserve FIFO writes through partial I/O. Backpressure must avoid silently
dropping a cancellation/control frame. A partial write failure needs an explicit
connection-failure policy before another frame may be written. These transport
APIs are proposed separately from Server admission; stock stdio presently remains
an unbounded input producer. Neither layer bounds arbitrary handler allocations
or notification-handler work. No networking/domain policy
belongs in these APIs.
A local development prototype based on release 0.12.1 and tests establish feasibility: the full native
macOS SDK suite passes 573 tests, and 28 focused native ARM64 Linux tests cover
4 active / 8 queued admission, overload, queued/running cancellation, retained
capacity during response delivery, batch8 through slots4, cancellation during a
batch, aggregate/individual budgets, too-small error budgets, negotiated batch
eligibility, EOF, and cooperative cleanup. This prototype is unpublished and is
not an upstream API commitment. No new dependency or broad protocol rewrite is
required for the stdio pilot. Full Linux test-target qualification remains blocked
by unrelated baseline URLProtocol helper diagnostics, separately documented.
- Ngôn ngữ chính
- Swift
- Star
- 1.6k
- Fork
- 270
- Merge trung bình
- 2 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 15
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
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 khác của modelcontextprotocol/swift-sdk
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
modelcontextprotocol/swift-sdk#327 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Value decoding changes data-URL-looking JSON strings into Value.dataCó thể đã có người làm @bitbemol đã nhận 73 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
modelcontextprotocol/swift-sdk#277 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
modelcontextprotocol/swift-sdk#274 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
`HTTPClientTransport` fails to build on Windows: `#if !os(Linux)` guards no longer match the `EventSource` platform conditionCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
modelcontextprotocol/swift-sdk#261 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Client.withBatch leaves per-request tasks pending when transport.send throwsCó thể đã có người làm @bbdu3 đã nhận 1 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
modelcontextprotocol/swift-sdk#324 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của modelcontextprotocol/swift-sdk
Issue tương tự
-
🎉 Add GinkgoCó thể đã có người làm @usual2970 đã nhận hôm nay. Đang mởaddition
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 76/100
jaywcjlove/awesome-mac#4442 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[feat] 홈 화면에서 보이는 경기 수 수정Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
DeveloperAcademy-POSTECH/2026-C6-A03-KIIKICK-iOS#76 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[java] TestClassWithoutTestCases: document that abstract classes and interfaces are not checkedĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
VictorKildahl/cra#302 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày