Skip to content

fix(plugins): keep the plugin consent fingerprint Hermes-compatible so main's Mobile checks pass - #37370

Merged
nwparker merged 3 commits into
mainfrom
brennanb2025/main-fix-hermes-consent-sort
Nov 2, 2026
Merged

nwparker merged 3 commits into
mainfrom
brennanb2025/main-fix-hermes-consent-sort

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1

Main's Mobile Checks have failed since #37316 (999160b). The phone app bundles src/shared, and the new plugin consent fingerprint sorted its "replaces" list with Array.prototype.toSorted, which the phone's Hermes engine doesn't support. The Hermes compatibility test (mobile/src/hermes-array-sorting-compat.test.ts) catches exactly this and fails on main, which also blocks every open PR's Mobile verify job.

What changes: the list is sorted in place instead. flatMap already returns a new array, so the fingerprint is byte-for-byte the same and nothing a user sees changes; the phone bundle no longer contains the unsupported call. A test now also checks that the order a plugin lists its replacing commands in doesn't change the fingerprint, which is what the sort is for.

Light path classification:

  • Small: 1 production line changed (plus a one-line comment) in 1 file.
  • Outside the risky areas: a pure function's sort call; no saved data, wire format, lifecycle, process or auth change (the fingerprint value is identical).
  • Not a repeat: the only recent change to this file is feat(plugins): commands[].replaces lets a mod take over a built-in action #37316, which introduced the call; no revert or incident.
  • Local effect: one pure function.

Plan: replace .toSorted() with .sort() on the array flatMap just created; CI's Mobile verify (Hermes compatibility test) is the check.

…hone bundle passes Hermes checks

Main's Mobile verify has failed since #37316 because the plugin consent fingerprint (bundled into the phone app via src/shared) used Array.prototype.toSorted, which Hermes lacks. flatMap already returns a fresh array, so sorting it in place keeps the same result.
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 11f578bb-60f4-4851-9230-a93b34497735
Commits

Reviewing files that changed from the base of the PR and between 32b4a13 and 16e5a6f.

Files selected for processing: 1
  • src/shared/plugins/contributions/plugin-command-replaces.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Walkthrough

replacementIdentity now uses .sort() instead of .toSorted() to order replacement action names. A test verifies that reversing the order of replacement commands does not change the consent fingerprint.

Merge Risk: Minimal · up to 16e5a

The Hermes compatibility fix preserves consent fingerprints and introduces no merge-blocking risk.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description clearly explains the incompatibility, code change, expected behavior, risk, and reported validation. However, it does not use the required template sections and omits or does not compl… Rewrite the description using the repository template. Add all required headings and complete each applicable section. Provide an actual linked issue using Fixes #<number>, state N/A with a reason for Visual Proof because there is no UI…
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: replacing an incompatible implementation to keep the plugin consent fingerprint compatible with Hermes and restore Mobile checks.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files.

Full details: Description check

Explanation

The description clearly explains the incompatibility, code change, expected behavior, risk, and reported validation. However, it does not use the required template sections and omits or does not complete several required items, including an explicit ELI5, Linked Issue with Fixes #, Visual Proof or N/A, Testing checklist, Risk level, AI Disclosure, Review, Notes, and Checklist.

Resolution

Rewrite the description using the repository template. Add all required headings and complete each applicable section. Provide an actual linked issue using Fixes #&lt;number&gt;, state N/A with a reason for Visual Proof because there is no UI change, document testing and platforms, set the Risk level, complete applicable checkboxes, and address AI Disclosure according to contributor status.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@brennanb2025

brennanb2025 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Review loop status: done (light path)

Problem: since #37316, main's Mobile verify has failed. The phone app bundles src/shared, and the new plugin consent fingerprint sorted its "replaces" list with Array.prototype.toSorted, which the phone's Hermes engine doesn't have. The Hermes compatibility test caught it, and the failure blocked Mobile verify on every open PR.

User-facing change: none. The list is now sorted in place; flatMap already returns a fresh array, so the fingerprint is byte-for-byte the same and saved plugin approvals keep their meaning. The phone bundle no longer contains the unsupported call.

Review: one fresh adversarial reviewer confirmed each light-path criterion against the code and found nothing to fix. It ran the mobile Hermes compatibility tests (2 passed) and the consent and replacement tests (21 passed), checked seven equivalence cases between the old and new sort, and reproduced the failure on an engine without toSorted. No other production toSorted, toSpliced or .with() calls remain in the code the test scans.

Fixed in review: no test checked why the list is sorted at all: a plugin whose commands replace two built-in actions must get the same fingerprint whatever order the commands are listed in, or reordering its manifest would ask the user to approve it again. One check added to the existing replacement-consent test (16e5a6f); it fails without the sort and passes with it, and the reviewer agreed.

Verified: CI green on 16e5a6f, including Mobile verify. QA: tests (a pure function; CI's Hermes check and the consent tests are the proof, no app run needed). No native chat or agent code changed.

Main sync: one merge of main (32b4a13), picking up #37345, which fixed the unrelated unit-test failures main had (plugin E2E routing and prompt-receipt timing) that had also failed this PR's first CI run.

For Brennan's review:

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@nwparker
nwparker merged commit f5a3655 into main Nov 2, 2026
57 checks passed
brennanb2025 added a commit that referenced this pull request Nov 2, 2026
Picks up main's fix for its own Mobile verify failure (#37370).
brennanb2025 added a commit that referenced this pull request Nov 2, 2026
Brings main's Hermes-compatible plugin fingerprint (#37370) so the stacked PR's mobile check can pass.
brennanb2025 added a commit that referenced this pull request Nov 2, 2026
Brings main's Hermes-compatible plugin fingerprint (#37370).
@brennanb2025
brennanb2025 deleted the brennanb2025/main-fix-hermes-consent-sort branch November 2, 2026 08:39
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.

2 participants