Skip to content

Added stateless tool call - #93

Open
cafalchio wants to merge 6 commits into
mainfrom
tool_call_stateless
Open

Added stateless tool call#93
cafalchio wants to merge 6 commits into
mainfrom
tool_call_stateless

Conversation

@cafalchio

@cafalchio cafalchio commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Implemented 2026-07-28 tools/call

Metadata validation and x-mcp-header will be implemented in IBM/mcp-context-forge#6256

Added a duplicated of validate (validate_stateless) that can be removed once all methods are stateless.
Added a connect_backend_for_request.

closes #IBM/mcp-context-forge#6243

@dawid-nowak dawid-nowak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Questions

@cafalchio
cafalchio requested a review from dawid-nowak August 17, 2026 20:04
@cafalchio
cafalchio force-pushed the tool_call_stateless branch from e32964f to 4f13ed8 Compare August 17, 2026 21:01

@lucarlig lucarlig left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes for cancellation-safe backend discovery, CPEX pre-hook ordering, and required hot-path wiki updates. Existing Dawid threads and separate epic work are excluded. IBM/mcp-context-forge#6243 requires request-scoped cancellation and wire coverage.

Comment thread crates/contextforge-data-plane-lib/src/gateway/mcp_service/initialization.rs Outdated
Comment thread crates/contextforge-data-plane-lib/src/gateway/mcp_service/tools.rs Outdated
Comment thread crates/contextforge-data-plane-lib/src/gateway/mcp_service/tools.rs
@cafalchio
cafalchio force-pushed the tool_call_stateless branch from 4f13ed8 to 0a0dcfa Compare August 18, 2026 12:25
@cafalchio
cafalchio requested a review from lucarlig August 18, 2026 12:26
@cafalchio
cafalchio force-pushed the tool_call_stateless branch from 2ffa218 to 400f081 Compare August 18, 2026 15:02
Comment thread docker/mcp_counter.Dockerfile
dawid-nowak
dawid-nowak previously approved these changes Aug 19, 2026

@lucarlig lucarlig left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The stateless success path works, but this is not ready to merge yet.

Required changes:

  1. Use RMCP's modern client lifecycle in the test instead of manually constructing JSON-RPC, metadata, routing headers, and SSE parsing. The inline replacement below passes on this exact PR head.
  2. Keep cancellation coverage enabled. On this head, downstream_cancellation_is_relayed_to_backend never reaches the backend cancellation token, even after 10 seconds.
  3. Fix cancellation in RMCP (or update to an RMCP revision containing the fix), rather than adding another gateway-side protocol implementation. The gateway already calls RequestHandle::cancel(); in RMCP 3.1.2 the modern HTTP worker can remain blocked waiting for the first SSE response event, so the queued cancel cannot close that request.
  4. Add modern stateless wire coverage required by IBM/mcp-context-forge#6243: backend alias routing, single-backend non-namespaced names, multi-backend namespaced names, progress-token forwarding, cancellation, and concurrent calls. The current new test covers only one successful single-backend call.
  5. Remove the two unrelated completion-test ignores. Both tests pass unchanged.

The other epic items (metadata/header rules, MRTR/result types, auth, retry/timeout/telemetry) are tracked separately and do not need to be implemented in this PR.

Comment thread crates/contextforge-data-plane-lib/tests/gateway_plugins.rs
Comment thread crates/contextforge-data-plane-lib/tests/gateway_plugins.rs
Comment thread crates/contextforge-data-plane-lib/tests/gateway_completions.rs
Comment thread crates/contextforge-data-plane-lib/tests/gateway_completions.rs
Comment thread crates/contextforge-data-plane-lib/tests/gateway_plugins.rs
@cafalchio
cafalchio requested a review from lucarlig August 19, 2026 09:14
@lucarlig
lucarlig force-pushed the tool_call_stateless branch from 400f081 to 1f3a8d8 Compare August 19, 2026 09:22
Signed-off-by: cafalchio <mcafalchio@gmail.com>
Signed-off-by: cafalchio <mcafalchio@gmail.com>
Signed-off-by: cafalchio <mcafalchio@gmail.com>
Signed-off-by: cafalchio <mcafalchio@gmail.com>
Signed-off-by: cafalchio <mcafalchio@gmail.com>
Signed-off-by: cafalchio <mcafalchio@gmail.com>

@lucarlig lucarlig left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lucarlig
lucarlig requested a review from dawid-nowak August 19, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants