Pinned Custom OpenAI subagents use the global Agent service profile instead of their selected profile
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start in the native agent factory, where createAgent() and createManualAgent() call createExecutor() without passing the subagent's ModelSelection, then follow it into LLMClientFactory.createClient(). Check where CustomServicesSettings.customServiceStateForFeatureType(AGENT) reads the global selection instead of the explicit serviceId. Run AgentProviderIntegrationTest to reproduce. Done means a pinned Custom OpenAI subagent uses its own profile while the parent keeps its Ollama or other global selection. The attached patch is a reference, not a verified fix.
Written by the indexing model from the issue text.
Description
What happened?
Summary
A native subagent explicitly pinned to a Custom OpenAI model does not pass its full ModelSelection through to LLM client creation. The Custom OpenAI client resolves its service from the global Agent feature selection instead. This can fail when the parent uses Ollama, and can select the wrong endpoint/credentials when parent and child use different Custom OpenAI profiles.
Affected version and proposed fix
Base commit: 1c7a8569fe5e34bb64cbc10fa32e6918e8358d98
Upstream version: 3.8.2 / 3.8.2-261
Community build identifier: 3.8.3-subagent-fix.1-261
Declared IntelliJ Platform compatibility: 261–262.*
Root cause
The runtime resolver and Task tool already pass the resolved subagent selection into AgentFactory. However, both createAgent() and createManualAgent() call createExecutor() without forwarding that selection. LLMClientFactory.createClient() consequently resolves Custom OpenAI settings from the global feature rather than the selected subagent service ID.
Patch
- Add an optional ModelSelection argument to createExecutor() and createClient();
- Forward it from both native agent factory methods;
- Resolve Custom OpenAI service settings by the explicit selection's serviceId when present;
- Retain feature-based lookup for calls without an explicit selection;
- Reject mismatched providers and missing/nonexistent selected services explicitly.
The patch also adds two regression test methods: one exercises manual and built-in agents under a global Ollama selection, and one exercises a separate Custom OpenAI child profile.
ProxyAI_Subagent_Fix_Guide_EN.md
Validation
The accompanying build notes report successful compilation and plugin packaging, 18 passing AgentProviderIntegrationTest tests, ZIP checks, and a clean git diff --check.
A separate source review confirmed clean application to the pinned base commit and a passing git diff --check. It did not rerun compilation or tests and did not inspect the compiled binary. The added tests run the real agent executor against an HTTP mock harness; they do not cover the full parent-to-Task delegation flow or assert the outgoing authorization header. Real-server testing and full Plugin Verifier results are not included in the supplied build notes.
Scope
This fix concerns native subagent Custom OpenAI profile selection. It does not modify external ACP agents, context compaction, or the model's decision to call tools, and should not be treated as a universal fix for agent stalls.
Relevant log output or stack trace
Steps to reproduce
Reproduction: Ollama parent, Custom OpenAI child
- Configure the main Agent feature to use Ollama.
- Configure a valid Custom OpenAI service profile.
- Pin a native subagent to that Custom OpenAI profile/model rather than inheriting the parent's model.
- Invoke the subagent.
Expected: the subagent uses its own Custom OpenAI profile; the main agent remains configured for Ollama.
Actual code path: CustomServicesSettings.customServiceStateForFeatureType(AGENT) reads the global Ollama selection and throws an IllegalStateException because it is not CUSTOM_OPENAI.
Reproduction: different Custom OpenAI profiles
- Select Custom OpenAI profile A for the main Agent feature.
- Pin a native subagent to profile B.
- Invoke the subagent and inspect which server receives the request.
Expected: client configuration and credentials come from profile B.
Actual code path: client construction looks up profile A through the global Agent feature selection.
CodeGPT version
3.8.2
Operating System
macOS
- Dominant language
- Kotlin
- Stars
- 1.9k
- Forks
- 401
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from carlrobertoh/ProxyAI
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
carlrobertoh/ProxyAI#1250 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
carlrobertoh/ProxyAI#1233 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
carlrobertoh/ProxyAI#1203 · 1 reaction ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
carlrobertoh/ProxyAI#1160 · 2 reactions ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
carlrobertoh/ProxyAI#1068 ·
All issues in carlrobertoh/ProxyAI
Similar issues
-
Location search keeps showing stale "Open-Meteo can't find ..." message after clearing search queryOpenBug Needs review
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
breezy-weather/breezy-weather#3082 ·
Maintainers usually reply within 2 days
-
Difficulty 1/5 1-3 hours Newbie friendliness 76/100
wangzan101/Mika#1033 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
commons-app/apps-android-commons#7486 ·
Maintainers usually reply within 1 day
-
area: ci area: local-media area: startup area: ui platform: bilibili platform: netease platform: youtube status: needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
cwuom/NeriPlayer#794 ·
Maintainers usually reply within 1 day
-
area:android area:ui bug priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
meraxes89/streamify-apk#449 ·
Maintainers usually reply within 1 day