fix(templates): auto-select the only active change instead of always prompting - #1468
Conversation
…prompting
The continue, update, verify, sync, and archive workflows told agents
'Do NOT guess or auto-select a change. Always let the user choose', which
contradicted their own Input line ('check if it can be inferred from
conversation context') and stalled every invocation on a question with a
single possible answer when only one change was active. Align them with
the selection pattern /opsx:apply has used since #513: use the provided
name, infer from context, auto-select a sole active change, prompt only
when ambiguous, and always announce the selection with how to override.
Bulk archive keeps its always-prompt behavior.
Closes #679
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughWorkflow change-selection guidance now infers from context, auto-selects a sole active change, prompts only when ambiguous, and announces the selection with an override hint across archive, continue, sync, update, and verify workflows. ChangesChange selection behavior
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Agent
participant WorkflowSkill
participant ConversationContext
participant OpenSpecList
Agent->>WorkflowSkill: invoke workflow without change name
WorkflowSkill->>ConversationContext: infer target change
ConversationContext-->>WorkflowSkill: target or ambiguous result
WorkflowSkill->>OpenSpecList: list filtered changes when ambiguous
OpenSpecList-->>Agent: candidate changes
Agent-->>WorkflowSkill: choose or confirm change
WorkflowSkill-->>Agent: announce Using change and override hint
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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.
Actionable comments posted: 4
🤖 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 `@openspec/changes/add-update-workflow/design.md`:
- Around line 35-37: Update the selection flow described under
openspec/changes/add-update-workflow/design.md lines 35-37 to require announcing
“Using change: <name>” after selecting a change and documenting how an explicit
override changes selection. Add the same announcement and override behavior as
normative scenario conditions in
openspec/changes/add-update-workflow/specs/opsx-update-skill/spec.md lines 9-11,
keeping both descriptions aligned.
In `@skills/openspec-verify-change/SKILL.md`:
- Line 31: Update the override hint in the announcement text to use the public
`/opsx:verify <other>` command instead of `/openspec-verify-change <other>`,
while preserving the existing change-name announcement.
In `@src/core/templates/workflows/continue-change.ts`:
- Around line 22-37: Update the change-selection logic to inspect and count
active candidates before choosing: use the named or context-inferred change when
available, auto-select the sole active candidate, and prompt only when multiple
active candidates remain; remove unconditional prompt wording and retain the
required selection announcement and override guidance. Apply this logic at
src/core/templates/workflows/continue-change.ts lines 22-37 and 140-155, and
skills/openspec-verify-change/SKILL.md lines 20-25, with identical behavior at
each site.
In `@src/core/templates/workflows/sync-specs.ts`:
- Around line 24-33: Filter active changes by each workflow’s eligibility
criteria before resolving selection ambiguity: sync-specs flows in
src/core/templates/workflows/sync-specs.ts at lines 24-33 and 234-243 must use
only changes with delta specs, while verify-change flows in
src/core/templates/workflows/verify-change.ts at lines 22-33 and 197-208 must
use only changes with implementation tasks. Auto-select one eligible candidate,
prompt for multiple, and report no eligible candidate for none; update
skills/openspec-sync-specs/SKILL.md lines 22-31 to preserve the same sync
selection contract.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 89a12ef2-596d-4ba6-9fb3-672a9acbdef5
📒 Files selected for processing (17)
.changeset/single-change-autoselect.mdopenspec/changes/add-update-workflow/design.mdopenspec/changes/add-update-workflow/specs/opsx-update-skill/spec.mdopenspec/specs/opsx-archive-skill/spec.mdopenspec/specs/opsx-verify-skill/spec.mdopenspec/specs/specs-sync-skill/spec.mdskills/openspec-archive-change/SKILL.mdskills/openspec-continue-change/SKILL.mdskills/openspec-sync-specs/SKILL.mdskills/openspec-update-change/SKILL.mdskills/openspec-verify-change/SKILL.mdsrc/core/templates/workflows/archive-change.tssrc/core/templates/workflows/continue-change.tssrc/core/templates/workflows/sync-specs.tssrc/core/templates/workflows/update-change.tssrc/core/templates/workflows/verify-change.tstest/core/templates/skill-templates-parity.test.ts
…ction contract CodeRabbit noted the add-update-workflow delta spec and design sketch adopted auto-selection without the 'Using change: <name>' announcement the other selection contracts require. Add the same announce-and-override clause so the update skill's contract matches the template it describes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
alfred-openspec
left a comment
There was a problem hiding this comment.
Reviewed at 556560a. Continue, update, verify, sync, and archive now match apply selection semantics: explicit name, context inference, sole-active-change auto-selection, ambiguity prompt, and announced override; bulk archive remains interactive. 19 focused tests, strict validation, all-tool generation with no stale guardrail, the 2,301-test cross-platform suite, CodeQL, audit, dependency review, and release tracking all pass.
…oselect # Conflicts: # test/core/templates/skill-templates-parity.test.ts
alfred-openspec
left a comment
There was a problem hiding this comment.
Reviewed at 587659b. The main merge preserves the explicit/context/sole-active/ambiguous selection ladder, announced override behavior, and bulk archive’s interactive contract while incorporating the newer sync-subset and YAML safeguards. Build, lint, 26 focused parity/template tests, strict validation of all 36 specs and add-update-workflow, generated-skill parity, all-tool generation, the cross-platform suite, CodeQL, audit, dependency review, and release tracking all pass.
Closes #679
Status: LGTM — full suite green (2,301 tests), specs validated, e2e-inspected generated output, three independent adversarial reviews run and their one finding fixed.
What was wrong: Invoking
/opsx:continue(or update, verify, sync, archive) without a change name always stalled on "which change?" — even when only one active change existed, so there was only one possible answer. The templates' step 1 said "Do NOT guess or auto-select a change. Always let the user choose," which also contradicted their own Input line ("check if it can be inferred from conversation context"). #679 describes exactly this: fire the command, walk away, come back to find nothing happened. Meanwhile/opsx:applyhas inferred and auto-selected since #513.How it was fixed: The five workflows now use apply's exact selection step: use the provided name → infer from conversation context → auto-select when exactly one active change exists → prompt only when genuinely ambiguous — and always announce
Using change: <name>with how to override. Each workflow keeps its own presentation hints for the prompt path (recent-first options for continue/update, task-bearing changes for verify, delta-bearing changes for sync, active changes for archive). Bulk archive intentionally keeps its always-prompt behavior (multi-select is inherently interactive). Main specs for the archive/verify/sync skills and the activeadd-update-workflowchange were updated in the same commit, plus a changeset.Proof it works:
pnpm vitest run: 113 files, 2,301 tests pass (parity hashes and committedskills/*/SKILL.mdregenerated).openspec validate --specs --allandopenspec validate add-update-workflowpass (the oneschema-alias-supportfailure is pre-existing and identical on clean main).openspec init --tools claude,codexin a fresh project — no generated file retains the old guardrail; the new selection step renders correctly in both skills and commands.openspec archive <name>without--yesalready does, and archive's completion/sync confirmation gates are untouched.Notes: Guidance-only — no CLI code paths change; users pick the new prompts up via
openspec update.#663looks adjacent but is a different defect (agent running ahead of/opsx:continue), so it is not claimed here.🤖 Generated with Claude Code
Summary by CodeRabbit
Behavior Improvements
Documentation / Tests