Skip to content

test(responses): mint the surviving blob as a valid Fernet token - #5246

Merged
lidge-jun merged 1 commit into
devfrom
codex/fix-fernet-fixture-multi-agent-compat
Sep 20, 2026
Merged

lidge-jun merged 1 commit into
devfrom
codex/fix-fernet-fixture-multi-agent-compat

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Sep 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • dev is red at 12cb129d42: sanitizeEncryptedContentInPlace > plaintext parked in encrypted slots becomes input_text; real blobs survive fails on Linux shard 2/4 and macOS shard 2/2 with Expected: 2, Received: 3.
  • fix(responses): reject Fernet-shaped agent plaintext #5239 replaced looksLikeBackendCiphertext with isStructurallyValidFernetToken, which requires canonical base64url, length >= 100, a 0x80 version byte and a 16-byte-aligned ciphertext. The case's stand-in blob "gAAAAAB".padEnd(120, "Qw1_-=") embeds = mid-token, so it is no longer a valid token and is now lowered to input_text as a third rewrite.
  • The case asserts that real backend blobs survive untouched. This restores that meaning by minting the blob with the fernetFixture() helper already defined in the same describe, which is the shape the sibling cases added by fix(responses): reject Fernet-shaped agent plaintext #5239 use. The rewrite count returns to 2 and outParts[0] stays byte-identical.
  • No production behavior changes; the stricter classifier from fix(responses): reject Fernet-shaped agent plaintext #5239 is kept exactly as merged.

Verification

  • Static source analysis against src/server/responses/encrypted-payload.ts: fernetFixture() produces a 73-byte payload with raw[0] = 0x80, encoding to a 100-character canonical base64url token, so isStructurallyValidFernetToken accepts it (decoded.length - 57 === 16).
  • Local suites, typecheck and builds were not run in this lane; exact-head hosted CI on this pull request is the execution evidence.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Summary by CodeRabbit

  • Tests
    • Updated encrypted-content sanitization testing to use a valid generated encryption fixture, improving test reliability.

Co-authored-by: ingwannu <ingwannu@teamwicked.me>
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 20, 2026 03:29
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 20, 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-20T03:30:52.561746Z 3f051a7 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.

@github-actions

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Sep 20, 2026
@coderabbitai

coderabbitai Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 4e850551-03df-4834-94e0-42d108eef3f1

📥 Commits

Reviewing files that changed from the base of the PR and between 12cb129 and 3f051a7.

📒 Files selected for processing (1)
  • tests/codex-integration/multi-agent-compat.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The encrypted-content sanitization test now uses a valid encrypted blob from fernetFixture() instead of a hardcoded padded string.

Changes

Encrypted fixture validation

Layer / File(s) Summary
Use generated Fernet fixture
tests/codex-integration/multi-agent-compat.test.ts:1380
The test replaces the hardcoded encrypted blob with the Fernet value returned by fernetFixture(). This keeps the test input tied to the fixture generator.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: replacing the invalid surviving encrypted blob with a valid Fernet token in the response test fixture.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Labels

chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant