Skip to content

fix(ssestream): preserve decoder parameter value case - #852

Open
charle-z wants to merge 18 commits into
openai:mainfrom
charle-z:fix/ssestream-decoder-parameter-case
Open

fix(ssestream): preserve decoder parameter value case#852
charle-z wants to merge 18 commits into
openai:mainfrom
charle-z:fix/ssestream-decoder-parameter-case

Conversation

@charle-z

@charle-z charle-z commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix parameter-specific stream decoder registration so MIME parameter values that are case-sensitive are not lowercased when the decoder key is stored.

This is a follow-up to #790. That PR intentionally changed response lookup to lowercase only the media-type prefix while preserving the parameter tail, but RegisterDecoder still lowercases the entire registration string. The two sides are therefore asymmetric for registrations containing case-sensitive parameter values.

Reproduction

Registering:

application/x-test; profile="https://example.com/V1"

currently stores the decoder under:

application/x-test; profile="https://example.com/v1"

while response lookup preserves V1. As a result, the intended .../V1 representation misses the registered decoder, while the distinct .../v1 representation can select it instead.

Fix

Use one decoder-key normalization path for registration and exact lookup. The normalizer follows MIME's default rule that parameter values are case-sensitive unless that media type and parameter define otherwise:

  • lowercase the MIME type/subtype and parameter names;
  • preserve ordinary parameter values byte-for-byte by default, including case-sensitive profile values;
  • normalize globally case-insensitive charset values;
  • normalize contextual case-insensitive values for message/external-body, text/plain, text/csv, multipart/related, multipart/signed (protocol and micalg), multipart/encrypted, and multipart/report;
  • derive the logical RFC 2231 parameter name before applying value semantics;
  • parse RFC 2231 charset/language metadata only for an unsuffixed encoded value or continuation section zero;
  • normalize encoded case-insensitive values while preserving payload case for case-sensitive values and later continuation segments;
  • normalize accepted quoted extended values through the same path as unquoted values;
  • split parameters only at semicolons outside quoted strings.

The bare-media fallback still uses mime.ParseMediaType as before, so unsupported extended parameters cannot silently collapse into the bare decoder key.

Generation ownership

packages/ssestream/ssestream.go is generated-owned scaffolding, but this public repository does not contain the Castiron template or a per-file generator input that an external contributor can update. CONTRIBUTING.md explicitly states that manual SDK modifications persist between generations.

The merged predecessor #790 received the same Castiron-ownership review. Its maintainer documented the established persistent runtime-patch path for this file, resolved that review, and the final head received human approval. This follow-up intentionally uses that same repository path without altering .castiron.stats.yml or other generation metadata. Propagating the behavior across generated SDKs requires an internal Castiron change by maintainers and is separate from preserving correct routing in openai-go.

Regression coverage

Coverage includes:

  1. case-sensitive profile=.../V1 versus .../v1 routing;
  2. case-insensitive parameter names and charset values;
  3. message/external-body access-type, permission, and mode;
  4. text/plain format and delsp, with contextual negative controls;
  5. RFC 2231 logical names and encoded/unencoded continuations;
  6. quoted extended values;
  7. later encoded continuation segments whose apostrophes are payload rather than metadata;
  8. multipart/related type, multipart/signed protocol and micalg, multipart/encrypted protocol, multipart/report report-type, and text/csv header;
  9. quoted ordinary parameter values containing semicolons and literal *= text;
  10. percent-encoding equivalence without collapsing case-sensitive payload bytes;
  11. negative controls that preserve contextual parameter values outside their defining media types.

The existing #790 regression cases remain in place.

Validation

Current head: e8b7a35379956aa60dae137bceacaccfb9f63feb.

  • changed files are limited to packages/ssestream/ssestream.go and packages/ssestream/content_type_case_test.go;
  • local toolchain: Go 1.26.6;
  • go test ./packages/ssestream: pass;
  • go test -race ./packages/ssestream: pass;
  • go vet ./packages/ssestream: pass;
  • go fmt ./packages/ssestream: clean;
  • git diff --check: pass;
  • fork CI lint: pass;
  • fork CI Go 1.25.x root/examples/external-consumer matrix: pass;
  • exact-head security review: no findings.

Hosted Go 1.26 job blocker

The hosted Go 1.26 job has failed in three separate attempts before executing any root, examples, external-consumer, or changed-package test. Every attempt stops in the unrelated Verify mock-server installation integrity step with:

scripts/steady/.versions/.../bin/steady: Text file busy

The following test steps are then skipped. The feature diff does not touch scripts/test-mock, scripts/steady, workflows, or dependency metadata, and the changed package passes locally under Go 1.26.6. This red check is therefore recorded as a repeated hosted-runner/mock-installation blocker rather than a product-test failure.

@charle-z
charle-z marked this pull request as ready for review August 23, 2026 00:48
@charle-z
charle-z requested a review from a team as a code owner August 23, 2026 00:48

Copy link
Copy Markdown
Contributor Author

@codex review

Copy link
Copy Markdown
Contributor Author

Additional focused validation after opening the PR: I copied the exact key-normalization helpers from this head into an isolated stdlib-only Go module, ran gofmt -d (empty) and go test -v. A 9-case adversarial matrix passed for media-type case, parameter-name case, profile value case separation, charset value equivalence, mixed profile+charset, extended charset/language/percent-hex equivalence, extended unescaped-value case separation, quoted semicolons/embedded *=, and escaped quotes before a semicolon. This is helper-level executable evidence only; it is not a substitute for the repository's Go 1.25+ package/CI tests, which remain gated by external-contributor workflow approval.

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: 593ecdc12c

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 593ecdc12c

ℹ️ 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".

Comment thread packages/ssestream/ssestream.go Outdated
Comment thread packages/ssestream/ssestream.go Outdated

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: 82aeabfca7

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 82aeabfca7

ℹ️ 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".

Comment thread packages/ssestream/ssestream.go Outdated
Comment thread packages/ssestream/ssestream.go Outdated

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: dcb689026e

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dcb689026e

ℹ️ 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".

Comment thread packages/ssestream/ssestream.go Outdated
Comment thread packages/ssestream/ssestream.go
@charle-z

Copy link
Copy Markdown
Contributor Author

@codex review

Current head: 136594ca3989e6e7fa73dfe065c93283727c342a.

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: 136594ca39

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 136594ca39

ℹ️ 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".

Comment thread packages/ssestream/ssestream.go
Comment thread packages/ssestream/ssestream.go

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: 4cbccd1a71

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4cbccd1a71

ℹ️ 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".

Comment thread packages/ssestream/ssestream.go

Copy link
Copy Markdown
Contributor Author

Addressed the latest P2 in d57e93c9289af6210aea10b3a1888718ccbca09c: decoder keys now fold multipart/report; report-type and text/csv; header, with contextual negative controls preserving value case outside those media types. Added registration-to-response regressions for both. go test ./packages/ssestream, go vet ./packages/ssestream, formatting, and git diff --check pass; the repository-wide test command was killed by the bounded local runner rather than reporting a test failure.

Copy link
Copy Markdown
Contributor Author

@codex review

Current head: d57e93c9289af6210aea10b3a1888718ccbca09c.

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: d57e93c928

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d57e93c928

ℹ️ 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".

Comment thread packages/ssestream/ssestream.go
Comment thread packages/ssestream/ssestream.go

Copy link
Copy Markdown
Contributor Author

@codex review

Current head: e8b7a35379956aa60dae137bceacaccfb9f63feb.

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: e8b7a35379

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 12, 2026

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 Completed 2026-09-13T01:21:17.452609Z 08f6e92 New commits
🔒 Security Review Completed 2026-09-13T01:22:32.203043Z 08f6e92 New commits
ℹ️ 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 chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8cfe9c5488

ℹ️ 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".

Comment thread packages/ssestream/ssestream.go Outdated
Comment on lines +77 to +78
if _, parsedParams, err := mime.ParseMediaType(contentType); err == nil {
externalBodyAccessType = strings.ToLower(parsedParams["access-type"])

@chatgpt-codex-connector chatgpt-codex-connector Bot Sep 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Derive external-body access types without charset restrictions

When access-type uses a valid RFC 2231 charset unsupported by Go's mime.ParseMediaType, such as access-type*=ISO-8859-1''FTP, the parser omits the decoded parameter and leaves externalBodyAccessType empty. A registration ending in mode=IMAGE therefore no longer matches an equivalent lowercase response ending in mode=image, even though FTP's mode value is case-insensitive; lookup instead falls back to the bare or default decoder. Derive the logical access type without relying on mime.ParseMediaType's US-ASCII/UTF-8-only extended-value decoder.

AGENTS.md reference: AGENTS.md:L71-L73

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 940739a852

ℹ️ 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".

Comment thread packages/ssestream/ssestream.go Outdated
if err != nil {
return ""
}
if accessType := standardExternalBodyAccessType(parsedParams["access-type"]); accessType != "" {

@chatgpt-codex-connector chatgpt-codex-connector Bot Sep 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject partially decoded access types before folding mode

When an encoded continuation has a malformed section zero but a later section equals a standard access type—for example, access-type*0*=UTF-8''%ZZ; access-type*1*=FTP—Go's mime.ParseMediaType discards the failed first segment but returns FTP from the second, so this branch classifies the malformed value as FTP. The normalizer then folds mode=IMAGE and mode=image, allowing a malformed response to select or overwrite the wrong parameter-specific decoder even though extension/undetermined access types intentionally keep mode case-sensitive. Validate that every continuation segment decoded successfully before accepting the assembled access type, and cover malformed section-zero input.

AGENTS.md reference: AGENTS.md:L35-L40

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 71e5e79f8d

ℹ️ 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".

Comment thread packages/ssestream/ssestream.go Outdated
Comment on lines +165 to +169
if hasMetadata {
if firstQuote := strings.IndexByte(core, '\''); firstQuote >= 0 {
secondQuote := strings.IndexByte(core[firstQuote+1:], '\'')
if secondQuote < 0 {
return false

@chatgpt-codex-connector chatgpt-codex-connector Bot Sep 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject extended values without a charset prefix

Fresh evidence after the earlier malformed-continuation fix is that hasMetadata only validates the prefix when an apostrophe happens to exist, so access-type*0*=BROKEN; access-type*1*=FTP is accepted. Go's MIME parser then discards the undecodable section zero, assembles FTP from section one, and this code folds mode=IMAGE with mode=image, allowing malformed registrations to collide or select the parameter-specific decoder. Require section zero and unsuffixed encoded values to contain a nonempty charset'language' prefix before using their assembled access type.

AGENTS.md reference: AGENTS.md:L35-L40

Useful? React with 👍 / 👎.

Comment on lines +379 to +380
switch strings.TrimSpace(mediaType) {
case "message/external-body":

@chatgpt-codex-connector chatgpt-codex-connector Bot Sep 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Fold S/MIME smime-type values

For application/pkcs7-mime, the standardized smime-type alternatives such as signed-data and enveloped-data are case-insensitive, but this table omits them. A decoder registered as application/pkcs7-mime; smime-type=SIGNED-DATA previously matched a lowercase response because registration folded the entire key; it now retains the uppercase value and falls through to the bare or default decoder. Add media-type-specific normalization for smime-type so equivalent S/MIME responses preserve decoder routing.

AGENTS.md reference: AGENTS.md:L71-L73

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 187200c061

ℹ️ 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".

Comment thread packages/ssestream/ssestream.go Outdated
Comment on lines +166 to +173
firstQuote := strings.IndexByte(core, '\'')
if firstQuote <= 0 {
return false
}
secondQuote := strings.IndexByte(core[firstQuote+1:], '\'')
if secondQuote < 0 {
return false
}

@chatgpt-codex-connector chatgpt-codex-connector Bot Sep 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject malformed extended charsets before substitution

Fresh evidence beyond the existing empty/missing-prefix cases is that a quoted value such as access-type*="BAD CHAR''FTP" passes this validation because only the apostrophe positions are checked. replaceExtendedParameterCharset then erases the malformed charset, mime.ParseMediaType yields FTP, and mode=IMAGE is folded with mode=image, allowing malformed input to select or overwrite a parameter-specific decoder instead of preserving case-sensitive routing. Validate the charset metadata syntax before substituting it.

AGENTS.md reference: AGENTS.md:L37-L40

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a4b362333a

ℹ️ 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".

Comment thread packages/ssestream/ssestream.go Outdated
Comment on lines +294 to +295
rewritten.WriteString("US-ASCII")
rewritten.WriteString(core[firstQuote:])

@chatgpt-codex-connector chatgpt-codex-connector Bot Sep 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Decode the declared charset before classifying access types

Fresh evidence beyond the earlier ISO-8859-1 fix is a valid non-ASCII-compatible charset such as access-type*=UTF-16BE''%00F%00T%00P: replacing its label with US-ASCII while retaining the encoded bytes makes mime.ParseMediaType produce a NUL-interleaved value rather than FTP. standardExternalBodyAccessType therefore rejects it, so a registration with mode=IMAGE no longer matches an equivalent response with mode=image, although the previous registration path folded both keys. Decode or transcode the declared charset before classifying the access type instead of merely substituting its label.

AGENTS.md reference: AGENTS.md:L71-L73

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dd8129cd5c

ℹ️ 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".

Comment thread packages/ssestream/ssestream.go Outdated
case isExternalBodyAccessType && hasExternalBodyAccessType:
valueStart, valueEnd := trimOWSBounds(value)
normalized.WriteString(value[:valueStart])
normalized.WriteString(externalBodyAccessType)

@chatgpt-codex-connector chatgpt-codex-connector Bot Sep 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Escape decoded access types before composing keys

When an external-body response contains a successfully decoded access-type with delimiters, this writes those delimiters directly into the flat key. For example, access-type*=UTF-8''FTP%3Bmode%3DIMAGE and the distinct access-type*=UTF-8''FTP;mode=image both normalize to access-type*=ftp;mode=image, so attacker-controlled metadata can select or overwrite the wrong parameter-specific decoder. Preserve an escaped, unambiguous representation or substitute only validated standard access-type tokens, and add a public-entrypoint collision regression.

AGENTS.md reference: AGENTS.md:L35-L40

Useful? React with 👍 / 👎.

Comment thread packages/ssestream/ssestream.go Outdated
Comment on lines +301 to +305
switch c {
case '!', '#', '$', '%', '&', '+', '-', '^', '_', '`', '~':
continue
default:
return false

@chatgpt-codex-connector chatgpt-codex-connector Bot Sep 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Accept registered charset aliases containing periods

A valid RFC 2231 value using the registered US-ASCII alias ANSI_X3.4-1968 is rejected here solely because its charset name contains a period, before ianaindex can resolve it. Consequently, a registration such as message/external-body; access-type*=ANSI_X3.4-1968''FTP; mode=IMAGE no longer matches the equivalent lowercase response, whereas the parent implementation folded both keys. Accept valid registered aliases—or delegate validation to the charset lookup—so the decoded standard access type can still control mode normalization.

AGENTS.md reference: AGENTS.md:L71-L73

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 08f6e9203a

ℹ️ 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".

case "multipart/encrypted":
return strings.EqualFold(name, "protocol")
case "multipart/signed":
return strings.EqualFold(name, "protocol")

@chatgpt-codex-connector chatgpt-codex-connector Bot Sep 13, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restore case folding for multipart/signed micalg

Fresh evidence after the earlier fix is that the final reviewed blob again returns true only for protocol, so the reported micalg correction is absent. RFC 1847 defines micalg values as case-insensitive; consequently, registering multipart/signed; micalg=PGP-SHA256 no longer matches a response containing micalg=pgp-sha256, although the parent implementation lowercased both keys, and routing falls back to the bare/default decoder. Include micalg in this branch and retain a registration-to-lookup regression test.

AGENTS.md reference: AGENTS.md:L71-L73

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant