Repository navigation
Tool calls carry an idempotency key, and are sent again with it (mcp-gateway 1.17.2, R8) - #379
Merged
Merged
Conversation
mcp-gateway 1.17.2 answers a tools/call sent again with the same idempotency key, server, tool and arguments from the first call (R8). Each tool call from an ADK tool carries its own key, the call's CallToken (a digest of it where it is longer than the gateway takes or has a character it refuses), next to the progress token. The gateway client counts a tools/call with a key among the requests it may send again when the connection ends without an answer: an agent in OpenShell whose call is cut off at a token renewal gets its outcome instead of an error for a call that may have run. A call without a key is still never sent again. Custos requires mcp-gateway 1.17.2. Fixes #378 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q3sBGb8stQdHScGf2TGtWJ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes the shared files
CONTRACT.mdandpackaging/suse/custos.spec.Fixes #378. Uses mcp-gateway 1.17.2's R8.
Changes
internal/gatewaytagCallsadds the call's idempotency key to eachtools/callfrom an ADK tool. The key isCallToken(invocation, callID), the same value as its progress token;callKeymakes it acustos:-prefixed SHA-256 digest where it is longer than 128 characters or has a character outside printable ASCII without spaces, as the gateway requires. The same call always has the same key.idempotentcounts atools/callwith a key among the requests sent again when the connection ends without an answer (EOF, reset). The gateway answers the repeat from the first call, waiting for it while it runs (an approval stays one approval).tools/callwithout a key, e.g. one not made by an ADK tool, is still never sent again. The comments say so.packaging/suse/custos.spec:Requires: mcp-gateway >= 1.17.2. A gateway before it would not recognise the key and would run a repeat.CONTRACT.md§1 and the user guide's chapter 2 say 1.17.2.CONTRACT.md§7: the key next to the progress token, and when an agent sends a call again.docs/requirements/mcp-gateway-for-custos-0.10.md: R8 is in 1.17.2, and Custos uses it.changes.d/idempotent-calls.changed.md.Testing
make checkandmake cockpit-testpass.TestCallsCarryKey: an ADK call carries its key; a call from outside ADK none;TestCallKey: plain, too long, a space and a non-ASCII character become digests, stable for the same call and different for different calls;TestDroppedCallWithKeyRetried: a keyed call whose connection is dropped once succeeds;TestDroppedCallNotRetried(unchanged): a call without a key is not sent again.main, which has R8.Generated by Claude Code