[GH-ISSUE #7068] [Bug] An out-of-range record_ordinals entry is reported as invalid_format #4262

Closed
opened 2026-10-31 00:48:14 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @Adolanium on GitHub (Oct 25, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/7068

Before submitting

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

Area

Evidence, artifacts, or reconstruction

Observed behavior

inspect_web_network_capture with a record_ordinals entry past the end of a valid capture returns an invalid_request whose issue is { path: ["record_ordinals"], reason: "invalid_format" }, with no valid range.

Reproduction

Ran on Linux (WSL Ubuntu, Node 24.22.1) at upstream/main 8e6a95788, through the capture inspection service in a test: select record_ordinals: [0, 5] on a capture with fewer than 6 records. The issue reason is invalid_format and it has no minimum or maximum.

Expected behavior

{ path: ["record_ordinals", 1], reason: "out_of_range", minimum: 0, maximum: <records - 1> }.

Impact and scope

Agents and CLI users (--record) correct requests from the issue reason and bounds; they are told the request is malformed instead of being given the valid ordinal range.

REA version

6.7.0, revision 8e6a95788

Runtime and platform

Linux (WSL Ubuntu), Node 24.22.1

Target and artifact context

A fixture HAR capture.

Interface

MCP

Earliest failure stage

Request parsing or validation

Relevant output or evidence

Root cause and fix are in #7067, with the regression test.

Typed outcome or recovery expected

AnalysisInputError with an out_of_range issue on the selected entry.

Analysis or suspected cause

Root cause and fix are in #7067.

Additional context

Fixed by #7067.

Originally created by @Adolanium on GitHub (Oct 25, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/7068 ### 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 Evidence, artifacts, or reconstruction ### Observed behavior `inspect_web_network_capture` with a `record_ordinals` entry past the end of a valid capture returns an `invalid_request` whose issue is `{ path: ["record_ordinals"], reason: "invalid_format" }`, with no valid range. ### Reproduction Ran on Linux (WSL Ubuntu, Node 24.22.1) at upstream/main 8e6a95788, through the capture inspection service in a test: select `record_ordinals: [0, 5]` on a capture with fewer than 6 records. The issue reason is `invalid_format` and it has no `minimum` or `maximum`. ### Expected behavior `{ path: ["record_ordinals", 1], reason: "out_of_range", minimum: 0, maximum: <records - 1> }`. ### Impact and scope Agents and CLI users (`--record`) correct requests from the issue reason and bounds; they are told the request is malformed instead of being given the valid ordinal range. ### REA version 6.7.0, revision `8e6a95788` ### Runtime and platform Linux (WSL Ubuntu), Node 24.22.1 ### Target and artifact context A fixture HAR capture. ### Interface MCP ### Earliest failure stage Request parsing or validation ### Relevant output or evidence Root cause and fix are in #7067, with the regression test. ### Typed outcome or recovery expected `AnalysisInputError` with an `out_of_range` issue on the selected entry. ### Analysis or suspected cause Root cause and fix are in #7067. ### Additional context Fixed by #7067.
Author
Owner

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

这个分类错误确实值得修:invalid_format 语义是"请求畸形、无法理解",而越界是"请求合法但选择超出范围"——对自纠错的 agent 来说前者会让它去检查请求结构,后者则可以直接按 minimum/maximum 重试,错误分类会显著拖慢自动化排查。认可 #7067 把越界归为 selection fault 并带上 bounds 的方向。一个小建议:maximum 的语义最好在错误里与记录总数绑定清楚(例如 <records - 1> 的下界场景),同时把负数索引、重复项等相邻校验统一成同一种 issue 类型,避免 agent 为每种情况写不同的解析分支。

<!-- gh-comment-id:6393563214 --> @XinwangTao commented on GitHub (Oct 25, 2026): 这个分类错误确实值得修:invalid_format 语义是"请求畸形、无法理解",而越界是"请求合法但选择超出范围"——对自纠错的 agent 来说前者会让它去检查请求结构,后者则可以直接按 minimum/maximum 重试,错误分类会显著拖慢自动化排查。认可 #7067 把越界归为 selection fault 并带上 bounds 的方向。一个小建议:maximum 的语义最好在错误里与记录总数绑定清楚(例如 <records - 1> 的下界场景),同时把负数索引、重复项等相邻校验统一成同一种 issue 类型,避免 agent 为每种情况写不同的解析分支。
Author
Owner

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

Thanks. On the adjacent checks:

  • A negative ordinal is already refused by the input schema (z.int().nonnegative()), which projects as { path: ["record_ordinals", i], reason: "out_of_range", minimum: 0 }. With #7067, a too-large ordinal uses the same reason and path shape and adds maximum, so both ends of the range now read the same way.
  • maximum is total_records - 1. The service already requires records.length === total_records with ordinals 0..n-1, so the bound is the last valid ordinal. An empty capture has no valid ordinal and reports invalid_value instead of a range.
  • A duplicate ordinal is a different fault (each entry is in range; the list repeats one), so #7067 leaves that issue as it is to keep the change focused.
<!-- gh-comment-id:6393587396 --> @Adolanium commented on GitHub (Oct 25, 2026): Thanks. On the adjacent checks: - A negative ordinal is already refused by the input schema (`z.int().nonnegative()`), which projects as `{ path: ["record_ordinals", i], reason: "out_of_range", minimum: 0 }`. With #7067, a too-large ordinal uses the same reason and path shape and adds `maximum`, so both ends of the range now read the same way. - `maximum` is `total_records - 1`. The service already requires `records.length === total_records` with ordinals `0..n-1`, so the bound is the last valid ordinal. An empty capture has no valid ordinal and reports `invalid_value` instead of a range. - A duplicate ordinal is a different fault (each entry is in range; the list repeats one), so #7067 leaves that issue as it is to keep the change focused.
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#4262
No description provided.