Uh oh!
There was an error while loading. Please reload this page.
feat(perps): add headless recipe v1 controller example - #8955
Conversation
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 99f5db1. Configure here.
| return value; | ||
| } | ||
| return `${value.slice(0, MAX_OUTPUT_BYTES)}\n…[truncated]`; | ||
| } |
There was a problem hiding this comment.
Truncate checks bytes but slices by characters
Low Severity
The truncate function gates on Buffer.byteLength (a byte-based measure) but then truncates using String.prototype.slice (a character-based operation). For multi-byte UTF-8 strings, a string can have fewer characters than MAX_OUTPUT_BYTES yet more bytes — in that case slice(0, MAX_OUTPUT_BYTES) returns the entire original string unchanged, and the \n…[truncated] suffix is appended, making the output longer than the input while still exceeding the byte budget.
Reviewed by Cursor Bugbot for commit 99f5db1. Configure here.


Closing this draft because the shape is too intrusive for
core.The correct direction is to keep MetaMask core as a minimal consumer of a reusable Farmslot headless recipe harness instead of embedding a full runner under
packages/perps-controller/recipe-v1.Target replacement shape:
@farmslot/protocol+@farmslot/recipe-harnessas dev dependencies;farmslot-recipeCLI for generic headless command/assert/artifact handling;This draft is preserved only as a reference for what not to ship.