Proposal: opt-in server request admission and response budgets
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Swift
- スター
- 1.6k
- フォーク
- 270
- 平均マージ
- 2日 7時間
- マージ済み PR(30日)
- 15
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
modelcontextprotocol/swift-sdk のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
modelcontextprotocol/swift-sdk#327 ·
メンテナーはふだん 2 日以内に返信
-
Value decoding changes data-URL-looking JSON strings into Value.data対応中かも @bitbemol が 73 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
modelcontextprotocol/swift-sdk#277 ·
メンテナーはふだん 2 日以内に返信
-
enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
modelcontextprotocol/swift-sdk#274 ·
メンテナーはふだん 2 日以内に返信
-
`HTTPClientTransport` fails to build on Windows: `#if !os(Linux)` guards no longer match the `EventSource` platform condition再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
modelcontextprotocol/swift-sdk#261 ·
メンテナーはふだん 2 日以内に返信
-
Client.withBatch leaves per-request tasks pending when transport.send throws対応中かも @bbdu3 が 1 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
modelcontextprotocol/swift-sdk#324 · コメント 2 件 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
modelcontextprotocol/swift-sdk の issue をすべて見る
似ている issue
-
[java] TestClassWithoutTestCases: document that abstract classes and interfaces are not checkedオープン
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
VictorKildahl/cra#302 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
文件夹设置bugオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
joeseesun/qiaomu-jot#14 ·
メンテナーはふだん 1 日以内に返信