Skip to content

fix(environment): retain conflicting scenario MIME uncertainty - #7994

Closed
ShuaixinHuang wants to merge 1 commit into
morluto:mainfrom
ShuaixinHuang:codex/resubmit-scenario-mime-v2
Closed

ShuaixinHuang wants to merge 1 commit into
morluto:mainfrom
ShuaixinHuang:codex/resubmit-scenario-mime-v2

Conversation

@ShuaixinHuang

@ShuaixinHuang ShuaixinHuang commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Superseded by #8016 at the author's request. Same unchanged feature head a709e628 and three-file scope; prior verification and discussion are retained below.

Problem and result

Replaces #7357 at the author's request, refreshed on pinned main 9593bc53. Only the original three feature files remain; historical shared CI repairs and unrelated imports are excluded.

When a browser scenario records conflicting response Content-Type declarations, preserve MIME uncertainty rather than selecting the first header. Every matching value must remain retained and exactly agree; an excluded value or conflict keeps the type unknown. Identical repeats and independently captured body metadata retain their existing behavior. Original headers and capture evidence remain unchanged.

This is the same existing environment-manifest/replay projection fix. No new MIME parser, dependency, provider, operation, public schema or browser execution authority is added.

Verification

Windows x64, pinned Node24.22.1/npm11.16.0, fresh locked dependencies:

  • Three complete focused files: 36/36 passed — scenario records13, registered public CLI manifest coverage13, timing10.
  • Cases cover conflicting orders, excluded declarations, later repeats after conflict, mixed-case names, identical values, body MIME precedence, manifest/replay consistency and unchanged original capture.
  • npm run check:fast: 2/2 passed,32.671seconds; normal pre-commit and pre-push type/lint2/2passed(cached236ms).
  • npm run check: 5/6 tasks, failing only on unchanged upstream HexRecordRegionMetadata unused type, also tracked by fix: remove unused hex record metadata type #7718. It is not a complete green check; no unrelated fix was imported. The same earlier pinned clean baseline failure was independently reproduced during this resubmission series.

The CLI coverage calls the production registered handler in-process, not a separate compiled CLI/MCP session. No live browser or Linux/macOS local run is claimed. Previous #7357 hosted checks are historical; this head needs its own CI. Net change: 3 files,151 additions/4 deletions.

Author readiness

Human owner: @ShuaixinHuang

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

The human owner explicitly confirmed that review of this published PR was complete in this chat on 2026-10-27. The prior ownership and responsibility confirmation remains in force. This records initial readiness for the published change; subsequent validation remains documented above.

The existing initial human declaration is retained for this same feature and upstream refresh.

Before merge

  • Original focused semantics and explicit uncertainty retained.
  • Evidence and executed validation limits recorded.
  • Latest-head hosted checks complete.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-29T05:23:58.005934Z
We couldn’t complete this review. Comment @codex review to try again.
a709e62 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change reaches browser-scenario MIME use in environment workflows.

The production change appears safe to merge; matching the test fixtures to header-only capture settings would strengthen coverage.

Findings

  1. P2 Header-only test enables body capture ▶
Fix with agent prompt
### Issue 1
tests/boundary/cli/scenarioManifestCoverage.test.ts:136-146
This case leaves `scenarioCaptureFixture` at its defaults: `header_values: false` and `response_body: true`. The real browser does not retain headers with those settings, and this capture passes admission through the body flag rather than the header-only path.

Pass an explicit selection with `header_values: true` and both body flags false. Use the same selection for the new header-only domain cases. That would cover the advertised capture mode instead of relying on inconsistent fixture settings.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

This PR stops header order from choosing a MIME type when retained Content-Type declarations disagree or include an excluded value.

  • Scenario records keep uncertain Content-Type evidence unknown.

Reviews (1) · Last reviewed commit: "fix(environment): retain conflicting sce..." · Reviewed by Greptile

Comment on lines +136 to +146
const capture = scenarioCaptureFixture([
{
method: "GET",
url: "/download",
status: 200,
responseHeaders: values.map((value) => ({
name: "Content-Type",
value,
})),
},
]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Header-only test enables body capture

This case leaves scenarioCaptureFixture at its defaults: header_values: false and response_body: true. The real browser does not retain headers with those settings, and this capture passes admission through the body flag rather than the header-only path.

Pass an explicit selection with header_values: true and both body flags false. Use the same selection for the new header-only domain cases. That would cover the advertised capture mode instead of relying on inconsistent fixture settings.

Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/boundary/cli/scenarioManifestCoverage.test.ts
Line: 136-146

Comment:
**Header-only test enables body capture**

This case leaves `scenarioCaptureFixture` at its defaults: `header_values: false` and `response_body: true`. The real browser does not retain headers with those settings, and this capture passes admission through the body flag rather than the header-only path.

Pass an explicit selection with `header_values: true` and both body flags false. Use the same selection for the new header-only domain cases. That would cover the advertised capture mode instead of relying on inconsistent fixture settings.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

@morluto morluto added bug Something isn't working area: setup Setup, packaging, upgrade, install, Doctor, and client registration labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: setup Setup, packaging, upgrade, install, Doctor, and client registration bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants