Repository navigation
Fix status-all context filters - #310
Conversation
Add a shared standalone --status all sentinel for list/search duplicate-discovery workflows, including list's active-only terminal exclusion override and explicit filter echo. Update CLI/MCP docs, contract snapshot, pm-changelog output, and focused regressions for parser/search/list behavior. Tracker: pm-i02t.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
@codex review |
|
Warning Review limit reached
More reviews will be available in 44 minutes and 37 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (13)
📝 WalkthroughWalkthroughAdds Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
To use Codex here, create a Codex account and connect to github. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== PR Details ==="
gh pr view 310 --repo unbraind/pm-cli --json title,body,state,baseRefName,headRefName,files,additions,deletions,changedFiles
echo ""
echo "=== Changed Files ==="
gh pr diff 310 --repo unbraind/pm-cliLength of output: 45555 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== Search command source (status-related logic) ==="
fd -t f 'search' src/cli/commands/
echo ""
fd -t f 'search' src/cli/commands/ | xargs grep -n "filtersStatus\|isStatusAll\|STATUS_ALL\|filters\.status\|explicitAll\|resolvedStatus" 2>/dev/null || echo "No matches"
echo ""
echo "=== isStatusAllFilterInput usages ==="
rg -n "isStatusAllFilterInput" --type ts
echo ""
echo "=== parseStatusFilterCsv surrounding context in search ==="
fd -t f -e ts . src/cli/commands/ | xargs grep -l "parseStatusFilterCsv" 2>/dev/null || echo "No files"
echo ""
echo "=== filtersStatus in search command ==="
rg -n "filtersStatus" --type ts -A3 -B3Length of output: 4639
Overall AssessmentThe change is well-scoped, correctly implemented, and thoroughly verified. The
|
| Area | Status |
|---|---|
isStatusAllFilterInput helper |
✅ Clean, correctly exported, handles edge cases |
parseStatusFilterCsv mixed-all rejection |
✅ Clear error message, tested |
list.ts terminal-exclusion override |
✅ Correct; explicitAllStatuses flag disables excludeTerminal |
list.ts filters.status ternary |
✅ Correct order of precedence |
register-list-query.ts help text |
✅ Updated for both --status options |
tool-definitions.ts / contract snapshot |
✅ Consistent, snapshot regenerated |
docs/COMMANDS.md |
✅ Example added for --status all duplicate-check use case |
Unit tests (status-normalization.spec.ts) |
✅ Standalone all, case-insensitive ALL, mixed rejection |
Command tests (list-command.spec.ts, search-command.spec.ts) |
✅ Count, item IDs, and filters.status echo all verified |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/core/item/status-filter.ts (1)
129-137: 💤 Low valueConsider simplifying the standalone-all detection.
The code calls
isStatusAllFilterInput(raw)inside a block that already confirms at least one token equals"all"(line 129). Sincetokensis already computed at lines 122-125, you could avoid the re-parse by checkingtokens.length === 1directly:♻️ Optional simplification
- if (tokens.some((token) => token.trim().toLowerCase() === STATUS_ALL_SENTINEL)) { - if (isStatusAllFilterInput(raw)) { + const hasAllToken = tokens.some((token) => token.toLowerCase() === STATUS_ALL_SENTINEL); + if (hasAllToken) { + if (tokens.length === 1) { return undefined; } throw new PmCliError(This eliminates the redundant split/map/filter inside
isStatusAllFilterInputwhile preserving identical semantics.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/core/item/status-filter.ts` around lines 129 - 137, The code calls `isStatusAllFilterInput(raw)` to detect if "all" appears as the only token, but this function internally re-parses the raw input with split, map, and filter operations. Since the `tokens` array is already computed at lines 122-125 and you are already inside a block confirming at least one token equals STATUS_ALL_SENTINEL, replace the `isStatusAllFilterInput(raw)` call with a simpler direct check of `tokens.length === 1` to verify that "all" is the only token, eliminating the redundant re-parsing while preserving identical semantics.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/core/item/status-filter.ts`:
- Around line 129-137: The code calls `isStatusAllFilterInput(raw)` to detect if
"all" appears as the only token, but this function internally re-parses the raw
input with split, map, and filter operations. Since the `tokens` array is
already computed at lines 122-125 and you are already inside a block confirming
at least one token equals STATUS_ALL_SENTINEL, replace the
`isStatusAllFilterInput(raw)` call with a simpler direct check of `tokens.length
=== 1` to verify that "all" is the only token, eliminating the redundant
re-parsing while preserving identical semantics.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 5cc1fa27-86c1-4f06-a3e7-38d628b31825
📒 Files selected for processing (12)
.agents/pm/history/pm-i02t.jsonl.agents/pm/issues/pm-i02t.toonCHANGELOG.mddocs/COMMANDS.mdsrc/cli/commands/list.tssrc/cli/register-list-query.tssrc/core/item/status-filter.tssrc/mcp/tool-definitions.tstests/fixtures/contracts/full.jsontests/unit/commands/list-command.spec.tstests/unit/commands/search-command.spec.tstests/unit/core/item/status-normalization.spec.ts
Address PR review feedback for pm-i02t by avoiding redundant status-token parsing in the shared status filter helper and normalizing search filter summaries for case-insensitive --status all inputs. Add compact search regression coverage so status-all echoes remain stable across human-readable and JSON paths.
|
Review requested again after follow-up commit d993f9f. @codex review |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
To use Codex here, create a Codex account and connect to github. |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== Follow-up commit d993f9f4 details ==="
gh api repos/unbraind/pm-cli/commits/d993f9f4 --jq '.commit.message'
echo ""
echo "=== Files changed in d993f9f4 ==="
gh api repos/unbraind/pm-cli/commits/d993f9f4 --jq '.files[].filename'
echo ""
echo "=== Commit diff ==="
gh api repos/unbraind/pm-cli/commits/d993f9f4 --jq '.files[] | "--- \(.filename) ---\n\(.patch // "(binary or no patch)")'Length of output: 1500 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== status-filter.ts current state ==="
cat src/core/item/status-filter.ts
echo ""
echo "=== search.ts relevant sections ==="
grep -n "isStatusAllFilterInput\|filters\.status\|options\.status\|parseStatusFilterCsv" src/cli/commands/search.ts | head -40
echo ""
echo "=== search-command.spec.ts new tests ==="
grep -n -A 15 "status.*all\|ALL\|status_all\|explicitAll" tests/unit/commands/search-command.spec.ts | head -80Length of output: 9190
AssessmentBoth items flagged in the previous review have been cleanly resolved. The implementation is correct, consistent, and well-tested.
|
| Line | Before | After |
|---|---|---|
| 368 (human-readable path) | options.status (raw) |
isStatusAllFilterInput(options.status) ? "all" : options.status |
| 469 (JSON/compact path) | options.status ?? null (raw) |
isStatusAllFilterInput(options.status) ? "all" : options.status ?? null |
pm search --status ALL and pm list --status ALL now both echo filters.status: "all".
tests/unit/commands/search-command.spec.ts — regression coverage added ✅
Three new assertions cover the normalisation path:
status: "all"→filters.status === "all"(basic case)status: " ALL "→filters.status === "all"(case-insensitive + trim, human-readable path)status: " ALL "→filters.status === "all"(compact/JSON path, line 3253–3256)
Summary
| Area | Previous state | Now |
|---|---|---|
parseStatusFilterCsv double-parse |
isStatusAllFilterInput call |
✅ Direct allTokenCount / tokens.length === 1 |
search.ts echo (human-readable) |
options.status |
✅ Normalised via isStatusAllFilterInput |
search.ts echo (compact/JSON) |
options.status ?? null |
✅ Normalised via isStatusAllFilterInput |
| Case-insensitive echo test | ✅ " ALL " tested on both paths |
No further issues. The PR is in good shape.
✅ Action performed
Full review finished.
Summary
--status allsentinel for duplicate-safe lifecycle-wide search/list filteringpm list --status alloverride the active-only terminal exclusion and echofilters.status=allpm-i02tVerification
node scripts/run-tests.mjs test -- tests/unit/core/item/status-normalization.spec.ts tests/unit/commands/search-command.spec.ts tests/unit/commands/list-command.spec.tsnode scripts/run-tests.mjs coverage-> 4699 passed, 100/100/100/100pnpm contracts:check && pnpm quality:staticpnpm changelog:pm:checkwithpm-changelog@2026.6.14pm validate --check-resolution --check-history-drift-> history drift ok; pre-existing resolution warnings remainPM_PATH/PM_GLOBAL_PATHcovering init/create/close/search/listpnpm audit --audit-level moderate,pnpm security:scan, GitHub PR/issue/security alert checks, telemetry health, and Sentry unresolved 24h checkNotes
commander@15is not adopted because it requires Node>=22.12.0while this repo still declares/supports Node 20 and several workflows run Node 20.@types/node@26remains a separate dependency-validation lane rather than being bundled into this behavior fix.