Repository navigation
Conversation
|
Source review found incomplete payload-size protection and an incorrect pathname expectation in the added test. The 500-file cap is not a byte limitIn Source-derived example with synthetic path lengths, not a runtime reproduction: Impact: On Linux systems with that argument limit, a collection of sufficiently long paths can still fail with an argument-too-long error instead of opening the picker. The cap helps ordinary-length collections but does not guarantee the protection stated in the comment. Suggested change: Bound the encoded payload size with room for metadata, or use a transport that avoids a single oversized argument at both the Perl and shell/IPC boundaries. Test-only correction: By source inspection, this assertion rejects the intended output and makes the new test fail. Compare with Verified by source inspection: Review informationTest scope: Source review at Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review. Automated AI review: Astra Medium initial inspection, independent Opus 5.5 High and GPT 6 Sol Xhigh technical assessments, followed by Astra Medium adjudication against pinned source and a separate editorial check. |
|
Thanks for the review — both points were solid. Pushed
Happy to tighten the byte budget further if maintainers want a different headroom. |
Automated AI review
Follow-up to the earlier review and author reply, checked at
Verified: The test now expects The budget counts characters, not bytes, in a UTF-8 localeIn Isolated run with the real The same fixture under The byte budget can also be exceeded after awk by two less common kinds of name:
Both failed the same way in isolated runs with crafted names, including under Impact: For collections with long non-ASCII file names, Suggested change: Enforce the limit on the encoded size inside Wording note: Only the newest 500 or fewer files are now eligible. For example, 280-byte paths list the newest 355. Review informationTest scope: Follow-up at AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments with targeted cross-checks, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
|
Thanks for the follow-up — good catch on Pushed another commit:
A full encoded-size check inside |
Automated AI review
Follow-up to the earlier reviews (first, second) and the author reply, checked at
Verified: Escaped and invalid UTF-8 bytes still grow past the limitThe awk budget counts raw path bytes, but With a full budget, the payload passes 131,071 bytes when roughly more than 31% of listed path bytes are invalid UTF-8, more than 12.5% are control bytes, or more than 62% are quotes or backslashes. Isolated runs at Impact: Collections with long legacy-encoded names (for example folders copied from older CP1251 or Latin-1 systems), or with unusual characters, still make Suggested change: The encoded-size check inside Review informationTest scope: Follow-up at AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
|
Thanks for the follow-up — agreed the remaining edge is encoded expansion (escapes / invalid UTF-8), not the C-locale path budget. Pushed
Ordinary UTF-8 libraries stay covered by the lister; legacy/control-heavy names fail closed with a clear select error instead of |
Automated AI review
Follow-up to the previous review and the author reply, checked at
Verified: The new check in The new size check counts characters, not bytes, in a UTF-8 locale
Isolated runs at The oversized JSON passes the check and fails at the second Perl call (lines 86 to 97), the same result as at Impact: In a UTF-8 locale, listings from Suggested change: Count bytes, for example Optional test improvement: The PR's only test replaces Note on the new error: The message goes to stderr only. Note on the 120,000 limit: Lists whose encoded JSON is between 120,001 and about 130,900 bytes used to open and are now rejected. For example, 500 direct ASCII options with a 125,164-byte payload opened at Review informationTest scope: Follow-up at AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
|
Thanks — same char-vs-byte issue one layer later. Pushed a fix:
Ordinary UTF-8 libraries were already fine via the lister; legacy-encoded / invalid-UTF-8 heavy lists should now fail closed before Perl hits |
Automated AI review
Follow-up to the previous review and the author reply, checked at Verified: the size check in The new test does not detect a return to character counting. A separate question about
Verified: Payloads for ordinary menus (plain lists, stdin input with width and height, icon rows with tabs and CJK text, quotes and backslashes) are identical to Optional test improvement:
|
|
Thanks — agreed Pushed
On related open PRs (#13197 / #13018 / #7320): happy to close or rebase once maintainers pick a line — this branch is the fuller payload-budget + |
Automated AI review
Follow-up to the previous review and the author reply, checked at Verified:
Verified: isolated runs with synthetic folders, comparing this head with Relative, chained and trailing-slash starting points are listed at this head. Broken starting-point links are still rejected with The tightened Optional test improvement: Review informationTest scope: Follow-up at AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
|
Thanks — optional test note applied. Pushed
Residual notes left as-is for now:
No further code changes planned unless a maintainer wants one of those scoped here. |
|
Same symlink starting-point bug as #12665. Live Open fixes:
This #12669 also adds an awk entry/byte budget + menu-select changes. Prefer consolidating into #13018/#15140 and closing the extras once one merges. |
|
Reviewed at Four open pull requests fix #12665 with
#13018 has the same 500-file cut. #13197 is the oldest fix without one, so it is the one brought forward. It also removes duplicate rows when roots overlap. The large-library failure the issue also reports ( Waiting on the maintainer to choose among the fixes for #12665. |
|
Understood — #12669 is not the one to take forward for #12665. The 500-entry / 80KB caps and the 120KB encoded-options check change behavior that works on I will not push more listing-cap changes here. The encoded-size check can be reused later if a maintainer wants the separate large-library ( |
Expect find -L %p under the symlink start path, and cap listing by entry count plus total path bytes so select stays under MAX_ARG_STRLEN.
Use LC_ALL=C awk so length() is bytes under UTF-8 LANG, and lower the path budget to leave headroom for JSON escapes before menu-select.
Enforce an exact options-JSON byte cap in omarchy-menu-select so escape and invalid-UTF-8 expansion cannot still trip MAX_ARG_STRLEN after the lister budget. Soften omarchy-menu-file comments to match the valid-UTF-8 first cut.
${#options_json} is characters under UTF-8 LC_CTYPE, so invalid UTF-8
expanded to U+FFFD could still pass the cap and hit MAX_ARG_STRLEN.
Measure with LC_ALL=C and add a shell test for the oversized path.
-H follows symlink starting points (omacom#12665) without walking nested symlinks found inside media roots. Tighten menu-select byte-budget test so character-length counting would fail under UTF-8.
Assert a nested symlink inside the linked root is not listed, and fix the stub comment that still mentioned find -L.
f5e9355 to
ce32b4e
Compare
[Medium impact] The change affects file browsing and the shared option picker. The code changes appear sound, but the new test must follow the repository's numeric-comparison rule before merging. Findings
SummaryFixes
Reviews (1) · Last reviewed commit: "Tighten menu-file symlink test for find ..." · Reviewed by Greptile |
| # ~337k bytes — fails under a character-length cap, passes with byte counting. | ||
| opts=() | ||
| i=1 | ||
| while [[ $i -le 80 ]]; do |
There was a problem hiding this comment.
Numeric checks break repository style
The new loop uses [[ $i -le 80 ]], and both exit-code checks use [[ $rc -eq 1 ]]. The repository requires (( )) for numeric comparisons. Use while (( i <= 80 )); do and (( rc == 1 )) for those checks. This requirement must be satisfied before merging.
File Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Looked again at The two models disagree on what this is, so the What the earlier review found still holds, because the code it was about hasn't changed. #13197 fixes #12665 with |
Summary
omarchy-menu-fileranfindwithout following symlink starting points, so paths like~/Videos/~/Pictureson extra disks produced zero files. Transcode never opened the picker becauseomarchy-menu-selectgot empty stdin.Uses
find -Hso only command-line starting points are followed (not nested symlinks inside the tree).Also bounds listing / menu payload so a huge library cannot blow
MAX_ARG_STRLEN:LC_ALL=C awk(byte length under UTF-8LANG, first cut for ordinary valid UTF-8 names), andomarchy-menu-selectrejects oversized encoded options JSON (MAX_MENU_OPTIONS_JSON_BYTES=120000, measured in C-locale bytes) before the Perl/shell IPC hop.Closes #12665.
Test plan
test/shell.d/menu-file-symlink-test.shstubsomarchy-menu-selectand asserts a symlink starting point still yields$link/...paths (find%p).test/shell.d/menu-select-options-byte-budget-test.shchecks oversized invalid-UTF-8 options fail closed underC.UTF-8withoptions payload too large../test/shellfor those files (no GitHub Actions on this repo).Did not ping maintainers.