refactor(providers): extract http_status module and rename handle_status_openai_compat#8620
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: efaad41e59
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
eebc545 to
f5a5e94
Compare
|
Since we're doing the big rename anyway, maybe this helper should move out of the |
f5a5e94 to
5a3ae34
Compare
|
Done — moved |
5a3ae34 to
9ec8a2c
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9ec8a2cdf7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| }) | ||
| } | ||
| // Legacy alias kept for callers that haven't migrated their import path yet. | ||
| pub use super::http_status::handle_response as handle_response_openai_compat; |
There was a problem hiding this comment.
Re-export legacy handle_status_openai_compat alias
This refactor removes the public handle_status_openai_compat symbol without a compatibility alias, even though this section explicitly promises legacy import support. Any downstream crate that still imports providers::openai_compatible::handle_status_openai_compat will now fail to compile, which is a breaking API change introduced by this commit; adding a pub use ... as handle_status_openai_compat alias (like the one kept for handle_response_openai_compat) would preserve compatibility.
Useful? React with 👍 / 👎.
…ttp_status module The status-mapping helpers (`handle_status`, `handle_response`, `map_http_error_to_provider_error`) are format-agnostic — they parse both OpenAI and Anthropic error shapes and are used by 12 providers. - Rename `handle_status_openai_compat` → `handle_status` and `handle_response_openai_compat` → `handle_response`. - Move these helpers from `openai_compatible` into a dedicated `providers::http_status` module. `openai_compatible` re-exports them for convenience. Pure refactor, no logic changes. Signed-off-by: DaeHee Lee <lee111dae11@proton.me>
9ec8a2c to
6f7c934
Compare
* main: (41 commits) removed the specific code owner for documentation change (#8749) fix(providers): handle missing delta field in streaming chunks (#8700) refactor(providers): extract http_status module and rename handle_status_openai_compat (#8620) fix(providers/openai): accept streaming chunks with both reasoning fields (#8715) feat: associate threads with projects (#8745) upgrade goose sdk and tui to be compatible with the latest agentclientprotocol/sdk package (#8667) feat: extend goose2 context window ux with auto-compaction (#8721) improve goose2 agent management flows (#8737) alexhancock/tui-improvements (#8736) fix: add strict:false to Responses API tools and gpt-5.4 to known models (#8636) persist and reliably apply chat model selection (#8734) merge goose-acp crate into goose (#8726) docs: AGENTS.md section on goose2 desktop backend architecture (#8732) feat: goose2 message bubble + action tray (#8720) consolidate provider ACP methods onto inventory (#8710) ci: declare and enforce MSRV of 1.91.1 (#8670) fix(ui): correct grammar in apps view description (#8668) (#8679) Stop load openai fast model for openapi compatible custom endpoint (#8644) feat(hooks): add Husky git hooks for ui/goose2 (#8577) fix: links in chat could not be opened (#8544) ...
* main: (34 commits) fix(goose-server): cache TLS cert to disk to avoid slow startup on first launch (#8174) feat: add Exa AI-powered search tool (#8487) fix: preprompt would show after loading session (#8744) commands to acp+ migration: extensions management (#8733) feat: desktop notification when goose finishes a task (#8647) harden code review skill for async state and default-resolution bugs (#8740) Feature/at agent mention (#8571) fix: removed hardcoded dependency of goose-acp-macro (#8753) perf: split agent setup into staged phases to reduce startup blocking (#8746) Add /skills command (#8600) Replace deprecated Claude ACP package links (#8625) removed the specific code owner for documentation change (#8749) fix(providers): handle missing delta field in streaming chunks (#8700) refactor(providers): extract http_status module and rename handle_status_openai_compat (#8620) fix(providers/openai): accept streaming chunks with both reasoning fields (#8715) feat: associate threads with projects (#8745) upgrade goose sdk and tui to be compatible with the latest agentclientprotocol/sdk package (#8667) feat: extend goose2 context window ux with auto-compaction (#8721) improve goose2 agent management flows (#8737) alexhancock/tui-improvements (#8736) ...
Summary
handle_status_openai_compat→handle_statushandle_response_openai_compat→handle_responseproviders::http_statusmoduleMotivation
The status-mapping helpers (
handle_status,handle_response,map_http_error_to_provider_error) are format-agnostic —extract_messagealready parses both OpenAI ({"error":{"message":"..."}}) and Anthropic ({"message":"..."}) error shapes. They are used by 12 providers includinganthropic,google,ollama, andkimicode.The
_openai_compatsuffix was misleading, and housing them inopenai_compatible.rsimplied a format dependency that doesn't exist. Per @jh-block's suggestion, they now live in their own module.Changes
crates/goose/src/providers/http_status.rs— containshandle_status,handle_response,map_http_error_to_provider_error, and the privatecheck_context_length_exceededhelperopenai_compatible.rs— re-exports the helpers for backward compatibilityhandle_status_openai_compat→handle_status)Test plan
cargo clippy -p goose --all-targets -- -D warningscleanopenai_compatible::testsstill pass (they use re-exported symbols)Follow-up to #8466.
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com