Skip to content

gentle_review tool dropped under Claude Agent SDK providers: top-level anyOf in its input schema #1698

Closed

Description

@AlejandroTatum

Before submitting

  • I searched open and closed issues and did not find a report of this problem.
  • I reviewed this report and removed credentials, tokens, private paths, hostnames, and other sensitive data.

Problem

The gentle_review tool is never exposed to the model when Pi runs on a Claude Agent SDK provider (for example pi-claude-bridge). The sibling tools gentle_review_capture, gentle_review_capture_group, and gentle_review_scope do appear. Without gentle_review there is no inspect/START entry point, so the whole native review (RDD) lifecycle is unreachable: no consent panel, and review subagents are rejected with "no current controller-owned candidate view lineage binding".

Root cause: REVIEW_CONTROLLER_PARAMETERS (extensions/gentle-ai.ts, around line 4869) is an object schema with a top-level anyOf (used to split start/assess from the other operations). The Anthropic API rejects oneOf/anyOf/allOf at the top level of a tool input_schema, and Claude Code silently drops MCP tools whose schema fails that check. The other review tools use plain object schemas, which is why only gentle_review disappears.

Steps to reproduce

  1. Install gentle-pi v4.0.0 and pi-claude-bridge (0.9.1) and select a Claude model served through the bridge.
  2. Start a Pi session in any Git repository with the review switch enabled.
  3. List the available tools, or ask the agent to call gentle_review with {"operation":"inspect"}.
  4. Observe that gentle_review is absent while gentle_review_capture, gentle_review_capture_group, and gentle_review_scope are present. /reload does not change it.

Expected and actual behavior

Expected: gentle_review is available on every provider, so the agent can run inspect and START.
Actual: under Claude Agent SDK providers, gentle_review is dropped from the tool list and native review cannot start.

Suggested fix: keep the top-level schema a plain type: "object" (the union of operations and inputs already lives in properties) and move the per-operation start/assess vs. string-only input rule into runtime validation inside execute, or into nested properties only.

Local workaround applied in the bridge: strip top-level oneOf/anyOf/allOf from each tool's inputSchema in the MCP tools/list response. Pi still validates arguments against the original registered schema.

gentle-pi version

4.0.0 (commit 1f35ab1)

Pi version

1.0.0

Operating system

Linux

Relevant logs or error output (optional)

No response

Activity

  1. carlosmoradev commented on Oct 3, 2026

    @carlosmoradev
    Contributor

    Spot-on diagnosis, @AlejandroTatum.

    The root cause is indeed the top-level anyOf in REVIEW_CONTROLLER_PARAMETERS (extensions/gentle-ai.ts:4869), introduced in #1678 to distinguish START/ASSESS from string-only operations.

    While Pi's internal Anthropic adapter (streamAnthropic) runs a custom pre-transport pass that strips root anyOf and falls back to root properties, external runtimes like pi-claude-bridge and Claude Code consume the registered tool schema directly via MCP tools/list. The Anthropic API enforces strict JSON Schema requirements on tool input_schema and rejects root-level union combinators (anyOf, oneOf, allOf), causing Claude Code to drop gentle_review entirely.

    The clean architectural fix:

    1. Flatten root schema to type: "object": Drop the root anyOf from REVIEW_CONTROLLER_PARAMETERS. The nested anyOf under properties.input ([REVIEW_JSON_STRING, { type: "object" }, { type: "null" }]) is standard and valid across all providers.
    2. Preserve fail-closed runtime safety: parseReviewControllerParameters (lines 5136-5140) already enforces that non-START/ASSESS operations reject objects with Review controller input must be a string.

    We verified this locally: flattening the root schema restores tool registration in Claude Agent SDK while keeping all validation tests and controller authority gates 100% fail-closed.

  2. matraket commented on Oct 5, 2026

    @matraket
    Contributor

    Independent confirmation from a Gentle Shell standalone setup (WSL2, Pi 1.0.0, pi-claude-bridge 0.9.0, gentle-pi main a8ecb141). It has reproduced in every session since 2026-10-03, and since then we have been running every RDD review from a separate native Claude Code session.

    Additional evidence that closes the diagnosis:

    • It is not tool deferral. The bridge hands 66 tools to Claude Code. The prompt_snapshot attachment in the CC transcript shows 64 tools sent to the API, without gentle_review. There is no deferred_tools_delta attachment.
    • Minimal repro, no model calls. With Agent SDK 0.3.281 (CC 2.1.281), tools: [], and an in-process MCP server like the bridge's, I registered two tools that differ only by a root-level anyOf. The system/init message lists only the plain tool; the other one is dropped before any request, with no diagnostic.
    • Timeline. The root anyOf landed in 1f345106 (fix(review): accept JSON object arguments without weakening authority #1678, 2026-10-02), and the symptom started the next day.

    #1710 fixes it and already has green CI and a review. Could a maintainer triage this issue (status:approved) to unblock #1710? Until then, the RDD lifecycle is unreachable from every Claude Agent SDK based provider. If it helps, I am happy to validate #1710 end to end on this setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:approvedIssue approved by maintainer; PR may be openedtype:bugBug fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions