feat(epic3): progress и безопасная отмена Tool calls (Story 3.4, FR-14)
- request-scoped lifecycle одного tools/call: валидированный `_meta.progressToken` (строковый/числовой, 1..=128 байт) и bounded очередь реальных этапов (tool_resolved → authorization_resolved → execution_dispatched) в собственный SSE-stream запроса; без token или без stream-carrier результат не меняется; - сериализация `notifications/progress` по pinned схеме обеих revisions (progressToken/progress/message, total не изобретается); - отмена по revision: 2025-11-25 — `notifications/cancelled` через bounded in-flight таблицу (владение = session + platform credential, не progress token); 2026-07-28 — закрытие response stream; в обоих случаях drop будущего вызова = кооперативная остановка, terminal-сообщение не отправляется; - streamed ответ сохраняет проекцию Story 3.18: closed `notifications/message` перед финальным кадром (перенос logging-scope в тело стрима); - ATDD: 12 end-to-end тестов на реальном endpoint/каталоге/counted upstream (обе revisions, malformed/oversized/reused token, owner/foreign/late cancel, disconnect, ambiguous outbound, representative client smoke) + 7 unit-тестов границ lifecycle; entry в scripts/ci-story-checks.sh.
This commit is contained in:
1 parent
49c8af24ed
commit
862cde8559
18 files changed
+2207
-112
No files matched your search
@@ -105,6 +105,10 @@ pub(crate) enum MethodHandler {
|
||||
Ping,
|
||||
Discover,
|
||||
Lifecycle,
|
||||
/// `notifications/cancelled`: the legacy client cancels a `tools/call` it already issued
|
||||
/// (Story 3.4). The handler only routes the id to the owner's in-flight call; it never widens
|
||||
/// what may be cancelled and never authorizes by the progress token.
|
||||
Cancelled,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
@@ -599,6 +603,17 @@ pub(crate) const METHOD_DESCRIPTORS: &[MethodDescriptor] = &[
|
||||
required_headers: HEADERS_NONE,
|
||||
handler: MethodHandler::Lifecycle,
|
||||
},
|
||||
MethodDescriptor {
|
||||
// Story 3.4: the legacy revision's client-side cancellation of a request it issued. The
|
||||
// pinned modern revision has no client-to-server notification over Streamable HTTP (closing
|
||||
// the response stream is its cancellation signal), so this name exists in the legacy era
|
||||
// only. It is a dispatch-only notification registration and advertises nothing.
|
||||
name: "notifications/cancelled",
|
||||
capability: CapabilityId::LegacyLifecycle,
|
||||
kind: Kind::Notification,
|
||||
required_headers: HEADERS_NONE,
|
||||
handler: MethodHandler::Cancelled,
|
||||
},
|
||||
];
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in new issue
Block a user