Internal MCP Crate Cleanup#4800
Conversation
ffe77df to
1b4a865
Compare
|
@jamadeo how do you feel about the fact that this removes Do you think we should unwind that in a change where we remove those crates, or ok to do in a followup? Also I realize this is a big PR so can sync on it when I've verified it's ready for review otherwise. |
ea04549 to
2fa1ab7
Compare
33da81d to
982a579
Compare
jamadeo
left a comment
There was a problem hiding this comment.
really nice. I left some nitpick comments, mostly places where I think there are unnecessary clones (.to_string().clone()) and some places where there's another level of if-nesting that could be replaced with a .and_then(..)
But feel free to merge before addressing all of them, wouldn't want to be constantly fixing conflicts.
Maybe the one thing to give an extra look to is the 1 that became None in acp.rs
| meta: None, | ||
| }); | ||
| if let Some(args_map) = args { | ||
| if let Some(path_str) = args_map.get("path").and_then(|p| p.as_str()) { |
There was a problem hiding this comment.
nit: could be a single if let Some(.. with a .and_then
| if path.exists() && path.is_file() { | ||
| locs.push(acp::ToolCallLocation { | ||
| path: path_str.into(), | ||
| line: None, |
There was a problem hiding this comment.
this is line: Some(1) on the left but None here, is that deliberate?
| tool_name: tool_call | ||
| .name | ||
| .to_string() | ||
| .clone(), |
There was a problem hiding this comment.
I don't think you need to .clone() here since .to_string() should return an owned value
| md.push_str("**Arguments:**\n"); | ||
|
|
||
| match call.name.as_str() { | ||
| match call.name.to_string().as_str() { |
|
|
||
| let success = tool_response.tool_result.is_ok(); | ||
| let result_status = if success { "success" } else { "error" }; | ||
| .unwrap_or_else(|| "tool".to_string().into()); |
There was a problem hiding this comment.
did you mean to change this from "unknown" to "tool"?
There was a problem hiding this comment.
good catch - thank you
| style(format!("{}", item)).green() | ||
| ); | ||
| if let Some(args) = &call.arguments { | ||
| if let Some(Value::Array(task_parameters)) = args.get("task_parameters") { |
| let tool_call = ToolCall::new(name, Value::Object(serde_json::Map::new())); | ||
| message = message.with_tool_request(id, Ok(tool_call)); | ||
| if let Some(id) = tool_use_id { | ||
| if let Some(name) = tool_name { |
There was a problem hiding this comment.
could chain these to remove a nesting level
I think that's fine, if there's some point in the future where it makes sense to remove a layer of abstraction, we can always do that. |
105da2d to
0764041
Compare
0764041 to
440de70
Compare
This reverts commit 146cf31.
…-unification * 'main' of github.com:block/goose: (24 commits) feat(cli): add `path` & `limit` to `session list` command (#4878) Allow better concurrent access (#4896) fix: Windows prompt cursor positioning issue with ANSI escape sequences (#4464) Fix: LiteLLM API key field not showing in UI configuration (#4105) fix: path is duplicated on tool calls causing them to fail (#4658) (#4859) add new prompt to get all available tutorials (#4802) Add filtering for agentVisible: false messages on streaming providers (#4847) alexhancock/mcp-crate-cleanup (#4885) docs: rename sub-recipe to subrecipe (#4886) docs: new multi-model section with autopilot topic (#4864) make agent manager singleton (#4880) Cli web auth token (#4456) fix(token_counter): fix panic with GitHub Copilot (#4632) Revert "Internal MCP Crate Cleanup (#4800)" (#4883) remove 2 redundant comments and one that lies (#4866) Internal MCP Crate Cleanup (#4800) Fix #4612: Return non-zero exit code when CLI session ends with error (#4621) Dead code cleanup (#4873) fix: restoring test data and correcting name (#4875) Add .goosehints file to enforce lowercase branding in documentation (#4870) ...
* main: (206 commits) Tiny: fix github casing (aaif-goose#4903) remove anyOf from create_task tool (aaif-goose#4897) chore(deps): bump tracing-subscriber from 0.3.19 to 0.3.20 (aaif-goose#4442) fix optional recipe schema zod validation (aaif-goose#4900) Added CMD+T keyboard shortcut that takes you to the Home tab (aaif-goose#4541) feat(cli): add `path` & `limit` to `session list` command (aaif-goose#4878) Allow better concurrent access (aaif-goose#4896) fix: Windows prompt cursor positioning issue with ANSI escape sequences (aaif-goose#4464) Fix: LiteLLM API key field not showing in UI configuration (aaif-goose#4105) fix: path is duplicated on tool calls causing them to fail (aaif-goose#4658) (aaif-goose#4859) add new prompt to get all available tutorials (aaif-goose#4802) Add filtering for agentVisible: false messages on streaming providers (aaif-goose#4847) alexhancock/mcp-crate-cleanup (aaif-goose#4885) docs: rename sub-recipe to subrecipe (aaif-goose#4886) docs: new multi-model section with autopilot topic (aaif-goose#4864) make agent manager singleton (aaif-goose#4880) Cli web auth token (aaif-goose#4456) fix(token_counter): fix panic with GitHub Copilot (aaif-goose#4632) Revert "Internal MCP Crate Cleanup (aaif-goose#4800)" (aaif-goose#4883) remove 2 redundant comments and one that lies (aaif-goose#4866) ...
Signed-off-by: HikaruEgashira <hikaru-egashira@c-fo.com>
Signed-off-by: HikaruEgashira <hikaru-egashira@c-fo.com>
mcp-clientandmcp-coremaking all our mcp tooling just use the rust-sdkToolCalland replaces it with the similarCallToolRequestParamfromrmcp