Repository navigation
Conversation
Pass runtime request IDs through user-input and exit-plan handlers and expose the typed trusted human response producers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The dependent runtime authority changes remain unverified, and runtime compatibility needs human validation.
2 open findings
What changed in this PR
Adds runtime-owned request correlation to Rust SDK callbacks and trusted-human response APIs.
Changes:
- Pass typed
RequestIdvalues to user-input and plan-exit handlers. - Expose three trusted-human response methods while keeping session IDs SDK-owned.
- Expand callback tests and update handler implementations.
| File | Description |
|---|---|
scripts/codegen/rust.ts |
Allowlist public trusted-human methods. |
rust/tests/session_test.rs |
Test correlation, dispatch, and missing IDs. |
rust/tests/e2e/mode_handlers.rs |
Adapt the plan-exit handler signature. |
rust/tests/e2e/ask_user.rs |
Record and check callback IDs. |
rust/src/session.rs |
Validate and forward runtime request IDs. |
rust/src/handler.rs |
Add request IDs to two handler traits. |
rust/src/generated/rpc.rs |
Expose three trusted-human response methods. |
rust/examples/chat.rs |
Adapt the stdin handler signature. |
🧠 Review effort: Max
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| async fn handle( | ||
| &self, | ||
| session_id: SessionId, | ||
| request_id: RequestId, |
|
|
||
| "userInput.request" => { | ||
| let params = request.params.as_ref(); | ||
| let Some(callback_request_id) = params.and_then(extract_request_id) else { |
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.

Summary
requestIdvalues through Rust user-input and exit-plan-mode handlers as typedRequestIdssessionIdSDK-ownedProtocol dependency
This SDK change depends on the runtime trusted-authority commits
a7b5af197e78cbc303000cf7cd4cd15daf043c8eand9a83946b9aeb07aa83d78bf3db82e3041cc09415. No associated runtime PR URL was discoverable.Testing
npm --prefix scripts/codegen run generate:rustcargo test --manifest-path rust/Cargo.toml --features test-support --test session_test trusted_human_ui_methods_preserve_callback_correlation -- --exactcargo test --manifest-path rust/Cargo.toml --features test-support --test session_test user_input_request_dispatches_to_handler -- --exactcargo test --manifest-path rust/Cargo.toml --features test-support --test session_test exit_plan_mode_request_dispatches_to_handler -- --exactcargo test --manifest-path rust/Cargo.toml --features test-support --test session_test reverse_ui_requests_require_runtime_request_id -- --exactcargo check --manifest-path rust/Cargo.toml --lib --examples --features test-support -j 1cargo check --manifest-path rust/Cargo.toml --test e2e --features test-support -j 1