[GH-ISSUE #7110] [Bug] --format jsonl shape refusals report unreadable_output/execution_failure with rea doctor guidance #4277

Closed
opened 2026-10-31 00:48:26 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @kaoru0822-kitauji on GitHub (Oct 25, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/7110

Originally assigned to: @kaoru0822-kitauji on GitHub.

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

When --format jsonl is refused because the selected output is not a supported record collection, which is a caller-side format choice, the CLI reports it as an analysis failure:

{"$rea":"jsonl/v1","type":"error","ok":false,"result":{"code":"unreadable_output","category":"execution_failure","message":"Analysis returned an unreadable result. Run `rea doctor` and review the reported details; repeating the unchanged request is not expected to succeed.","retryable":false,"remediation":{"action":"Use --format json for the complete document, or select one record collection with --filter-output."},"details":{"operation":"inspect-sqlite-database","reason":"JSON Lines requires an array or one explicit rows, items, records, or occurrences collection."}}}

The analysis succeeded: the same command with --format json exits 0. Only remediation.action and details.reason describe the real cause. The code, category and message say the analysis output was unreadable and point to rea doctor, which cannot help.

Observed for every selection I tried (exit 1 each time):

Command --filter-output Result
inspect-sqlite-database db.sqlite none refused as above
inspect-sqlite-database db.sqlite --table configInts --row-limit 3 normalized_result.rows refused as above
same normalized_result.rows.values refused as above
inspect-sqlite-database db.sqlite normalized_result.schema.tables (array of objects) refused as above
inspect-macho /System/Applications/Calculator.app normalized_result.imports.items[0,2] refused as above

Related observation: docs/cli.md ("JSON Lines record output") gives normalized_result.rows as the selection example. But inspect-sqlite-database --table returns normalized_result.rows as a columnar object ({columns, values}), so the most row-shaped CLI result I found cannot be exported as JSONL.

Reproduction

sqlite3 /tmp/t.sqlite 'create table configInts(name text primary key, value integer); insert into configInts values ("a",1),("b",2);'
npx -y rea-agents@6.8.0 inspect-sqlite-database /tmp/t.sqlite --table configInts --format jsonl --filter-output normalized_result.rows
echo $?   # 1, code unreadable_output, category execution_failure
npx -y rea-agents@6.8.0 inspect-sqlite-database /tmp/t.sqlite --table configInts --format json > /dev/null; echo $?   # 0

Expected behavior

A JSONL shape refusal should be classified as a caller/output-selection error (for example invalid_request or a dedicated unsupported-output code), and the message should say the selected value is not a JSONL record collection. It should not say the analysis returned unreadable output, and it should not suggest rea doctor. That matches how the CLI already refuses --token-limit with structured output (UNSUPPORTED_OUTPUT_COMBINATION).

Impact and scope

Agents and scripts that branch on code/category treat a successful analysis as a failed one. The doctor advice sends them to the wrong recovery. This affects any command whose result is not a top-level array or a direct rows/items/records/occurrences array.

REA version

6.8.0. The JSONL framing is new in 6.8.0 (changelog breaking change "JSON Lines").

Runtime and platform

macOS 26.7.1 (25G241) arm64, Node.js 24.22.1

Target and artifact context

A small local SQLite database (a copy of an application config DB with five name/value tables); /System/Applications/Calculator.app.

Interface

CLI

Earliest failure stage

Output formatting

Relevant output or evidence

The error record above, verbatim, from the first table row.

Typed outcome or recovery expected

A typed caller-error refusal that keeps the existing remediation text.

Analysis or suspected cause

NOT_ENOUGH_INFO. Not investigated in source. Closed issues #6754, #5846, #5848 and #5954 fixed the same unreadable_output + doctor-guidance misclassification for other refusal paths.

Additional context

None.

Originally created by @kaoru0822-kitauji on GitHub (Oct 25, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/7110 Originally assigned to: @kaoru0822-kitauji on GitHub. ### 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 When `--format jsonl` is refused because the selected output is not a supported record collection, which is a caller-side format choice, the CLI reports it as an analysis failure: ```json {"$rea":"jsonl/v1","type":"error","ok":false,"result":{"code":"unreadable_output","category":"execution_failure","message":"Analysis returned an unreadable result. Run `rea doctor` and review the reported details; repeating the unchanged request is not expected to succeed.","retryable":false,"remediation":{"action":"Use --format json for the complete document, or select one record collection with --filter-output."},"details":{"operation":"inspect-sqlite-database","reason":"JSON Lines requires an array or one explicit rows, items, records, or occurrences collection."}}} ``` The analysis succeeded: the same command with `--format json` exits 0. Only `remediation.action` and `details.reason` describe the real cause. The `code`, `category` and `message` say the analysis output was unreadable and point to `rea doctor`, which cannot help. Observed for every selection I tried (exit 1 each time): | Command | `--filter-output` | Result | |---|---|---| | `inspect-sqlite-database db.sqlite` | none | refused as above | | `inspect-sqlite-database db.sqlite --table configInts --row-limit 3` | `normalized_result.rows` | refused as above | | same | `normalized_result.rows.values` | refused as above | | `inspect-sqlite-database db.sqlite` | `normalized_result.schema.tables` (array of objects) | refused as above | | `inspect-macho /System/Applications/Calculator.app` | `normalized_result.imports.items[0,2]` | refused as above | Related observation: docs/cli.md ("JSON Lines record output") gives `normalized_result.rows` as the selection example. But `inspect-sqlite-database --table` returns `normalized_result.rows` as a columnar object (`{columns, values}`), so the most row-shaped CLI result I found cannot be exported as JSONL. ### Reproduction ```sh sqlite3 /tmp/t.sqlite 'create table configInts(name text primary key, value integer); insert into configInts values ("a",1),("b",2);' npx -y rea-agents@6.8.0 inspect-sqlite-database /tmp/t.sqlite --table configInts --format jsonl --filter-output normalized_result.rows echo $? # 1, code unreadable_output, category execution_failure npx -y rea-agents@6.8.0 inspect-sqlite-database /tmp/t.sqlite --table configInts --format json > /dev/null; echo $? # 0 ``` ### Expected behavior A JSONL shape refusal should be classified as a caller/output-selection error (for example `invalid_request` or a dedicated unsupported-output code), and the message should say the selected value is not a JSONL record collection. It should not say the analysis returned unreadable output, and it should not suggest `rea doctor`. That matches how the CLI already refuses `--token-limit` with structured output (`UNSUPPORTED_OUTPUT_COMBINATION`). ### Impact and scope Agents and scripts that branch on `code`/`category` treat a successful analysis as a failed one. The doctor advice sends them to the wrong recovery. This affects any command whose result is not a top-level array or a direct `rows`/`items`/`records`/`occurrences` array. ### REA version 6.8.0. The JSONL framing is new in 6.8.0 (changelog breaking change "JSON Lines"). ### Runtime and platform macOS 26.7.1 (25G241) arm64, Node.js 24.22.1 ### Target and artifact context A small local SQLite database (a copy of an application config DB with five `name`/`value` tables); `/System/Applications/Calculator.app`. ### Interface CLI ### Earliest failure stage Output formatting ### Relevant output or evidence The error record above, verbatim, from the first table row. ### Typed outcome or recovery expected A typed caller-error refusal that keeps the existing remediation text. ### Analysis or suspected cause NOT_ENOUGH_INFO. Not investigated in source. Closed issues #6754, #5846, #5848 and #5954 fixed the same `unreadable_output` + doctor-guidance misclassification for other refusal paths. ### Additional context None.
bsakaguchi 2026-10-31 00:48:26 +00:00
Author
Owner

@XinwangTao commented on GitHub (Oct 25, 2026):

同意这是个误导性报错,而且比表面更值得修:jsonl 格式拒绝本质是“调用方请求的输出形状与所选记录集合不匹配”,属于用法层面的拒绝,却被归类为 execution_failure 并引导用户跑 rea doctor,排查方向完全错误。建议对这种 caller-side 格式选择错误单独用一类参数/用法错误(如 invalid_format_selection 或类似),retryable 保持 false,remediation 已经写对了(换 --format json 或指定 --filter-output)。另外文档示例 normalized_result.rows 在 inspect-sqlite-database 下实际返回 columnar 对象({columns, values})而不是数组,这个示例需要更新,否则用户照文档操作必然撞上同样的报错。

<!-- gh-comment-id:6396511020 --> @XinwangTao commented on GitHub (Oct 25, 2026): 同意这是个误导性报错,而且比表面更值得修:jsonl 格式拒绝本质是“调用方请求的输出形状与所选记录集合不匹配”,属于用法层面的拒绝,却被归类为 execution_failure 并引导用户跑 rea doctor,排查方向完全错误。建议对这种 caller-side 格式选择错误单独用一类参数/用法错误(如 invalid_format_selection 或类似),retryable 保持 false,remediation 已经写对了(换 --format json 或指定 --filter-output)。另外文档示例 normalized_result.rows 在 inspect-sqlite-database 下实际返回 columnar 对象({columns, values})而不是数组,这个示例需要更新,否则用户照文档操作必然撞上同样的报错。
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#4277
No description provided.