[GH-ISSUE #6838] [Bug] setup and doctor schemas accept client IDs that their parser rejects #4182

Closed
opened 2026-10-31 00:47:29 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @coygeek on GitHub (Oct 23, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/6838

Before submitting

  • I searched the open and closed issues for a related report.
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

CLI

Observed behavior

The executed setup --schema and doctor --schema discovery paths advertise each client item as an unrestricted string. setup similarly advertises skillClient as shared or any string. Their actual parser accepts only the names in SUPPORTED_CLIENT_DEFINITIONS and rejects an unlisted name with Unsupported agent integration.

This loses the allowed choices at the CLI schema boundary. By comparison, the same doctor schema correctly exposes the five allowed provider IDs as an enum.

Reproduction

From the source checkout with its locked dependencies installed, run this provider-free probe. It registers the production setup commands and executes their schema discovery; Parser.parse checks the production options without running setup or changing any configuration.

node --import tsx --input-type=module <<'JS'
import { Cli, Parser } from 'incur';
import pino from 'pino';
import { registerSetupCommands } from './src/cli/setupCommands.ts';
import { presentOmittableDefaults } from './src/cli/omittableDefaults.ts';
const cli = Cli.create('rea', { sync: false });
registerSetupCommands(cli, pino({ level: 'silent' }), {});
presentOmittableDefaults(cli);
for (const command of ['setup', 'doctor']) {
  let output = '';
  await cli.serve([command, '--schema'], {
    stdout: text => { output += text; },
    stderr: text => { output += text; },
  });
  console.log(command, output.trim());
}
const command = Cli.toCommands.get(cli).get('setup');
for (const value of ['codex', 'unknown-client']) {
  try {
    console.log(value, Parser.parse(['--client', value], {
      options: command.options,
    }).options.client);
  } catch (error) {
    console.log(value, error.message);
  }
}
JS

Observed in one execution: both schemas omitted a client enum; codex parsed successfully, while unknown-client was rejected. The schema permits both values.

Expected behavior

Expose the parser's finite client choices in client.items.enum, and include those choices plus shared for setup's skillClient. Machine-readable CLI discovery should preserve the validation contract. The repository's schema guidance requires validating advertised schemas against their actual consumers; doctor.provider already uses an enum for this purpose.

Impact and scope

Agents and other schema consumers cannot discover the accepted integration IDs or reject unsupported IDs using these schemas. A schema-valid setup/doctor request can fail at parsing. The observed scope is setup.client, setup.skillClient, and doctor.client; no setup actions, providers, or real client configuration were executed. A working client ID such as codex can be supplied manually.

REA version

Package 6.7.0; source revision 169512a35bb015ff209168fb8bc1c9b31a2c678b.

Runtime and platform

Node.js v26.12.1; Linux 7.2.8-9-omarchy, x86_64. No analysis provider involved.

Target and artifact context

Production CLI registration and schema discovery with synthetic client ID strings; no target artifact.

Interface

CLI

Earliest failure stage

Request parsing or validation

Relevant output or evidence

Executed schema output included:

client:
  description: Agent registration whose readiness is required; repeatable
  default: []
  type: array
  items:
    type: string
provider:
  description: Deep-analysis provider whose readiness is required
  default: []
  type: array
  items:
    type: string
    enum[5]: hopper,ghidra,ida,jadx,kuna

The rejected ID produced Unsupported agent integration, with the issue path client.0. The shared client schema is a string with a refinement, rather than an enum. Setup consumes it in both client selectors, and doctor consumes it beside the correctly enumerated provider selector.

NOT_ENOUGH_INFO: no downstream agent session was tested; the observed defect is the schema/parser mismatch itself.

Typed outcome or recovery expected

The schema should enumerate the accepted names before invocation; an unsupported name should remain a validation error.

Analysis or suspected cause

Source-derived: the custom refinement restricts runtime values, but its allowed set is not represented in the generated JSON Schema. The provider selector demonstrates the existing enum-based representation.

Additional context

The initial open-issue inventory was searched in titles and bodies for client/schema/enum and supported-integration terms. No matching primary report was identified. Fresh open and closed duplicate searches remain for submission.

Triage assessment

  • Impact level: P2
  • Assessment status: supported
  • Impact basis: Machine-readable CLI discovery admits values the production parser rejects and omits the finite accepted integration choices for setup and doctor.
  • Workaround status: available
  • Workaround basis: Supply a known accepted ID manually; the probe successfully parsed codex without changing configuration.
Originally created by @coygeek on GitHub (Oct 23, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/6838 ### Before submitting - [x] I searched the open and closed issues for a related report. - [x] I removed credentials, tokens, private paths, and sensitive target data. ### Area CLI ### Observed behavior The executed `setup --schema` and `doctor --schema` discovery paths advertise each `client` item as an unrestricted string. `setup` similarly advertises `skillClient` as `shared` or any string. Their actual parser accepts only the names in `SUPPORTED_CLIENT_DEFINITIONS` and rejects an unlisted name with `Unsupported agent integration`. This loses the allowed choices at the CLI schema boundary. By comparison, the same `doctor` schema correctly exposes the five allowed provider IDs as an enum. ### Reproduction From the source checkout with its locked dependencies installed, run this provider-free probe. It registers the production setup commands and executes their schema discovery; `Parser.parse` checks the production options without running setup or changing any configuration. ```sh node --import tsx --input-type=module <<'JS' import { Cli, Parser } from 'incur'; import pino from 'pino'; import { registerSetupCommands } from './src/cli/setupCommands.ts'; import { presentOmittableDefaults } from './src/cli/omittableDefaults.ts'; const cli = Cli.create('rea', { sync: false }); registerSetupCommands(cli, pino({ level: 'silent' }), {}); presentOmittableDefaults(cli); for (const command of ['setup', 'doctor']) { let output = ''; await cli.serve([command, '--schema'], { stdout: text => { output += text; }, stderr: text => { output += text; }, }); console.log(command, output.trim()); } const command = Cli.toCommands.get(cli).get('setup'); for (const value of ['codex', 'unknown-client']) { try { console.log(value, Parser.parse(['--client', value], { options: command.options, }).options.client); } catch (error) { console.log(value, error.message); } } JS ``` Observed in one execution: both schemas omitted a `client` enum; `codex` parsed successfully, while `unknown-client` was rejected. The schema permits both values. ### Expected behavior Expose the parser's finite client choices in `client.items.enum`, and include those choices plus `shared` for `setup`'s `skillClient`. Machine-readable CLI discovery should preserve the validation contract. The repository's [schema guidance](https://github.com/morluto/rea/blob/169512a35bb015ff209168fb8bc1c9b31a2c678b/AGENTS.md#architecture-and-cleanup) requires validating advertised schemas against their actual consumers; `doctor.provider` already uses an enum for this purpose. ### Impact and scope Agents and other schema consumers cannot discover the accepted integration IDs or reject unsupported IDs using these schemas. A schema-valid setup/doctor request can fail at parsing. The observed scope is `setup.client`, `setup.skillClient`, and `doctor.client`; no setup actions, providers, or real client configuration were executed. A working client ID such as `codex` can be supplied manually. ### REA version Package 6.7.0; source revision `169512a35bb015ff209168fb8bc1c9b31a2c678b`. ### Runtime and platform Node.js v26.12.1; Linux 7.2.8-9-omarchy, x86_64. No analysis provider involved. ### Target and artifact context Production CLI registration and schema discovery with synthetic client ID strings; no target artifact. ### Interface CLI ### Earliest failure stage Request parsing or validation ### Relevant output or evidence Executed schema output included: ```text client: description: Agent registration whose readiness is required; repeatable default: [] type: array items: type: string provider: description: Deep-analysis provider whose readiness is required default: [] type: array items: type: string enum[5]: hopper,ghidra,ida,jadx,kuna ``` The rejected ID produced `Unsupported agent integration`, with the issue path `client.0`. [The shared client schema is a string with a refinement](https://github.com/morluto/rea/blob/169512a35bb015ff209168fb8bc1c9b31a2c678b/src/cli/setupCommands.ts#L26-L33), rather than an enum. [Setup consumes it in both client selectors](https://github.com/morluto/rea/blob/169512a35bb015ff209168fb8bc1c9b31a2c678b/src/cli/setupCommands.ts#L63-L70), and [doctor consumes it beside the correctly enumerated provider selector](https://github.com/morluto/rea/blob/169512a35bb015ff209168fb8bc1c9b31a2c678b/src/cli/setupCommands.ts#L110-L117). NOT_ENOUGH_INFO: no downstream agent session was tested; the observed defect is the schema/parser mismatch itself. ### Typed outcome or recovery expected The schema should enumerate the accepted names before invocation; an unsupported name should remain a validation error. ### Analysis or suspected cause Source-derived: the custom refinement restricts runtime values, but its allowed set is not represented in the generated JSON Schema. The provider selector demonstrates the existing enum-based representation. ### Additional context The initial open-issue inventory was searched in titles and bodies for client/schema/enum and supported-integration terms. No matching primary report was identified. Fresh open and closed duplicate searches remain for submission. ## Triage assessment - Impact level: P2 - Assessment status: supported - Impact basis: Machine-readable CLI discovery admits values the production parser rejects and omits the finite accepted integration choices for setup and doctor. - Workaround status: available - Workaround basis: Supply a known accepted ID manually; the probe successfully parsed `codex` without changing configuration.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#4182
No description provided.