Skip to content

Jazzcort add timeout#6772

Merged
DOsinga merged 2 commits intomainfrom
jazzcort-add-timeout
Jan 28, 2026
Merged

Jazzcort add timeout#6772
DOsinga merged 2 commits intomainfrom
jazzcort-add-timeout

Conversation

@DOsinga
Copy link
Collaborator

@DOsinga DOsinga commented Jan 28, 2026

Summary

Merge conflict resolved for: #6521

Jazzcort and others added 2 commits January 16, 2026 10:47
Updates argument parsing to support a `url timeout=<seconds>` format, allowing users
to override the default extension timeout.

Signed-off-by: Jazzcort <jason101011113@gmail.com>
Copilot AI review requested due to automatic review settings January 28, 2026 15:57
@DOsinga DOsinga merged commit a4ad231 into main Jan 28, 2026
14 of 18 checks passed
@DOsinga DOsinga deleted the jazzcort-add-timeout branch January 28, 2026 15:59
@DOsinga DOsinga restored the jazzcort-add-timeout branch January 28, 2026 16:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR resolves a merge conflict for PR #6521, which adds support for custom timeout values for streamable HTTP extensions via a url timeout=<seconds> format in CLI arguments.

Changes:

  • Adds StreamableHttpOptions struct to capture URL and timeout
  • Implements parse_streamable_http_extension parser function
  • Updates type signatures to use StreamableHttpOptions instead of String
  • Applies code formatting changes in TypeScript files

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
crates/goose-cli/src/cli.rs Adds StreamableHttpOptions struct and parsing function for timeout parameter
crates/goose-cli/src/session/mod.rs Imports StreamableHttpOptions type
crates/goose-cli/src/session/builder.rs Updates StreamableHttpOptions type in SessionBuilderConfig and test
crates/goose-cli/src/commands/bench.rs Converts string URLs to StreamableHttpOptions with default timeout
ui/desktop/src/utils/sessionCache.ts Formatting change - multi-line error message
ui/desktop/src/utils/autoUpdater.ts Formatting change - function call alignment
ui/desktop/src/components/sessions/SessionListView.tsx Formatting change - multi-line toast error
ui/desktop/src/components/sessions/SessionHistoryView.tsx Formatting change - function call alignment
ui/desktop/src/components/schedule/SchedulesView.tsx Formatting change - function calls alignment
ui/desktop/src/components/alerts/AlertBox.tsx Formatting change - window.alert alignment
ui/desktop/src/App.tsx Formatting change - setFatalError alignment

)
.await;


Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

Remove this extra blank line to maintain consistent code formatting.

Suggested change

Copilot uses AI. Check for mistakes.
Comment on lines +125 to +127
if let Some(url_str) = input_iter.next() {
url.push_str(url_str);
}
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The url variable should be validated before being returned. If url_str is None (i.e., input is empty or only whitespace), an empty URL would be returned, which would cause issues downstream. Consider returning an error if the URL is missing or empty.

Copilot uses AI. Check for mistakes.
Comment on lines +134 to +139
let (key, value) = kv_pair.split_once('=').unwrap();

// We Can have more keys here for setting other properties
if key == "timeout" {
if let Ok(seconds) = value.parse::<u64>() {
timeout = seconds;
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

Using unwrap() here is unsafe since we've already checked that the string contains '=' but there's still a guarantee from split_once. However, if the string is "key=" (no value), this will work but produce an empty value string. Consider handling the case where the value might be empty, or document that empty values are acceptable for timeout parameters.

Suggested change
let (key, value) = kv_pair.split_once('=').unwrap();
// We Can have more keys here for setting other properties
if key == "timeout" {
if let Ok(seconds) = value.parse::<u64>() {
timeout = seconds;
if let Some((key, value)) = kv_pair.split_once('=') {
// We Can have more keys here for setting other properties
if key == "timeout" && !value.is_empty() {
if let Ok(seconds) = value.parse::<u64>() {
timeout = seconds;
}

Copilot uses AI. Check for mistakes.
Comment on lines +138 to +139
if let Ok(seconds) = value.parse::<u64>() {
timeout = seconds;
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

If the timeout value cannot be parsed as u64, the error is silently ignored and the default timeout is used. This could be confusing for users who provide an invalid timeout value. Consider returning an error or at least logging a warning when the timeout parsing fails.

Suggested change
if let Ok(seconds) = value.parse::<u64>() {
timeout = seconds;
match value.parse::<u64>() {
Ok(seconds) => {
timeout = seconds;
}
Err(_) => {
return Err(format!(
"invalid timeout value '{}', expected an unsigned integer (seconds)",
value
));
}

Copilot uses AI. Check for mistakes.

let (key, value) = kv_pair.split_once('=').unwrap();

// We Can have more keys here for setting other properties
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

Capitalize "Can" to "can" for consistency with standard comment style.

Suggested change
// We Can have more keys here for setting other properties
// We can have more keys here for setting other properties

Copilot uses AI. Check for mistakes.
Comment on lines +121 to +145
fn parse_streamable_http_extension(input: &str) -> Result<StreamableHttpOptions, String> {
let mut input_iter = input.split_whitespace();
let (mut url, mut timeout) = (String::new(), goose::config::DEFAULT_EXTENSION_TIMEOUT);

if let Some(url_str) = input_iter.next() {
url.push_str(url_str);
}

for kv_pair in input_iter {
if !kv_pair.contains('=') {
continue;
}

let (key, value) = kv_pair.split_once('=').unwrap();

// We Can have more keys here for setting other properties
if key == "timeout" {
if let Ok(seconds) = value.parse::<u64>() {
timeout = seconds;
}
}
}

Ok(StreamableHttpOptions { url, timeout })
}
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The new parse_streamable_http_extension function lacks test coverage. Consider adding tests to verify correct parsing of URL, timeout parameter, handling of invalid timeout values, missing URLs, and various edge cases.

Copilot uses AI. Check for mistakes.
eliasposen pushed a commit to eliasposen/goose that referenced this pull request Jan 28, 2026
Signed-off-by: Jazzcort <jason101011113@gmail.com>
Co-authored-by: Jazzcort <jason101011113@gmail.com>
Co-authored-by: Douwe Osinga <douwe@squareup.com>
Signed-off-by: Elias Posen <elias@posen.ch>
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.

2 participants