feat: support intree commands#7
Merged
Merged
Conversation
Signed-off-by: kerthcet <kerthcet@gmail.com>
Signed-off-by: kerthcet <kerthcet@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the agent↔daemon protocol to use a unified request_id identifier across command execution, shell sessions, and file transfers, and adds a daemon-side hook for “in-tree” (sandd_*) command handling.
Changes:
- Renamed protocol fields (
command_id/session_id/transfer_id) torequest_idacross server and daemon codepaths. - Updated server-side message handling to route command/shell/file-transfer responses using
request_id. - Added daemon-side dispatch for
sandd_*“in-tree” commands (currently implemented as a stub).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
server/src/server.rs |
Switches response routing to use request_id for command completion, shell output/exit, and file download chunks. |
server/src/protocol.rs |
Renames message fields to request_id in the server-side protocol enum + updates serialization test. |
server/src/lib.rs |
Updates the Python-facing server wrapper to generate/register/send request_id for commands, shells, and transfers. |
sandd/src/shell.rs |
Updates emitted shell messages to use request_id. |
sandd/src/protocol.rs |
Renames daemon-side protocol fields to request_id for parity with server. |
sandd/src/main.rs |
Adds sandd_* in-tree command handling path and renames command identifiers to request_id. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
209
to
213
| Message::CommandOutput { | ||
| command_id, | ||
| request_id, | ||
| stdout, | ||
| stderr, | ||
| exit_code, |
Comment on lines
255
to
259
| Message::FileDownloadChunk { | ||
| transfer_id, | ||
| request_id, | ||
| data, | ||
| is_last, | ||
| .. |
Comment on lines
21
to
23
| ExecuteCommand { | ||
| command_id: String, | ||
| request_id: String, | ||
| command: String, |
Comment on lines
+221
to
+224
| // Check for in-tree commands (sandd_* prefix) | ||
| if let Some(intree_cmd) = command.strip_prefix("sandd_") { | ||
| debug!("Handling in-tree command: {}", intree_cmd); | ||
|
|
| error: e.to_string(), | ||
| }, | ||
| }; | ||
| // Check for in-tree commands (sandd_* prefix) |
Member
Author
|
/lgtm |
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.
What this PR does / why we need it
Which issue(s) this PR fixes
Fixes #
Special notes for your reviewer
Does this PR introduce a user-facing change?