Skip to content

Resolve conflicts for OpenAI-compatible native agents - #1477

Merged
asim merged 4 commits into
mainfrom
codex/resolve-openai-agent-conflicts
Aug 31, 2026
Merged

asim merged 4 commits into
mainfrom
codex/resolve-openai-agent-conflicts

Conversation

@asim

@asim asim commented Aug 31, 2026

Copy link
Copy Markdown
Member

Summary

  • merge the latest main into the OpenAI-compatible native agent work
  • preserve per-agent model selection and the current provider resolution behavior
  • forward OPENAI_BASE_URL through agent.BaseURL for compatible endpoints
  • update affected native agent tests for the resolved provider signature

Testing

  • go test ./agent
  • gofmt -l .
  • git diff --check (reports pre-existing whitespace from the merged main branch)

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-08-31T14:39:11.660999Z e497523 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: e497523127

ℹ️ 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 agent/native.go Outdated
Comment on lines +447 to +448
if base := settings.Get("OPENAI_BASE_URL"); base != "" {
return ai.ProviderLocal, settings.Get("OPENAI_API_KEY"), openAIModel(), base, true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Resolve the configured local endpoint before Atlas

When the Ollama setup option is used, ApplyProvider writes both OPENAI_BASE_URL and OPENAI_API_KEY="ollama" but does not set AI_PROVIDER. Before this new branch is reached, ai.AtlasKey() treats that OPENAI_API_KEY as an Atlas credential, so nativeLLM selects Atlas with an Atlas model instead of forwarding the configured base URL; consequently, every native-agent request from the standard Ollama setup goes to Atlas with the dummy Ollama key and fails. The local-endpoint check must precede the Atlas fallback (or Atlas must not claim OPENAI_API_KEY when a base URL is configured).

AGENTS.md reference: AGENTS.md:L244-L246

Useful? React with 👍 / 👎.

claude added 2 commits August 31, 2026 15:19
Three things stood between the configuration docs/INSTALL.md documents and a
question reaching a local server. The branch plumbed a base URL through; none of
these was about the plumbing.

OPENAI_API_KEY was a third name for Atlas Cloud's key. getAtlasAPIKey read it,
and AtlasKey() is what decides whether this box "has Atlas" — so setting the
documented pair, a base URL and a key, made the instance start posting that key
to Atlas Cloud, and nativeLLMFor took the Atlas branch before it ever reached
OPENAI_BASE_URL. `mu setup` writes OPENAI_API_KEY=ollama for the Ollama path, so
a fresh local install reported an Atlas key of "ollama". The one arrangement
where the endpoint worked was naming AI_PROVIDER explicitly, which takes the
preferred-provider path above the check — which is what the new test did, and is
why it passed while the ordinary setup did not work. Atlas keeps its own two
names. admin/diagnostics.go had the same third name and no longer reports a
local install as running on Atlas.

The version segment was doubled. OPENAI_BASE_URL has always included it —
detectOllama returns .../v1, INSTALL.md says to set that, and detectLocalModel
asks baseURL+"/models" — while the go-micro provider builds base +
"/v1/chat/completions". Two conventions for one setting, both in use. The docs
are right, so ai.ProviderBaseURL says the conversion once and the four
WithBaseURL call sites use it. agent/local had the same fault twice over and
already shipped: its OpenRouter base was ".../api/v1", asking for
/api/v1/v1/chat/completions.

The model defaulted to gpt-4o-mini, in two places. No Ollama or vLLM has heard
of it, so an operator who set only an endpoint got a 404 naming a model they
never mentioned. ai.LocalModel is OPENAI_MODEL and nothing else; empty means not
configured, and the agent says so. That also closes the split the local branch
had opened in nativeLLMFor — ai.PreferredModel now answers for the local
provider too, so the agent and the chat ask one question, which is what the
comment above that function says it exists to guarantee.

The test pointed at Gemini's OpenAI-compatible shim, and that example cannot
work: the provider appends /v1/chat/completions and Gemini serves
.../v1beta/openai/chat/completions, so no value of OPENAI_BASE_URL reaches it.
Gemini has its own provider and AI_PROVIDER=gemini is the way to it. It is
Ollama now, at the URL the install guide prints, asserting the base the provider
is actually handed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P2r4ca9UPPf7FDk7y8eJLr
@asim
asim merged commit 8359bd1 into main Aug 31, 2026
1 of 2 checks passed

asim commented Nov 17, 2026

Copy link
Copy Markdown
Member Author

@RomainZento — thank you for your contribution to Mu. We're requesting your explicit permission to relicense your OpenAI-compatible native-agent contribution (commit 0800724), incorporated through #1477 in commit 8359bd1, including the portions retained or modified in later Mu versions.

The proposal is in #2180: future Mu runtime releases would be source-available, free for personal/internal use, with a paid licence required for commercial resale or hosting. Micro would also offer separate proprietary commercial licences. MUCP and the SDKs remain permissively licensed. Existing AGPL grants would remain valid.

If you agree, please reply with the following confirmation (identifying the rights-holding entity if you are acting for one):

I hold the relevant rights, or am authorised by the rights holder, in my contribution identified above. I grant Micro XYZ Ltd a worldwide, perpetual, irrevocable, non-exclusive, royalty-free copyright licence to use, reproduce, modify, distribute and sublicense that contribution and derivative works as part of Mu under the proposed Mu Runtime Licence and under separate proprietary commercial licences, including granting customers rights to modify, redistribute and provide hosted services. This is an additional permission; it does not revoke existing AGPL grants or transfer my copyright.

This request concerns only the identified contribution, not future contributions. Attribution will be preserved. If any portion belongs to an employer, co-author or another party and you cannot grant permission for it, please identify that limitation instead. If you would prefer a separate agreement or do not agree, please say so; silence will not be treated as consent.

For reference, the current draft is Mu Runtime Licence draft 1.0.

@zentotech

Copy link
Copy Markdown

Hi Asim,

Thank you for reaching out and for considering my contribution as part of Mu's future development.

I'm glad to see the project evolving.

Before granting permission, I'd like to better understand the implications of the proposed relicensing, particularly regarding commercial sublicensing and the rights associated with my contribution.

I'm not opposed to the proposal, but I'd prefer to review the final licensing terms before providing formal consent.

Thanks for your understanding.

asim commented Nov 17, 2026

Copy link
Copy Markdown
Member Author

@zentotech Thanks Romain — that's a reasonable request. Your response isn't being treated as consent.

I've added a concrete commercial agreement proposal alongside the runtime licence proposal in #2180. These links identify a fixed revision for review. They have not yet received legal review, so I don't want to misrepresent them as final approved terms.

In practical terms:

  • You retain copyright and attribution, and remain free to use and license your own contribution.
  • Existing AGPL recipients retain their rights. The proposed change does not revoke those grants.
  • The permission requested would allow Micro XYZ Ltd to include your contribution in Mu and grant paying customers alternative proprietary terms, including modifying Mu, keeping covered changes closed, distributing agreed products and operating a paid hosted service.
  • The proposed customer agreement limits downstream customers to using distributed products unless wider rights are expressly agreed. It sets out the monthly term and what happens on cancellation.
  • The requested grant is non-exclusive and royalty-free: Micro could charge for these licences without owing you royalties. You would not take on support or other obligations to those customers.
  • It covers your identified contribution, including later derivatives of it, not unrelated code or future contributions.

One important distinction: our original permission request allows separate proprietary commercial licences generally; it is broader than approval of this particular agreement version. If you would only be comfortable with a grant limited to specified terms or versions, please say so and we can review that explicitly.

Please take the time you need to review and raise questions. Your permission remains pending; we'll provide the final reviewed terms before asking you for formal consent, as you requested.

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.

5 participants