Skip to content

Conversation

@DOsinga
Copy link
Collaborator

@DOsinga DOsinga commented Nov 18, 2025

Handles 404s instead of just saying 404:

now:

image

before:

image

also cleans up general error handling

Copilot AI review requested due to automatic review settings November 18, 2025 16:06
@DOsinga DOsinga requested a review from jamadeo November 18, 2025 16:07
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 adds explicit 404 handling to provider error responses and simplifies error handling logic across multiple providers by consolidating duplicate code into the centralized handle_status_openai_compat function.

  • Adds dedicated 404 handling with clear "Resource not found" messages
  • Simplifies error message extraction with a reusable extract_message() closure
  • Removes duplicate error handling code from OpenAI, Ollama, Anthropic, and Tetrate providers
  • Removes unused OpenAIErrorResponse struct and format_server_error_message function

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
crates/goose/src/providers/utils.rs Adds 404 handling, introduces extract_message() closure for consistent error message extraction, simplifies map_http_error_to_provider_error, streamlines handle_status_openai_compat, removes dead code and outdated test
crates/goose/src/providers/openai.rs Removes duplicate error handling, delegates to handle_status_openai_compat
crates/goose/src/providers/ollama.rs Removes duplicate error handling, delegates to handle_status_openai_compat
crates/goose/src/providers/anthropic.rs Imports and uses handle_status_openai_compat for error handling
crates/goose/src/providers/tetrate.rs Renames variable from response to resp for clarity before error handling

Copilot AI review requested due to automatic review settings November 20, 2025 18:33
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

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

@DOsinga DOsinga merged commit 0f8d9a7 into main Nov 20, 2025
17 checks passed
@DOsinga DOsinga deleted the handle-404s branch November 20, 2025 20:59
michaelneale added a commit that referenced this pull request Nov 24, 2025
* main: (48 commits)
  [fix] generic check for gemini compat (#5842)
  Add scheduler to diagnostics (#5849)
  Cors and token (#5850)
  fix sessions coming back with empty messages (#5841)
  markdown export from URL (#5830)
  Next camp refactor live (#5706)
  Add out of context compaction test via error proxy (#5805)
  fix: Add backward compatibility for conversationCompacted message type (#5819)
  Add /agent/stop endpoint, make max active agents configurable (#5826)
  Handle 404s (#5791)
  Persist provider name and model config in the session (#5419)
  Comment out the flaky mcp callers (#5827)
  Slash commands (#5718)
  fix: remove setx calls to not permanently edit the windows shell PATH (#5821)
  fix: Parse maas models for gcp vertex provider (#5816)
  fix: support Gemini 3's thought signatures (#5806)
  chore: Add Adrian Cole to Maintainers (#5815)
  [MCP-UI] Proxy and Better Message Handling (#5487)
  Release 1.15.0
  Document New Window menu in macOS dock (#5811)
  ...
kskarthik pushed a commit to kskarthik/goose that referenced this pull request Nov 26, 2025
Co-authored-by: Douwe Osinga <[email protected]>
Signed-off-by: Sai Karthik <[email protected]>
BlairAllan pushed a commit to BlairAllan/goose that referenced this pull request Nov 29, 2025
Co-authored-by: Douwe Osinga <[email protected]>
Signed-off-by: Blair Allan <[email protected]>
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.

3 participants