Repository navigation
fix(cli): accept renamed or symlinked executables - #1011
Conversation
PR SummaryMedium Risk Overview That contract is applied consistently in Reviewed by Cursor Bugbot for commit d372a82. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesTreat CLI inputs consistently as full argv so renamed and symlinked executables resolve commands correctly. Example: Run /tmp/peekaboo-before --version after copying the CLI binary.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a source-confirmed bug still present on main, and review found no actionable introduced defect; collaborator authorship also prevents automatic closure. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe CLI entry point passes process arguments to routing and result classification, which select a command before parsing, runtime construction, and execution. flowchart TD
A[Process arguments] --> B[CLI entry point]
B --> C[Result classification]
B --> D[Runtime router]
D --> E[Commander argument parser]
E --> F[Command executor]
C --> G[Result envelope]
F --> G
Technical reviewBest possible solution: Land the consistent full-argv repair once the existing checks finish successfully. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the failure: /tmp/peekaboo-before remains the first routing token despite being argv zero; no target code was executed during this read-only review. Is this the best way to solve the issue? Dropping argv zero at Peekaboo's full-argv boundary fixes the cause, preserves Commander's argument-tail contract, and removes the same assumption from classification and agent normalization. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 81bce4043f53. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 10, 2026, 12:42 AM ET / 04:42 UTC. |
Summary
A Peekaboo CLI binary invoked under any name that doesn't end in
peekaboorejected every command and treated its own path as the command:The same happened through a symlink such as
pb -> peekaboo, where argv[0] ispb. The entry point passesCommandLine.arguments(full argv), butCommanderRuntimeRouter.trimmedArgumentsdropped argv[0] only when it ended inpeekaboo. The same heuristic also appeared in the agent default-subcommand normalization and in result-envelope classification.The fix makes the contract explicit: these entry points take full argv and always drop exactly the first element. All three heuristics are removed, and agent normalization now operates on the trimmed tail. A caller audit found only two tail-only callers, both tests, and they now pass an executable name first. Commander and the daemon's own executable lookup are unchanged.
This PR also adds the changelog credits for #1006 and #1007, which landed without entries. Found while benchmarking #1005 with a renamed binary.
Tests
CommanderRuntimeArgvTests, plus expansions of the existing resolution and classification tests, cover absolute paths,pb,peekaboo-4.9,peekaboo-before, and thepeekabooand/usr/local/bin/peekabooforms. They also cover agent task normalization and result-envelope classification. Against the old code they fail with 141 assertion issues.swift testvia the workspace helper: 78 tests in 7 suites pass.pnpm run build:cli,pnpm run format, andpnpm run lintpass, with no diagnostics in touched files.node scripts/docs-lint.mjspasses.peekaboo-renamedbinary and a realpbsymlink both run--versionandsee --help(no capture or input).