ChatGPT OAuth agents fail text turns when native image_generation tool is attached
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず、提供された curl コマンドで ChatGPT OAuth テキストリクエストを再現し、次に native tools の処理について internal/agent/loop_pipeline_callbacks.go と internal/pipeline/think_stage.go を調べます。列挙された agent パス全体で image_generation アタッチメントとツール名のチェックを追跡します。完了の条件は、nil panic が発生せず、通常のテキストターンではデフォルトでネイティブ画像ツールが使用されず、混在するツールと OAuth テキストリクエストに対するリグレッションカバレッジがあることです。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Go
- スター
- 3.7k
- フォーク
- 1.1k
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 11
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nextlevelbuilder/goclaw のほかの issue
-
Install for system dependency "node" fails on Alpine: the package is "nodejs"再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンagent:github-maintain area:skills bug maintain:triaged P2-medium
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
nextlevelbuilder/goclaw#1594 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Bug: MCP arg validation false positive — substring match on '-c' blocks legitimate package names対応中かも @nguyennguyenit が 175 日前に担当しました。 オープンagent:github-maintain area:mcp area:security bug fix-in-review good first issue maintain:triaged P2-medium
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
nextlevelbuilder/goclaw#1027 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
agent:github-maintain area:sandbox area:security maintain:triaged question
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
nextlevelbuilder/goclaw#994 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
agent:github-maintain maintain:triaged P2-medium P3-low
難易度 1/5 1〜3時間 初心者へのやさしさ 86/100
nextlevelbuilder/goclaw#473 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
agent:github-maintain enhancement maintain:triaged
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
nextlevelbuilder/goclaw#439 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
nextlevelbuilder/goclaw の issue をすべて見る
似ている issue
-
VLAgent `spec.k8sCollector.includePodLabels: false` has no effect対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
VictoriaMetrics/operator#2772 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Gaurav-Gosain/tuios#1316 ·
メンテナーはふだん 1 日以内に返信
-
needs: investigation
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
area:auth documentation priority:low
難易度 1/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信
-
Mend: dependency security vulnerability
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
kube-tarian/sigrun#203 ·