Skip to content

add declarative provider support to goose-providers crate - #9992

Merged
jamadeo merged 15 commits into
mainfrom
declarative-providers
Jul 1, 2026
Merged

add declarative provider support to goose-providers crate#9992
jamadeo merged 15 commits into
mainfrom
declarative-providers

Conversation

@jamadeo

@jamadeo jamadeo commented Jun 25, 2026

Copy link
Copy Markdown
Member

for #9803

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c321f25282

ℹ️ 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".

Comment thread crates/goose-providers/src/openai.rs Outdated
Comment thread crates/goose-providers/src/openai.rs Outdated
Comment thread crates/goose-providers/src/declarative.rs Outdated
@jamadeo jamadeo changed the title add declarative provider support to goose-providers crate [don't merge until base is merged] add declarative provider support to goose-providers crate Jun 25, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1e59ad3746

ℹ️ 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".

Comment thread crates/goose-providers/src/openai.rs
@jamadeo
jamadeo force-pushed the declarative-providers branch from 1e59ad3 to 522808c Compare June 29, 2026 19:43

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 522808c525

ℹ️ 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".

Comment thread crates/goose-providers/src/anthropic.rs Outdated
Comment thread crates/goose-providers/src/anthropic.rs
@jamadeo
jamadeo force-pushed the declarative-providers branch from 522808c to 202d67f Compare June 30, 2026 01:00

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 202d67f188

ℹ️ 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".

Comment thread crates/goose-providers/src/declarative.rs Outdated
@jamadeo
jamadeo requested a review from DOsinga June 30, 2026 16:23
Base automatically changed from ollama-provider to main June 30, 2026 17:44
@jamadeo
jamadeo force-pushed the declarative-providers branch from 202d67f to 1ddf9da Compare June 30, 2026 18:06
@jamadeo
jamadeo force-pushed the declarative-providers branch from 1ddf9da to 542d7f4 Compare June 30, 2026 18:07
@jamadeo jamadeo changed the title [don't merge until base is merged] add declarative provider support to goose-providers crate add declarative provider support to goose-providers crate Jun 30, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 542d7f4649

ℹ️ 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".

Comment thread crates/goose-providers/src/declarative.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a0b9758578

ℹ️ 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".

Comment thread crates/goose-providers/src/ollama.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: da209359e7

ℹ️ 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".

Comment thread crates/goose-providers/src/ollama.rs Outdated
Comment thread crates/goose-providers/src/ollama.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f5b460d27b

ℹ️ 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".

Comment thread crates/goose/src/providers/ollama_def.rs Outdated
Comment thread crates/goose-providers/src/ollama.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f979827ba5

ℹ️ 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".

Comment thread crates/goose-providers/src/openai.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e2e99d52a7

ℹ️ 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".

Comment thread crates/goose-providers/src/declarative.rs Outdated
pub required: bool,
#[serde(default)]
pub secret: bool,
/// When true, the field is shown prominently in the UI (not collapsed).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this comment is a bit suspect in the new world

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yeah we should drop it (the flag itself). Can do that in a follow-up

@@ -0,0 +1,30 @@
{

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

these are copies from what we ship with? how do we keep them in sync?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

They are, but this is just for example code. Which could drift yes. Once we move all of the declarative definitions into goose-providers, we can switch this to reference those, and they'll have the unit test that checks validity

Comment thread crates/goose-providers/src/anthropic.rs Outdated
}
}

pub fn from_custom_config(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we should make a call on whether we want to call them declarative or custom (or something else). in the client it makes some sense to distinguish but I don't think it does from an API perspective.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think declarative is a closer description of what this is. The terminology is mixed because they mean slightly different things in goose app land.

@@ -2,8 +2,10 @@ use super::api_client::ApiClient;
use super::base::{ConfigKey, MessageStream, Provider, ProviderMetadata};

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do we need custom provider support for Ollama? I think the reason we started out with this, is that it didn't need an API key and originally we couldn't make the distinction. but now it is just the same as openai, no?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hm, good question. Is that really the only reason we have it? I imagine there are probably other differences under the hood but I cannot say for sure.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

goose points out that ollama-shaped providers will use native ollama apis like /api/tags. We could probably rework it to combine them?

@jamadeo
jamadeo enabled auto-merge July 1, 2026 16:26

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3167101d7a

ℹ️ 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".


let format_options = format_options_for_provider(config.preserves_thinking);

let mut api_client = ApiClient::new_with_tls(config.base_url, auth, tls_config)?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve Anthropic base URL query parameters

When an Anthropic-compatible declarative provider uses a base URL with required query parameters (for example a gateway that routes by ?api-version=...), this passes the URL directly as the ApiClient host. ApiClient::build_url later joins v1/messages/v1/models against that host, which drops the base query; unlike the OpenAI constructor, no with_query call re-adds it, so every request is sent without those required parameters.

Useful? React with 👍 / 👎.

@jamadeo
jamadeo added this pull request to the merge queue Jul 1, 2026
Merged via the queue into main with commit b6349b5 Jul 1, 2026
24 of 25 checks passed
@jamadeo
jamadeo deleted the declarative-providers branch July 1, 2026 16:57
lifeizhou-ap added a commit that referenced this pull request Jul 1, 2026
* main:
  fix: tolerate partial Responses output items (#10108)
  fix(databricks): always use OpenAI-compatible "parameters" for tools (#10101)
  fix(providers): unescape shell-escaped image paths (#10098)
  chore(deps-dev): bump js-yaml from 4.1.1 to 4.2.0 in /documentation (#10107)
  regenerate schema (#10166)
  chore(deps): bump actions/stale from 10.1.1 to 10.3.0 (#10050)
  chore(deps): bump actions/attest-build-provenance from 4.1.0 to 4.1.1 (#10049)
  chore(deps): bump pnpm/action-setup from 6.0.8 to 6.0.9 (#9892)
  Update EmpirioLabs provider display name to EmpirioLabs AI (#10126)
  add declarative provider support to goose-providers crate (#9992)
  fix(desktop): seed mac auto-update config (#10132)
  Update release testing instructions (#10122)
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