chore: suggest using text/markdown when fetching content (#5854)

This commit is contained in:
Michael Neale
2025-11-26 01:35:01 +11:00
committed by GitHub
parent 07ece7d5a7
commit 89aa38ceb2
2 changed files with 15 additions and 7 deletions
+13 -7
View File
@@ -492,13 +492,19 @@ impl ComputerControllerServer {
let save_as = params.save_as; let save_as = params.save_as;
// Fetch the content // Fetch the content
let response = self.http_client.get(url).send().await.map_err(|e| { let response = self
ErrorData::new( .http_client
ErrorCode::INTERNAL_ERROR, .get(url)
format!("Failed to fetch URL: {}", e), .header("Accept", "text/markdown, */*")
None, .send()
) .await
})?; .map_err(|e| {
ErrorData::new(
ErrorCode::INTERNAL_ERROR,
format!("Failed to fetch URL: {}", e),
None,
)
})?;
let status = response.status(); let status = response.status();
if !status.is_success() { if !status.is_success() {
@@ -325,6 +325,8 @@ impl ServerHandler for DeveloperServer {
**Important**: Each shell command runs in its own process. Things like directory changes or **Important**: Each shell command runs in its own process. Things like directory changes or
sourcing files do not persist between tool calls. So you may need to repeat them each time by sourcing files do not persist between tool calls. So you may need to repeat them each time by
stringing together commands. stringing together commands.
If fetching web content, consider adding Accept: text/markdown header
"#}; "#};
let windows_specific = indoc! {r#" let windows_specific = indoc! {r#"