ChatGPT OAuth agents fail text turns when native image_generation tool is attached
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
Inizia riproducendo la richiesta di testo ChatGPT OAuth con il comando curl fornito, quindi esamina internal/agent/loop_pipeline_callbacks.go e internal/pipeline/think_stage.go per la gestione dei native tools. Traccia l’attachment image_generation e i controlli del nome dello strumento attraverso i percorsi degli agent elencati. Il lavoro è completato quando non si verificano nil panic, nessuno strumento nativo per la generazione di immagini viene usato per impostazione predefinita nei normali turni di testo ed esiste una copertura di regressione per strumenti misti e richieste di testo OAuth.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What to build
Fix ChatGPT Subscription (OAuth) agent runs so ordinary text turns do not fail when native image_generation support is available.
On a v3.14.0 deployment using a ChatGPT OAuth provider (chatgpt_oauth) and an agent configured with gpt-5.5, a simple text message to the agent can fail before any useful answer is persisted. The failure has two related parts:
-
The agent loop injects the native Responses API tool sentinel:
{ "type": "image_generation" }into normal text chat turns whenever the provider advertises image generation capability.
-
Several tool-processing paths assume every tool definition is a function tool and dereference
td.Function.Name. Native tools haveFunction == nil, so this can panic.
Observed stack traces included nil pointer panics in paths such as:
internal/agent/loop_pipeline_callbacks.gowhile counting or checking tool namesinternal/pipeline/think_stage.gowhile buildingAllowedTools
After adding local nil guards, the request no longer panicked, but ChatGPT OAuth still returned an upstream 500 for a simple text turn when the native image_generation tool was included. Disabling image generation for that agent via:
{
"allow_image_generation": false
}
made the same agent reply successfully.
Acceptance criteria
- Native provider tools with
Function == nilnever panic the agent loop, pipeline, tool filtering, history metadata, tracing, or retry guard paths. - Ordinary text-only turns for ChatGPT OAuth agents do not attach
image_generationunless image generation is explicitly requested or otherwise intentionally enabled for that turn. - If
allow_image_generationremains the control, document it and/or expose it in agent/provider settings so admins can disable the native image tool without editing hidden JSON. - Add regression tests covering a tool list that contains both a function tool and
{ "type": "image_generation" }. - Add a regression test or fixture showing a ChatGPT OAuth text turn does not include
image_generationby default.
Reproduction notes
Environment:
- GoClaw
v3.14.0 - DB schema
80 - Provider type:
chatgpt_oauth - Model:
gpt-5.5 - Agent: predefined agent using the ChatGPT OAuth provider
Minimal request:
curl http://localhost:18790/v1/chat/completions \
-H "Authorization: Bearer $GOCLAW_GATEWAY_TOKEN" \
-H "X-GoClaw-User-Id: system" \
-H "X-GoClaw-Tenant-Id: <tenant-id>" \
-H "Content-Type: application/json" \
-d '{
"model": "agent:rook",
"messages": [{"role": "user", "content": "xin chào"}],
"stream": false,
"user": "system"
}'
Observed behavior before local workaround:
- HTTP connection can close with an empty reply due to panic.
- After nil guards, the request can return a structured 500 from the ChatGPT OAuth backend when
image_generationis still attached to the text turn. - Session history may remain at 0 messages because the turn fails before final persistence.
Observed workaround:
- Set
other_config.allow_image_generation=falsefor the affected agent. - Recreate/restart the service so the agent config is reloaded.
- The same text request returns HTTP 200 and persists user+assistant messages.
Blocked by
None - can start immediately.
- Lingua principale
- Go
- Stelle
- 3.7k
- Fork
- 1.1k
- Merge medio
- 1g 8h
- PR unite (30g)
- 11
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di nextlevelbuilder/goclaw
-
Install for system dependency "node" fails on Alpine: the package is "nodejs"Forse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertaagent:github-maintain area:skills bug maintain:triaged P2-medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
nextlevelbuilder/goclaw#1594 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Bug: MCP arg validation false positive — substring match on '-c' blocks legitimate package namesForse già presa @nguyennguyenit l’ha presa 174 giorni fa. Apertaagent:github-maintain area:mcp area:security bug fix-in-review good first issue maintain:triaged P2-medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
nextlevelbuilder/goclaw#1027 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
agent:github-maintain area:sandbox area:security maintain:triaged question
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
nextlevelbuilder/goclaw#994 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
agent:github-maintain maintain:triaged P2-medium P3-low
Difficoltà 1/5 1-3 ore Idoneità per principianti 86/100
nextlevelbuilder/goclaw#473 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
agent:github-maintain enhancement maintain:triaged
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
nextlevelbuilder/goclaw#439 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di nextlevelbuilder/goclaw
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
-
Energy flow: add an "Other" row so the consumers add up to the consumption totalForse già presa @github-actions l’ha presa oggi. Apertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
evcc-io/evcc#35512 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
nebari-dev/nebi#630 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
router-for-me/CLIProxyAPI#7084 ·
I maintainer di solito rispondono entro 1 giorno