Skip to content

fix(cli): reject blank directory group IDs before setup - #143440

Merged
steipete merged 1 commit into
mainfrom
codex/fix-directory-group-validation
Sep 9, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/fix-directory-group-validation

Conversation

@steipete

@steipete steipete commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

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 reporting Missing --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.

@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes size: S maintainer Maintainer-authored PR labels Sep 9, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 9, 2026
@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 9, 2026, 6:47 PM ET / 22:47 UTC (Revision 2).

ClawSweeper review

What this changes

Reject 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
Reviewed head: 247f5140afc78a4fb9dbf86f1292a7bf67091189

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused guard relocation with meaningful regression controls and matching documentation; no blocking defect was found.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied MEMBER author classification makes the external-contributor proof gate inapplicable. The body reports mocked CLI boundary tests for skipped setup writes and valid lookup preservation; these are supplemental evidence, not a real installation run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied MEMBER author classification makes the external-contributor proof gate inapplicable. The body reports mocked CLI boundary tests for skipped setup writes and valid lookup preservation; these are supplemental evidence, not a real installation run.
Evidence reviewed 7 items Introduced change: The pinned introduction diff moves the existing normalization and rejection ahead of resolve, preserving limit precedence and the valid lookup arguments.
Current-main defect remains: The members action calls resolve before checking groupId; resolve permits plugin installation and commits configuration changes. No equivalent early group-ID guard exists in this owner.
Latest release still has late validation: The v2026.9.3 source also resolves the plugin before rejecting a blank group ID. The GitHub contents read succeeded after the local release-blob read failed.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source 0, Tests +72, Docs +2. Total +74 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 4 4 0
Tests 1 72 0 +72
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 78 4 +74

Review metrics

None.

Technical review

Best 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.

Labels

Label justifications:

  • P2: This fixes unintended plugin setup and configuration writes on malformed directory commands with a limited blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied MEMBER author classification makes the external-contributor proof gate inapplicable. The body reports mocked CLI boundary tests for skipped setup writes and valid lookup preservation; these are supplemental evidence, not a real installation run.

Evidence

What I checked:

  • Introduced change: The pinned introduction diff moves the existing normalization and rejection ahead of resolve, preserving limit precedence and the valid lookup arguments. (src/cli/directory-cli.ts:337, 247f5140afc7)
  • Current-main defect remains: The members action calls resolve before checking groupId; resolve permits plugin installation and commits configuration changes. No equivalent early group-ID guard exists in this owner. (src/cli/directory-cli.ts:338, 40ba595167bc)
  • Latest release still has late validation: The v2026.9.3 source also resolves the plugin before rejecting a blank group ID. The GitHub contents read succeeded after the local release-blob read failed. (src/cli/directory-cli.ts, 1391f7cd2d40)
  • Focused behavioral coverage: The added cases exercise empty and whitespace-only IDs through Commander and assert that configuration reads, setup, writes, and lookup are skipped. A valid trimmed-ID control retains setup writes; the invalid-limit table preserves error precedence. The complete test file was inspected; tests were not executed during this read-only review. (src/cli/directory-cli.test.ts:228, 247f5140afc7)
  • History and routing: Current-main history identifies recent work on directory input validation and authored configuration preservation. GitHub commit patches independently associate hugenshen with limit validation and steipete with setup-write preparation; deeper local blame and pickaxe inspection failed on unavailable objects. (src/cli/directory-cli.ts, 40ba595167bc)
  • Discussion and review continuity: The supplied body reports two pre-fix failures and 43 passing post-fix tests using isolated configuration/provider operations. The preceding completed review covered the same head, had no findings, and published no rank-up moves. Repository State identifies the author as MEMBER and the item carries the protected maintainer label; the live pull endpoint instead reports CONTRIBUTOR. (247f5140afc7)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-09T22:36:53.909Z sha 247f514 :: needs maintainer review before merge. :: none

@steipete
steipete marked this pull request as ready for review September 9, 2026 22:43
@steipete
steipete merged commit d2e6762 into main Sep 9, 2026
216 checks passed
@steipete
steipete deleted the codex/fix-directory-group-validation branch September 9, 2026 23:06
@steipete

steipete commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant