fix(worker): prevent long repository inputs from stalling requests - #120
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs changes before merge. Reviewed August 29, 2026, 2:02 AM ET / 06:02 UTC. ClawSweeper reviewWhat this changesThe PR replaces regex-based trailing-slash removal in Worker repository normalization with a linear reverse scan and adds regression coverage for very long internal slash runs. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessThis PR remains necessary because current main still uses the pathological trailing-slash regex. The linear replacement is sound, but the required Unreleased changelog entry remains absent. Priority: P2 Review scores
Verification
How this fits togetherRepository input is normalized in the Worker before it is parsed into GitHub owner and repository parts for downstream API requests. This change makes that input-cleanup step responsive under adversarial slash runs. flowchart LR
A[Repository input] --> B[Worker normalization]
B --> C[Trailing slash handling]
C --> D[Owner and repository parser]
D --> E[GitHub request handling]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the linear normalization repair and its focused regression test, then add one dense Unreleased entry describing the bounded repository-input handling. Do we have a high-confidence way to reproduce the issue? Yes, with high confidence from the current-main anchored slash regex and the supplied 32,768-slash pre-fix timing scenario; this review did not execute target code in the read-only checkout. Is this the best way to solve the issue? Yes, the reverse scan removes the pathological backtracking opportunity while preserving the existing trim, case-folding, GitHub-prefix, trailing-slash, and .git normalization order. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ec33952bac50. LabelsLabel justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
ClawSweeper disposition for exact head
No rank-up move is being passed silently. |
Related: https://github.com/openclaw/crabfleet/security/code-scanning/3
What Problem This Solves
Fixes an issue where repository inputs containing long internal slash runs could stall Worker requests during normalization.
Why This Change Was Made
Trailing slash removal now uses one reverse index scan and one final slice instead of a backtracking regular expression. Existing trimming, case normalization, GitHub URL removal,
.githandling, and valid outputs are unchanged.User Impact
Repository normalization remains responsive for adversarial input without changing accepted repository values.
Evidence
pnpm checkpnpm test(1,003 tests)pnpm buildDEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer pnpm macos:testrun_7584c26fa9cb: clean no-hydration checkout at the exact head; Docker-backed Wrangler dry-run, focused test, check, full test, and build passed; owned lease released.