Never block agents: close-via-update, semantic fallback, create form, calendar --date crash#40
Conversation
… calendar --date Telemetry (close_through_update: 86 hits) plus a full manual dogfood and a code-quality audit surfaced several agent-blocking paths and dead code. This makes the highest-friction commands never hard-fail an agent, fixes a calendar crash, and removes verified dead code. Agent UX — never block (pm-j1v7): - pm update <id> --status closed now auto-routes to the auditable close workflow instead of throwing close_through_update. Any other field updates in the same call are applied first, then the item is closed with --close-reason, --message, or a derived default. Warnings: auto_routed_from_update_to_close, and close_reason_defaulted only when a generic placeholder was truly invented. - Explicit pm search --semantic/--hybrid degrade to keyword search (with a search_<mode>_fallback:<reason>:using_keyword_mode warning) when the embedding or vector backend is unreachable or unconfigured, instead of surfacing unknown_error. Keyword hits are always computed locally, so the fallback is guaranteed to succeed. - pm create now accepts the natural subcommand form pm create <type> <title> alongside pm create "<title>"; an invalid type yields an actionable error. Calendar (pm-l292): - pm cal <view> --date <value> no longer crashes. The positional-view guard counted loosely-parsed flag tokens as extra positionals; it now only treats leading non-flag tokens as positionals. Two positional views are still rejected. Fixed in both index.ts and the committed index.js. Code quality — remove dead code (pm-b7do): - Delete src/core/output/command-aware.ts (389 LOC, orphaned, previously allowlisted as zero-incoming-import in the static gate). - Remove 5 dead exports: getActiveCommandContext, applyDynamicExtensionOptions, normalizeCalendarOptions, listDocumentedHelpPaths, uniqueTokens. - Remove unused direct dependency undici (zero imports; transitive undici@6 via @sentry/node remains). Update lockfile and gate allowlists. Verification: 1414 tests pass at 100% coverage (stmts/branches/funcs/lines); typecheck, static-quality, secret scan, docs-skills, version policy, npm pack dry-run, and package-first dogfood all green. Added regression tests for every behavior change. Follow-ups filed: pm-7rlp (CI/test perf), pm-rjgh (docs hygiene), pm-fu5d (remaining dogfood polish), pm-mbdu (large-file split plan). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Reviewer's GuideMakes high-friction CLI paths non-blocking for agents (update close routing, semantic search fallback, create positional handling), fixes a calendar CLI crash, and removes dead code and an unused dependency, with tests updated to lock in behavior. Sequence diagram for pm update auto-routing close status to runClosesequenceDiagram
participant CLI
participant runUpdate
participant runClose
CLI->>runUpdate: runUpdate(id, options, global)
activate runUpdate
alt options.status normal
runUpdate-->>CLI: { item, changed_fields, warnings }
else options.status is close_status
runUpdate->>runUpdate: compute otherFieldKeys
alt otherFieldKeys not empty
runUpdate->>runUpdate: runUpdate(id, options_without_status_closeReason_message, global)
runUpdate-->>runUpdate: preUpdate{ changed_fields, warnings }
end
runUpdate->>runClose: runClose(id, closeReason, closeOptions, global)
runClose-->>runUpdate: closeResult{ item, changed_fields, warnings }
runUpdate-->>CLI: { item: closeResult.item, changed_fields: preChangedFields + closeResult.changed_fields, warnings: routeWarnings + closeResult.warnings + auto_routed_from_update_to_close [+ close_reason_defaulted] }
end
deactivate runUpdate
Sequence diagram for semantic search fallback to keyword modesequenceDiagram
participant CLI
participant runSearch
CLI->>runSearch: runSearch(query, options, global)
activate runSearch
runSearch->>runSearch: determine effectiveMode, modeWasExplicit
runSearch->>runSearch: compute keywordHits
alt effectiveMode is keyword
runSearch-->>CLI: { hits: keywordHits, warnings }
else effectiveMode is semantic or hybrid
runSearch->>runSearch: attempt semantic/hybrid search
alt semantic/hybrid succeeds
runSearch-->>CLI: { hits, warnings }
else [semantic or hybrid search throws error]
alt modeWasExplicit
runSearch->>runSearch: buildExplicitSemanticFallbackWarning(effectiveMode, error)
else modeWasExplicit is false
runSearch->>runSearch: buildImplicitSemanticFallbackWarning(error)
end
runSearch->>runSearch: effectiveMode = keyword
runSearch->>runSearch: hits = keywordHits
runSearch->>runSearch: warnings.push(fallbackWarning)
runSearch-->>CLI: { hits: keywordHits, warnings }
end
end
deactivate runSearch
Flow diagram for pm create positional type/title handlingflowchart TD
A[Start pm create] --> B{typeOrTitle provided?}
B -->|no| Z[Use only flag options]
B -->|yes| C{secondTitle provided?}
C -->|yes| D[Set positionalType = typeOrTitle\nSet positionalTitle = secondTitle]
C -->|no| E[Set positionalTitle = typeOrTitle]
D --> F
E --> F{options.type undefined\nAND positionalType set?}
F -->|yes| G[options.type = positionalType]
F -->|no| H[Leave options.type unchanged]
G --> I
H --> I{options.title undefined\nAND positionalTitle set?}
I -->|yes| J[options.title = positionalTitle]
I -->|no| K[Leave options.title unchanged]
J --> L[Call runCreate with options]
K --> L[Call runCreate with options]
Z --> L
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ 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 (6)
📝 WalkthroughWalkthroughThis PR implements three interconnected agent UX behavior fixes (calendar argument parsing, search semantic fallback, update auto-routing), adds create command positional argument support, and removes 399 lines of dead code and five orphaned exported functions plus an unused dependency. ChangesAgent UX Behavior Fixes and CLI Enhancements
Project Management Metadata and Issue Tracking
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The
runUpdateclose-routing path now recursively callsrunUpdatewith modified options to apply pre-close field changes; consider extracting the shared mutation logic into a helper to avoid recursion and make it easier to reason about telemetry, warnings aggregation, and potential future side effects. - Semantic/hybrid search now always degrades to keyword on any thrown error; you may want to distinguish configuration/backend issues from programmer errors (e.g. misbehaving extensions) so that truly unexpected failures can still surface clearly instead of being silently converted into keyword results.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `runUpdate` close-routing path now recursively calls `runUpdate` with modified options to apply pre-close field changes; consider extracting the shared mutation logic into a helper to avoid recursion and make it easier to reason about telemetry, warnings aggregation, and potential future side effects.
- Semantic/hybrid search now always degrades to keyword on any thrown error; you may want to distinguish configuration/backend issues from programmer errors (e.g. misbehaving extensions) so that truly unexpected failures can still surface clearly instead of being silently converted into keyword results.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.agents/pm/chores/pm-7rlp.toon (1)
1-14:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winDo not edit
.agents/pmfiles directly.All files under
.agents/pm/**in this PR (pm-7rlp.toon, pm-7rlp.jsonl, pm-fu5d.toon, pm-fu5d.jsonl, pm-mbdu.toon, pm-mbdu.jsonl, pm-rjgh.toon, pm-rjgh.jsonl) should be created and updated through the pm CLI tool commands rather than direct file edits, since pm is designated as the system of record. As per coding guidelines,.agents/pm/**:pmis the system of record. Do not edit.agents/pmfiles directly.🤖 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 @.agents/pm/chores/pm-7rlp.toon around lines 1 - 14, This change incorrectly edits files under .agents/pm directly; revert those manual edits and instead use the pm CLI to create/update the records (e.g., run the pm commands that correspond to creating/updating entries with ids like pm-7rlp, pm-fu5d, pm-mbdu, pm-rjgh and their .jsonl variants) so the system-of-record is authoritative; do not modify files under .agents/pm by hand—use the pm tool’s create/update commands to regenerate pm-7rlp.toon, pm-7rlp.jsonl, pm-fu5d.*, pm-mbdu.*, pm-rjgh.* with the intended metadata.
🤖 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.
Inline comments:
In @.agents/pm/chores/pm-b7do.toon:
- Around line 1-14: This .agents/pm file (id: pm-b7do, title: "Remove dead code:
command-aware.ts...") was added manually but .agents/pm/** is managed by the pm
tool and must not be edited directly; remove this file from the PR (or revert
the commit that added it) and instead apply the change through the pm tool so it
generates the canonical entry, or if this change must be represented in source
control, put it in the tool-managed configuration source the pm tool uses;
ensure the manual addition of pm-b7do is undone before merging.
In @.agents/pm/history/pm-b7do.jsonl:
- Around line 1-2: This change adds a manual .agents/pm history file
(pm-b7do.jsonl) which must not be created/edited directly; remove the added file
from the PR and instead re-create the same metadata using the official pm tool
(do not hand-edit .agents/pm/**). Specifically, drop the new
.agents/pm/history/pm-b7do.jsonl entry from the commit/branch and run the pm
workflow to record the metadata/title ("Remove dead code: command-aware.ts
module...") and status updates so the system-of-record is updated correctly;
ensure the resulting pm-managed entry contains the same metadata fields (id,
title, description, status, timestamps, close_reason) so the repo no longer
contains manual .agents/pm edits.
---
Outside diff comments:
In @.agents/pm/chores/pm-7rlp.toon:
- Around line 1-14: This change incorrectly edits files under .agents/pm
directly; revert those manual edits and instead use the pm CLI to create/update
the records (e.g., run the pm commands that correspond to creating/updating
entries with ids like pm-7rlp, pm-fu5d, pm-mbdu, pm-rjgh and their .jsonl
variants) so the system-of-record is authoritative; do not modify files under
.agents/pm by hand—use the pm tool’s create/update commands to regenerate
pm-7rlp.toon, pm-7rlp.jsonl, pm-fu5d.*, pm-mbdu.*, pm-rjgh.* with the intended
metadata.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 8f514252-1946-4404-88ef-2801f8c58ba7
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (32)
.agents/pm/chores/pm-7rlp.toon.agents/pm/chores/pm-b7do.toon.agents/pm/chores/pm-fu5d.toon.agents/pm/chores/pm-mbdu.toon.agents/pm/chores/pm-rjgh.toon.agents/pm/history/pm-7rlp.jsonl.agents/pm/history/pm-b7do.jsonl.agents/pm/history/pm-fu5d.jsonl.agents/pm/history/pm-j1v7.jsonl.agents/pm/history/pm-l292.jsonl.agents/pm/history/pm-mbdu.jsonl.agents/pm/history/pm-rjgh.jsonl.agents/pm/issues/pm-j1v7.toon.agents/pm/issues/pm-l292.toonpackage.jsonpackages/pm-calendar/extensions/calendar/index.jspackages/pm-calendar/extensions/calendar/index.tsscripts/release/static-quality-gate.mjssrc/cli/commands/search.tssrc/cli/commands/update.tssrc/cli/extension-command-help.tssrc/cli/help-content.tssrc/cli/register-mutation.tssrc/cli/registration-helpers.tssrc/core/extensions/index.tssrc/core/output/command-aware.tssrc/core/shared/text-normalization.tstests/integration/release-readiness-runtime.spec.tstests/unit/builtin-extension-entrypoints.spec.tstests/unit/search-advanced-runtime.spec.tstests/unit/search-command.spec.tstests/unit/update-command.spec.ts
💤 Files with no reviewable changes (8)
- src/core/shared/text-normalization.ts
- src/core/output/command-aware.ts
- src/core/extensions/index.ts
- scripts/release/static-quality-gate.mjs
- src/cli/extension-command-help.ts
- src/cli/registration-helpers.ts
- package.json
- src/cli/help-content.ts
| id: pm-b7do | ||
| title: "Remove dead code: command-aware.ts module, 5 orphaned exported functions, unused undici dependency" | ||
| description: "Code-quality audit (grep-verified zero call sites). Deleted src/core/output/command-aware.ts (389 LOC, orphaned by commit 5211414a; was explicitly allowlisted in static-quality-gate as zero-incoming-import). Removed dead exports getActiveCommandContext, applyDynamicExtensionOptions, normalizeCalendarOptions, listDocumentedHelpPaths, uniqueTokens. Removed unused direct dependency undici (^8.1.0; zero imports, only transitive undici@6 via @sentry/node remains). Updated the coverage-include allowlist and static-gate allowlist accordingly." | ||
| type: Chore | ||
| status: closed | ||
| priority: 2 | ||
| tags[3]: code-quality,dead-code,refactor | ||
| created_at: "2026-05-21T21:56:52.288Z" | ||
| updated_at: "2026-05-21T22:09:30.435Z" | ||
| author: claude-code-agent | ||
| acceptance_criteria: All dead symbols removed with zero remaining references; build/typecheck/static-gate green; 100% coverage maintained. | ||
| parent: pm-rnpb | ||
| close_reason: "Removed src/core/output/command-aware.ts (389 LOC) + 5 orphaned exports + unused undici dep; updated coverage-include and static-gate allowlists. Build/typecheck/static-gate green, 100% coverage maintained." | ||
| body: "" |
There was a problem hiding this comment.
Do not create .agents/pm files directly.
This file should be managed by the pm tool, not manually created or edited in the repository. As per coding guidelines, .agents/pm/** files are the system of record and should not be edited directly.
As per coding guidelines: ".agents/pm/**: pm is the system of record. Do not edit .agents/pm files directly."
🤖 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 @.agents/pm/chores/pm-b7do.toon around lines 1 - 14, This .agents/pm file
(id: pm-b7do, title: "Remove dead code: command-aware.ts...") was added manually
but .agents/pm/** is managed by the pm tool and must not be edited directly;
remove this file from the PR (or revert the commit that added it) and instead
apply the change through the pm tool so it generates the canonical entry, or if
this change must be represented in source control, put it in the tool-managed
configuration source the pm tool uses; ensure the manual addition of pm-b7do is
undone before merging.
| {"ts":"2026-05-21T21:56:52.288Z","author":"claude-code-agent","op":"create","patch":[{"op":"add","path":"/metadata/id","value":"pm-b7do"},{"op":"add","path":"/metadata/title","value":"Remove dead code: command-aware.ts module, 5 orphaned exported functions, unused undici dependency"},{"op":"add","path":"/metadata/description","value":"Code-quality audit (grep-verified zero call sites). Deleted src/core/output/command-aware.ts (389 LOC, orphaned by commit 5211414a; was explicitly allowlisted in static-quality-gate as zero-incoming-import). Removed dead exports getActiveCommandContext, applyDynamicExtensionOptions, normalizeCalendarOptions, listDocumentedHelpPaths, uniqueTokens. Removed unused direct dependency undici (^8.1.0; zero imports, only transitive undici@6 via @sentry/node remains). Updated the coverage-include allowlist and static-gate allowlist accordingly."},{"op":"add","path":"/metadata/type","value":"Chore"},{"op":"add","path":"/metadata/status","value":"open"},{"op":"add","path":"/metadata/priority","value":2},{"op":"add","path":"/metadata/tags","value":["code-quality","dead-code","refactor"]},{"op":"add","path":"/metadata/created_at","value":"2026-05-21T21:56:52.288Z"},{"op":"add","path":"/metadata/updated_at","value":"2026-05-21T21:56:52.288Z"},{"op":"add","path":"/metadata/author","value":"claude-code-agent"},{"op":"add","path":"/metadata/acceptance_criteria","value":"All dead symbols removed with zero remaining references; build/typecheck/static-gate green; 100% coverage maintained."},{"op":"add","path":"/metadata/parent","value":"pm-rnpb"}],"before_hash":"3cc22dff72be7b14824654a7a64ea62b04799939b2fee54c1b5f52ca60bf6df0","after_hash":"114abd429fbb6a720519fa04c0bc0fa58f132091ade15557b20eefe4c30c2a16","message":""} | ||
| {"ts":"2026-05-21T22:09:30.435Z","author":"claude-code-agent","op":"close","patch":[{"op":"replace","path":"/metadata/updated_at","value":"2026-05-21T22:09:30.435Z"},{"op":"replace","path":"/metadata/status","value":"closed"},{"op":"add","path":"/metadata/close_reason","value":"Removed src/core/output/command-aware.ts (389 LOC) + 5 orphaned exports + unused undici dep; updated coverage-include and static-gate allowlists. Build/typecheck/static-gate green, 100% coverage maintained."}],"before_hash":"114abd429fbb6a720519fa04c0bc0fa58f132091ade15557b20eefe4c30c2a16","after_hash":"64d5feb49a9d69fdf3e4023b3fb1dc6be239240589c9edc36822dcd5c8a6b923"} |
There was a problem hiding this comment.
Do not create .agents/pm files directly.
This history file should be managed by the pm tool, not manually created or edited in the repository. As per coding guidelines, .agents/pm/** files are the system of record and should not be edited directly.
As per coding guidelines: ".agents/pm/**: pm is the system of record. Do not edit .agents/pm files directly."
🤖 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 @.agents/pm/history/pm-b7do.jsonl around lines 1 - 2, This change adds a
manual .agents/pm history file (pm-b7do.jsonl) which must not be created/edited
directly; remove the added file from the PR and instead re-create the same
metadata using the official pm tool (do not hand-edit .agents/pm/**).
Specifically, drop the new .agents/pm/history/pm-b7do.jsonl entry from the
commit/branch and run the pm workflow to record the metadata/title ("Remove dead
code: command-aware.ts module...") and status updates so the system-of-record is
updated correctly; ensure the resulting pm-managed entry contains the same
metadata fields (id, title, description, status, timestamps, close_reason) so
the repo no longer contains manual .agents/pm edits.
|
Thanks @coderabbitai and @sourcery-ai — addressing the feedback: CodeRabbit — Sourcery #1 — recursion in the close-route: The recursive Sourcery #2 — semantic/hybrid degrade-on-any-error could mask unexpected failures: Good point, and intentional. The product requirement is that search must never block an agent (it's the most-used retrieval path and must be model/endpoint-agnostic). Observability is preserved without blocking: every degrade emits a machine-readable CI is green and 100% coverage is maintained; merging once all required checks finish. |
|
Tip For best results, initiate chat on the files or code changes.
No further concerns on my end — CI green + 100% coverage looks good. 🚀 ✏️ Learnings added
|
There was a problem hiding this comment.
Code Review
This pull request introduces several agent-UX improvements and bug fixes across the CLI. Key changes include auto-routing pm update --status closed to the auditable close workflow to prevent blocking errors, implementing a keyword fallback for explicit semantic/hybrid searches when backends are unconfigured, and supporting the pm create <type> <title> positional form. Additionally, it fixes a crash in the calendar extension when combining positional views with flags and removes significant dead code, including the command-aware.ts module and the undici dependency. Review feedback identifies a potential atomicity issue in the runUpdate refactor that could lead to partial updates and suggests using more idiomatic array methods for argument parsing in the calendar extension.
| if (otherFieldKeys.length > 0) { | ||
| const preUpdate = await runUpdate( | ||
| id, | ||
| { ...options, status: undefined, closeReason: undefined, message: undefined }, | ||
| global, | ||
| ); | ||
| preChangedFields = preUpdate.changed_fields; | ||
| routeWarnings.push(...preUpdate.warnings); | ||
| } |
There was a problem hiding this comment.
This recursive call to runUpdate breaks the atomicity of the update operation when closing an item. It results in two separate database transactions and history entries for a single command invocation. If the second transaction (runClose) fails, the item is left in a partially updated state.
To ensure atomicity, all changes should be performed within a single mutateItem call. I recommend refactoring the mutation logic from the main mutateItem callback into a reusable function. This function can then be used to apply all field updates (both standard updates and close-related changes) in one transaction, preventing data inconsistency and simplifying the history.
| const positionalArgs = []; | ||
| for (const arg of context.args) { | ||
| if (arg.startsWith("-")) { | ||
| break; | ||
| } | ||
| positionalArgs.push(arg); | ||
| } |
There was a problem hiding this comment.
This for loop to extract positional arguments can be made more concise and idiomatic by using array methods like findIndex and slice. This improves readability and reduces verbosity.
const flagIndex = context.args.findIndex(arg => arg.startsWith("-"));
const positionalArgs = flagIndex === -1 ? context.args : context.args.slice(0, flagIndex);| const positionalArgs: string[] = []; | ||
| for (const arg of context.args) { | ||
| if (arg.startsWith("-")) { | ||
| break; | ||
| } | ||
| positionalArgs.push(arg); | ||
| } |
There was a problem hiding this comment.
This for loop to extract positional arguments can be made more concise and idiomatic by using array methods like findIndex and slice. This improves readability and reduces verbosity.
const flagIndex = context.args.findIndex(arg => arg.startsWith("-"));
const positionalArgs = flagIndex === -1 ? context.args : context.args.slice(0, flagIndex);Apply gemini-code-assist MEDIUM suggestion: replace the manual leading-token loop with findIndex/slice in the calendar positional-view parser (index.ts and the committed index.js). Behaviorally identical; clearer and less verbose. The gemini/Sourcery HIGH note on the close-route's two-write non-atomicity (for the rare pm update --status closed + other-fields case) is tracked in pm-mbdu: the proper single-transaction fix depends on extracting runUpdate's field application into a reusable mutate helper that runClose can also apply. The common close-only path is already a single atomic close. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Thanks @gemini-code-assist:
|
|
Thanks for the update and for outlining the plan for the atomicity concern. Extracting the field-application logic into a reusable mutate helper is indeed the correct architectural path forward to ensure that |
Summary
Telemetry (
close_through_update: 86 hits over 14d), a full manual dogfood, and a code-quality audit surfaced several agent-blocking paths, a calendar crash, and verified dead code. This PR makes the highest-friction commands never hard-fail an agent, fixes the calendar bug, and removes dead code — without removing any feature.Agent UX — never block (pm-j1v7)
pm update <id> --status closedauto-routes to the auditable close workflow instead of throwingclose_through_update. Other field updates in the same call are applied first, then the item is closed with--close-reason,--message, or a derived default. Warnings:auto_routed_from_update_to_close, andclose_reason_defaultedonly when a generic placeholder was truly invented.pm search --semantic/--hybriddegrade to keyword search (with asearch_<mode>_fallback:<reason>:using_keyword_modewarning) when the embedding/vector backend is unreachable or unconfigured, instead of surfacingunknown_error. Keyword hits are computed locally first, so the fallback always succeeds.pm create <type> <title>— the natural subcommand form now works alongsidepm create "<title>"; an invalid type yields an actionable error listing allowed types.Calendar (pm-l292)
pm cal <view> --date <value>no longer crashes (wasextension_command_handler_failed). The positional-view guard counted loosely-parsed flag tokens as extra positionals; it now only treats leading non-flag tokens as positionals. Two positional views are still rejected. Fixed inindex.tsand the committedindex.js.Code quality — remove dead code (pm-b7do)
src/core/output/command-aware.ts(389 LOC, orphaned, previously allowlisted as zero-incoming-import).getActiveCommandContext,applyDynamicExtensionOptions,normalizeCalendarOptions,listDocumentedHelpPaths,uniqueTokens.undici(transitiveundici@6via@sentry/noderemains).Verification
npm pack --dry-run, and package-first dogfood all green.Follow-ups filed (not in this PR)
🤖 Generated with Claude Code
Summary by Sourcery
Ensure high-friction CLI flows never hard-fail agents, improve calendar argument handling, and remove verified dead code and unused dependencies.
New Features:
pm create <type> <title>positional form alongside the existing title-only form.Bug Fixes:
pm update --status closedthrough the auditable close workflow, applying other field updates first and deriving a close reason when needed so the operation never blocks.pm cal <view> --date <value>treats only leading non-flag arguments as positionals, preventing crashes and still rejecting multiple positional views.Enhancements:
pm updateproceed normally while preserving close-specific auditing via the dedicated workflow.Tests:
Chores:
command-awareoutput module and several unused exports from core and CLI utilities.undicidependency and update static-quality scripts to reflect the removed module.