Conversation
| Some("background") => "chat".to_string(), | ||
| _ => config | ||
| .get_param("GOOSE_MODE") | ||
| .unwrap_or_else(|_| "auto".to_string()), |
There was a problem hiding this comment.
not related to your PR, but this mapping looks quite questionable. Why chat mode for background jobs? This looks like the root of a recent bug report
| } | ||
| if let JsonRpcMessage::Notification(notif) = ¬ification { | ||
| if let Some(data) = notif.params.as_ref().and_then(|p| p.get("data")) { | ||
| if let (Some(subagent_id), Some(_message)) = ( |
crates/goose/src/agents/agent.rs
Outdated
| if let Some(token) = &cancel_token { | ||
| if token.is_cancelled() { |
There was a problem hiding this comment.
can this be
cancel_token.is_some_and(|token| token.is_cancelled())
?
There was a problem hiding this comment.
the AIs say you need an as_ref() in there still
| pub fn routes(state: Arc<AppState>) -> Router { | ||
| Router::new() | ||
| .route("/reply", post(handler)) | ||
| .route("/ask", post(ask_handler)) |
There was a problem hiding this comment.
/ask is old - I thought /reply is still used though?
There was a problem hiding this comment.
it is - I just renamed handler to reply_handler here. the code still exists!
|
seems sensible, and could prevent some other problems of processes hanging around. I also still encounter hanging, and then unkillable sessions, wonder if this will help with that (vs trying to hang up) |
* 'main' of github.com:block/goose: (23 commits) fix: add fallback id to messages if none provided (#3584) feat: migrate ErrorData from internal mcp crates to rmcp version (#3586) fix: adjust subrecipe description to allow running tests (#3585) Scenario tests (#3430) feat: migrate JsonRpcMessage/Request/Response/Error/Notification from internal mcp crates to rmcp versions (#3564) Restore recipe parameters functionality (#3530) feat: Enhanced loading states with thinking icons and flying bird animation (#3478) Agent loop defensive (#3554) chore: remove needless clone() in goose/providers (#2528) Add recipe install warning (#3537) Replace mcp_core::resource::* with rmcp types (#3563) Add YouTube video embed to using-goosehints.md (#3560) fix: ensure retry-config and success-criteria are populated in openapi spec (#3575) fix: use sequential when sub recipe task is 1. (#3573) fix: track message id to keep like with like (#3572) Replace mcp_core::prompt with rmcp::model types (#3561) feat (ui): close recipe modals with esc key (#3568) feat: recipes can retry with success criteria (#3474) Env var to set Ollama request timeout (#3516) Updating docs to match new UI (#3552) ...
* main: docs: desktop recipe format (#3594) Fix model display name not being updated immediately after leaving settings (#3587) Added option to summarize the chat when an error is triggered (#3598) Remove mcp_macros and unused types (#3581) fix: add fallback id to messages if none provided (#3584) feat: migrate ErrorData from internal mcp crates to rmcp version (#3586) fix: adjust subrecipe description to allow running tests (#3585) Scenario tests (#3430) feat: migrate JsonRpcMessage/Request/Response/Error/Notification from internal mcp crates to rmcp versions (#3564) Restore recipe parameters functionality (#3530) feat: Enhanced loading states with thinking icons and flying bird animation (#3478) Agent loop defensive (#3554) chore: remove needless clone() in goose/providers (#2528) Add recipe install warning (#3537) Replace mcp_core::resource::* with rmcp types (#3563) Add YouTube video embed to using-goosehints.md (#3560) fix: ensure retry-config and success-criteria are populated in openapi spec (#3575)
Co-authored-by: Douwe Osinga <douwe@squareup.com> Signed-off-by: Adam Tarantino <tarantino.adam@hey.com>
I couldn't actually reproduce the session corruption easily, but my theory is that it can happen because of two reasons:
the two combined can lead to us writing a message to the agent while the user has already canceled. If the user fires up a new command before say an MCP server has finished, this can create havoc.
this PR introduces a cancellation token and makes the message appending atomic-ish. it also deletes the askAi handler since that is not used.