Repository navigation
Conversation
… responses Keep main's environment serving and fold in coverage for non-entity reads, response summaries, and MCP tool annotations. Squashed rebase of #5352 onto main.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 95c8c9d157
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const [member] = pointerTokens(pointer); | ||
| return member === undefined | ||
| ? `a JSON array of objects ${withFields(items)}` | ||
| : `a JSON object whose ${describeText(member, "member", "capture Evidence", JSON.stringify)} lists objects ${withFields(items)}`; |
There was a problem hiding this comment.
Apply the sample limit after JSON escaping
When a captured envelope member contains escapable characters, describeText checks the raw member against the 1 KiB budget before JSON.stringify expands it—for example, 1,024 NUL characters become more than 6 KiB. A capture with enough such tools can therefore inflate discovery context and exceed the 1 MiB catalog reservation even though every member ostensibly fits the sample limit; bound the rendered JSON string or truncate based on its encoded size instead.
AGENTS.md reference: AGENTS.md:L43-L47
Useful? React with 👍 / 👎.
[Medium impact] The PR changes behavior within environment-state extraction and environment tool serving. The PR appears safe to merge, with a non-blocking fix recommended for quoted wrapper-name budgets.
|
| if ( | ||
| text.length <= DESCRIPTION_SAMPLE_BYTES && | ||
| Buffer.byteLength(text, "utf8") <= DESCRIPTION_SAMPLE_BYTES | ||
| ) | ||
| return text; | ||
| return show(text); |
There was a problem hiding this comment.
Quoted names exceed sample limits
describeText checks the sample size before calling show, but wrapper names now pass JSON.stringify as show. A name containing 1,024 null characters passes the 1,024-byte check and becomes 6,146 bytes when quoted. This exceeds the display budget and can make catalogs hit the discovery limit much earlier.
Apply the sample limit to the quoted text, and cover escaped names in the budget tests.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/application/environment/environmentTools.ts
Line: 93-97
Comment:
**Quoted names exceed sample limits**
`describeText` checks the sample size before calling `show`, but wrapper names now pass `JSON.stringify` as `show`. A name containing 1,024 null characters passes the 1,024-byte check and becomes 6,146 bytes when quoted. This exceeds the display budget and can make catalogs hit the discovery limit much earlier.
Apply the sample limit to the quoted text, and cover escaped names in the budget tests.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Summary
Replacement for fork PR #5352. GitHub Update-branch and a maintainer force-with-lease push to
earakely-scale/reafeat/environment-state-coverageboth failed (the app token cannot update.github/workflows/ci.yml). This is one squashed commit of that PR rebased onto currentmain.Problem and expected behavior
#5352 was conflicting with
mainafter #5351 landed environment serving. The branch should be mergeable again, with serving kept and the coverage work still present: non-entity reads held as documents, tool descriptions that summarize recorded responses, and MCP annotations for safe methods including OPTIONS and TRACE.Change and scope
Started from
origin/main, mergedpull/5352/head, and resolved conflicts so #5351 serving stays and #5352's coverage, response descriptions, and annotations stay. Squashed to one commit. Not a provider, injection, or target-execution change. Contribution scope: ordinary environment-serving behavior within the existing serve boundary. Maintainer scope decision: not applicable.Follow the contribution scope.
Contract and boundary impact
docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs andskills/; edit authored instructions in.agents/skills/reverse-engineer-anything/and never commit build outputs): none committed.Expected effects (check known effects; use documentation-only on its own).
Evidence and regression coverage
npm run typecheckpassed on this tree.For evidence-bearing changes:
Validation performed
npm run typecheck— passed on the resolved tree before squash (same tree as this commit).Compatibility, safety, and release
--replay-only, and the data plane stay as on main.Stack: this commit is the base of
cursor/rebase-5600(#5600 replacement) andcursor/rebase-5699(#5699 replacement). Merging a later branch also brings this commit.Author readiness
Human owner: @morluto
Before merge
type(scope): outcome.