Forced submit tool_choice is rejected by Claude Opus 5.5 and Fable 5.2 (HTTP 400)

オープン
#46 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

@pkieltyka がすでに取り組んでいます。

2026年11月19日 から。

  • #66 @pkieltyka による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
typescript

調査の方向性

Read src/llm/pi-runner.ts around line 1962 and the provider model lookup in src/provider/provider-services.ts around lines 491–506. Trace how tool_choice is selected for Anthropic requests, then inspect existing tests for request construction and error handling. Done means the two named models send an accepted choice by default, existing providers and older models retain forced-submit behavior, and validation, retry, and provenance remain unchanged.

索引モデルが issue の本文から書いたものです。

説明

bug

Problem

On the direct Anthropic provider, codegenie's default structured-submit calls force the submit tool (tool_choice of type tool or any) while adaptive thinking is on. Claude Opus 5.5 and Fable 5.2 reject that request:

HTTP 400 invalid_request_error: tool_choice: type "tool" and "any" are not supported for this model

so every review with these models fails. The default setup path picks one of them without the user typing its ID: with only Anthropic configured, codegenie provider use opus resolves to anthropic/claude-opus-5-5, and the post-login default goes through the same lookup (src/provider/provider-services.ts:491-506).

The forced choice is set at src/llm/pi-runner.ts:1962. Pi 1.5.2 passes it through unchanged and has no fallback for this error. The earlier "Anthropic falls back" behaviour (PR #38) concerns strict schema sampling, which is a different field.

Evidence

Live check on 2026-11-19, against Anthropic's token-count endpoint only (no generation calls), using the request shape codegenie 0.8.0 actually sends (the stage-5 submit_plan tool):

model tool_choice thinking result
claude-opus-5-5 forced adaptive 400, as above
claude-opus-5-5 auto adaptive 200
claude-fable-5-2 forced adaptive 400, as above
claude-fable-5-2 auto adaptive 200
claude-opus-5 forced disabled 200 (the model CI uses, which is why CI passes)

Vendor documentation: https://platform.claude.com/docs/en/models/opus-5-5/whats-new-opus-5-5 and https://platform.claude.com/docs/en/models/fable-5-2/whats-new-fable-5-2

Workaround for users today: [llm] forceSubmitToolChoice = false.

Acceptance criteria

  • With default settings, reviews on anthropic/claude-opus-5-5 and anthropic/claude-fable-5-2 send a tool_choice the model accepts.
  • Older Claude models (for example Opus 5) and other providers keep their current forced-submit behaviour.
  • Submit validation, retry and provenance behaviour are unchanged.
  • A test reproduces the 400 request shape for the new models and fails without the fix.
  • Before merge, one live end-to-end review on a tiny diff with each of the two models succeeds (owner-approved cost).

Found during the #44 deep review.

主要言語
TypeScript
スター
8
フォーク
1
平均マージ
5分
マージ済み PR(30日)
2

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

0xPolygon/codegenie のほかの issue

0xPolygon/codegenie の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。