Repository navigation
fix(plugins): invalid feature ids leave directories and block retries - #193100
Conversation
|
🦞👀 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 changesValidate feature plugin IDs before creating directories and display the existing validation error through the CLI error handler. Example: Run plugins init Invalid_ID --type feature --directory ./draft-plugin, then retry with valid-feature.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a current plugin-authoring bug with a focused change and no actionable findings. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe plugins init command resolves scaffold options and delegates feature generation to the feature writer, which validates the ID and writes project files. flowchart TD
A[Plugin author] --> B[plugins init]
B --> C[Resolve options and overwrite policy]
C --> D[Feature writer validates ID]
D --> E[Expected CLI error]
D --> F[Create directory and scaffold files]
Technical reviewBest possible solution: Keep validation in the feature writer, create its directory only after acceptance, and reuse the existing CLI error renderer. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the mkdir-before-validation failure, corroborated by the supplied built-CLI reproduction; no target code was executed during this review. Is this the best way to solve the issue? This is the smallest complete repair using existing owners: preserve the validator, move the feature mkdir behind it, and classify its existing error for normal CLI presentation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ae420c504045. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +4, Tests -2, Docs +2. Total +4 across 4 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes: No label 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 HistoryReviewed November 4, 2026, 9:21 PM ET / November 5, 2026, 02:21 UTC (Revision 3). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Built Linux CLI proof on the final headCandidate: Ran main once and candidate once through their built Controls on both refs:
Focused regression: on pinned main, the consolidated case fails specifically at The allocation file is removed. Test delta +18/-20 = -2: kept the invalid-ID/corrected-retry regression; moved the standalone append-entry example into its existing table and moved package-name/setupEntry preservation into the real build/install test. No assertion contract was dropped. Production +6/-2 = +4 (8 gross changed lines); docs +3/-1. Setup corrections disclosed: one proof invocation was queued before the baseline build completed and stopped at missing |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Landed in 7510612. Thanks @zhangguiping-xydt. plugins init no longer leaves a partial directory after a bad feature id. |
…openclaw#193100) fix(plugins): validate the feature id before plugins init creates files `openclaw plugins init` for a feature scaffold created directories before running the existing feature-ID check. A bad ID therefore left a partial `src` directory behind, hid the validation error, and blocked a corrected retry. The existing check now runs before the first directory is created, and its existing error is shown. Accepted feature, tool and provider scaffolds and the `--force` marker behavior are unchanged. Evidence: built Linux CLI. With a bad feature ID, main left `src` behind, hid the error and blocked the corrected retry. With this change nothing is created, the existing error is shown, and the corrected retry succeeds. An invalid `--force` keeps the marker bytes and entries, and accepted scaffold files are byte-identical across refs. Details: openclaw#193100 (comment). Thanks @zhangguiping-xydt. Co-authored-by: Ayaan Zaidi <[email protected]>
Raise the shared scalar by exactly 93 lines, from 6326473 to 6326566, under explicit maintainer approval for this baseline exception. Do not change tests, allocations, or checker policy. Main crossed the ceiling at #193101 (+83 against 32 available). Subsequent net debt: #193100 -2, #187104 +17 beyond its allocation, #128175 +25, #193123 -5, #188344 +8, and #193162 -1. The resulting inherited debt is exactly 93 lines; #192587 adds 73 lines with its own matching grant. At parent 2270152 the canonical LF scanner measured 6479093 test lines against ceiling 6479000. After correction the ceiling equals 6479093 with zero slack. Per-change allocations remain bounded by actual added lines.
Raise the shared scalar by exactly 93 lines, from 6326473 to 6326566, under explicit maintainer approval for this baseline exception. Do not change tests, allocations, or checker policy. Main crossed the ceiling at openclaw#193101 (+83 against 32 available). Subsequent net debt: openclaw#193100 -2, openclaw#187104 +17 beyond its allocation, openclaw#128175 +25, openclaw#193123 -5, openclaw#188344 +8, and openclaw#193162 -1. The resulting inherited debt is exactly 93 lines; openclaw#192587 adds 73 lines with its own matching grant. At parent 21ac250 the canonical LF scanner measured 6479093 test lines against ceiling 6479000. After correction the ceiling equals 6479093 with zero slack. Per-change allocations remain bounded by actual added lines.
What Problem This Solves
plugins init Invalid_ID --type featurecreates a partial target directory before rejecting the feature ID. Correcting the ID and retrying in that same directory then fails with “Refusing to overwrite existing path.” The initial rejection also hides the existing ID requirements behind a generic CLI error.User Impact
Rejected feature IDs leave the target untouched and display the existing validator error. Plugin authors can correct the ID and retry immediately. This also preserves existing entries and marker bytes when the invalid attempt uses
--force. Accepted tool, provider and feature scaffolds are unchanged.Why This Change Was Made
Keep the existing feature validator in the feature writer, and create its source directory only after validation succeeds. The command's earlier mkdir remains for tool/provider scaffolds only. Route the existing feature error through
throwExpectedCliError; no new validation rule, message, API or configuration.Original fix by @zhangguiping-xydt; original commit retained. Consolidated the regression and neighboring metadata coverage to net -2 test lines, with no allocation file. Necessary production growth is +4 lines (8 gross changed lines).
Evidence
Final-head built Linux CLI proof, main
658e3db2a464336f399704c201dda521ed4fac33versus candidate163e683b8610c90edeb6b2349bd782a997f06147, once each in isolated Node 24.22.1 Docker:srcafter the invalid ID and blocks the corrected retry. Candidate creates nothing, shows the existing ID requirements, and the corrected retry succeeds.--forceattempt leaves candidate directory entries and marker bytes unchanged.Merge Danger
Two-way door: a revert restores the earlier behavior; no migration or persisted contract changes. Blast radius is feature scaffold rejection and directory creation ordering. Valid scaffold contents, overwrite policy, tool/provider generation and credential handling are unchanged.