Skip to content

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

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

ShuaixinHuang wants to merge 3 commits into
morluto:mainfrom
ShuaixinHuang:codex/resubmit-scenario-mime-v2

Conversation

@ShuaixinHuang

@ShuaixinHuang ShuaixinHuang commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Re-submitted from #7994 at the human owner's request. This is the same three-file MIME uncertainty fix at unchanged head a709e628; no new code or expanded scope. #7994 had successful required CI, title and readiness checks, but this replacement must run its own checks before those results can be reported for this PR.

Problem and result

Originally 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. The local results above were executed for the existing feature. #7994 hosted CI (run 40823169389) passed for this same head; replacement-PR CI is separate and pending. Net change: 3 files,151 additions/4 deletions.

CI integration follow-up

The original 36-case MIME/source/registered CLI validation above remains evidence for the unchanged three-file feature. On this replacement PR's old head a709e628, its own hosted CI run 40842606435 failed in one shared MCP test: bundleComparisonMcp.test.ts expected an English field/message concatenation, while the newer upstream SDK reports the exact field and reason through structured details.issues.

The actual executed merge was 07046aa59e5d839c2c04bacb34add96ee7c26986. That test and its MCP diagnostic producers match the already investigated failure family. Updating only the assertion to require the typed code, category, operation, exact rejected field path and invalid_format reason passes the complete 9/9 MCP file on that exact merge; all relative refusal combinations, absolute success and CLI/cwd controls remain. No production files or unrelated main changes were imported.

Follow-up 0cddadbe adds only this test correction (9 additions / 5 deletions). Normal pre-commit and pre-push typecheck/lint passed 2/2 (53.584 seconds). The integration test was run against the actual CI merge with the same patch, not claimed against the older standalone SDK on the feature branch. New hosted checks for this follow-up head are still required.

Remaining SDK diagnostic regressions

Run 40848792761 at old head 0cddadbe failed in two other tests that expected concatenated SDK error text: the compiled CLI/stdio bundle-comparison boundary and Flutter's ABI selector grammar boundary. Its actual executed merge was 65d42a1c482f9887eb4a7f5a3d99d6f95db2212a; hosted results were 2 failed / 2035 passed / 11 skipped in that shard.

Follow-up bcebcd23 changes only those two existing tests (29 additions / 17 deletions). The existing strict error-envelope parser now checks code, category, operation and exact issue path, plus the precise ABI reason: empty is out_of_range, slash-containing is invalid_format, and overlong Unicode/line-terminated values are invalid_value. All Ajv rejection/acceptance cases, stdio relative-path refusals, absolute-path success and CLI cwd controls remain.

On that exact CI merge with the identical patch, both complete files pass 19/19, with the matching three build tasks successful. No MIME, Flutter or path production code changed. Normal pre-commit passed and normal pre-push typecheck/lint passed 2/2 (1m13.607s). Earlier feature and full-check evidence retains its original execution point; the new head requires its own hosted CI.

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-29T08:30:23.260413Z
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 runtime change is contained to browser-scenario analysis workflows.

The PR is not ready to merge because the previously reported MCP test mismatch remains.

Findings

  1. P1 MCP error assertion fails ▶
Fix with agent prompt
### Issue 1
tests/boundary/mcp/bundleComparisonMcp.test.ts:171-172
Relative paths fail the SDK schema check, and `normalizeSdkValidationError` turns that failure into one issue with `path: []` and `reason: "invalid_value"`. `projectAnalysisError` preserves those values. Expecting `[rejectedField]` and `"invalid_format"` therefore makes this test fail on its first relative-path case.

Match the existing error contract and check the retained message for the rejected field.

---

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

Summary

Preserves unknown MIME types when captured Content-Type declarations conflict or include excluded values.

  • Scenario records keep uncertain MIME types unknown.
  • CLI and MCP tests check structured error details.

Reviews (3) · Last reviewed commit: "test(mcp): assert typed selector and std..." · Reviewed by Greptile

Comment on lines +171 to +172
path: [rejectedField],
reason: "invalid_format",

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.

P1 MCP error assertion fails

Relative paths fail the SDK schema check, and normalizeSdkValidationError turns that failure into one issue with path: [] and reason: "invalid_value". projectAnalysisError preserves those values. Expecting [rejectedField] and "invalid_format" therefore makes this test fail on its first relative-path case.

Match the existing error contract and check the retained message for the rejected field.

Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/boundary/mcp/bundleComparisonMcp.test.ts
Line: 171-172

Comment:
**MCP error assertion fails**

Relative paths fail the SDK schema check, and `normalizeSdkValidationError` turns that failure into one issue with `path: []` and `reason: "invalid_value"`. `projectAnalysisError` preserves those values. Expecting `[rejectedField]` and `"invalid_format"` therefore makes this test fail on its first relative-path case.

Match the existing error contract and check the retained message for the rejected field.

---

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