Repository navigation
fix(cli): reject blank directory group IDs before setup - #143440
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. Reviewed September 9, 2026, 6:47 PM ET / 22:47 UTC (Revision 2). ClawSweeper reviewWhat this changesReject blank directory group IDs before plugin setup, with regression tests and CLI documentation. Merge readiness✅ Ready for maintainer review The fix remains necessary: current main and v2026.9.3 validate group IDs after plugin setup. The patch correctly repairs that ordering, and no actionable regression was found. Priority: P2 Review scores
Verification
How this fits togetherThe directory CLI resolves channel accounts and plugins to look up contacts and group members. Its setup step can install or enable plugins and persist configuration before returning lookup results. flowchart TD
A[Group member command] --> B[Validate limit and group ID]
B -->|Invalid| C[Report command error]
B -->|Valid| D[Resolve channel and plugin]
D --> E[Commit required setup changes]
E --> F[Look up group members]
F --> G[Print results]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource 0, Tests +72, Docs +2. Total +74 across 3 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep group-ID validation at the CLI input boundary so invalid requests cannot trigger setup while valid requests retain existing behavior. Do we have a high-confidence way to reproduce the issue? Yes, from source: a blank group ID with an explicit channel reaches installation/configuration setup before rejection on current main. Runtime reproduction was not executed in this read-only review. Is this the best way to solve the issue? Yes. Moving the existing guard ahead of the side-effecting resolver is a narrow repair that preserves normalization, valid lookups, and limit-error precedence. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 40ba595167bc. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where
directory groups members --group-id ""or a whitespace-only ID could run plugin setup and write configuration before reportingMissing --group-id.Why This Change Was Made
Move the existing group-ID normalization and check immediately after limit validation, before directory resolution. Valid-ID trimming, setup, lookup and error handling remain unchanged. The CLI reference documents the early rejection.
User Impact
Invalid group-member requests fail before directory plugin installation, enablement or configuration writes. Valid commands retain their existing behavior.
Evidence
Two regressions fail on the original code because the configuration-write boundary is reached; the same 43 tests pass after the guard move. Controls cover a valid trimmed ID with setup writes and invalid-limit precedence. All 29 changed-file checks, docs listing and independent review through P2 pass. Tests isolate configuration/provider operations; no real settings or credentials were used.