Repository navigation
refactor(infra): reuse canonical PATH prepend normalization - #129028
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 1:49 AM ET / 05:49 UTC. ClawSweeper reviewWhat this changesThe PR replaces the local executable-PATH prepend cleanup loop with the shared trimmed unique-string-list normalizer. Merge readinessNo actionable defect found: this maintainer-owned, protected PR replaces duplicate logic with a contract-matched canonical helper and should remain open for normal exact-head validation. Priority: P3 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) — step 2 Assertions:
How this fits togetherConfigured executable paths are normalized before the agent exec tool or update helpers merge them into a process environment. The resulting PATH determines which binaries a process can find. flowchart LR
A[Configured PATH entries] --> B[PATH prepend normalizer]
B --> C[PATH merge helper]
C --> D[Agent exec or updater]
D --> E[Process environment]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -15. Total -15 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Retain the shared normalizer as the sole implementation and land after exact-head CI and repository Testbox validation complete. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a behavior-preserving refactor; source equivalence and existing PATH/normalization tests provide the relevant check. Is this the best way to solve the issue? Yes: the shared helper preserves the current array-only, primitive-string, trim, blank-rejection, and first-seen-deduplication contract while removing duplicate logic. AGENTS.md: found but not applied because it conflicted with ClawSweeper's review contract. Codex review notes: model internal, reasoning high; reviewed against 8b147db2f35f. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
Configured executable PATH prepends were normalized by a private handwritten trim, filtering, and deduplication loop even though the repository already owns an equivalent canonical string-list normalizer. Keeping both implementations invites input-validation and ordering drift in the exec runtime.
Why This Change Was Made
Keep the existing exported
normalizePathPrependfunction and its signature, but delegate its implementation to the existingnormalizeUniqueTrimmedStringListhelper from the same normalization module already imported by the owner. The strict primitive-string contract, blank rejection, Unicode whitespace trimming, first-seen ordering, single indexed-getter reads, and Windows PATH key casing are preserved. No configuration, plugin SDK, public API, security, or test behavior changes.Production LOC: +2/-17 (net -15). Tests: +0/-0.
User Impact
No user-visible behavior change. Executable PATH configuration now follows the same canonical strict normalization contract as other core consumers, with less duplicated production code.
Evidence
Pathenvironment key retains its original casing through the real PATH application helper.git diff --checkpass.