Repository navigation
Resolve conflicts for OpenAI-compatible native agents - #1477
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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".
| if base := settings.Get("OPENAI_BASE_URL"); base != "" { | ||
| return ai.ProviderLocal, settings.Get("OPENAI_API_KEY"), openAIModel(), base, true |
There was a problem hiding this comment.
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 👍 / 👎.
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
|
@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):
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. |
|
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. |
|
@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:
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. |
Summary
maininto the OpenAI-compatible native agent workOPENAI_BASE_URLthroughagent.BaseURLfor compatible endpointsTesting
go test ./agentgofmt -l .git diff --check(reports pre-existing whitespace from the merged main branch)