OpenSpec icon indicating copy to clipboard operation
OpenSpec copied to clipboard

Agent always ask what change I mean even if there is only one

Open uiii opened this issue 9 months ago • 3 comments

When I use any of the commands like /opsx-continue the agent almost always ask me after several seconds of thinking (enough for me to switch to another app) what spec change do I want that command apply to event if there is only one change active. This bothers me because I execute the prompt and go do something else but after I return nothing was done because it got stuck on this confirm. I see I can specify the spec change name as parameter but it is cumbersome to always write it. I think it should take the active one if there is only one.

uiii avatar Feb 07 '26 17:02 uiii

Task completed.

The enrichment comment has been posted on issue #679. Here's a summary of the findings:

Root cause: The /opsx:continue skill template in src/core/templates/skill-templates.ts:416 has an explicit instruction: "Do NOT guess or auto-select a change. Always let the user choose." This forces the AI agent to always prompt the user, even when there's only one active change.

Key inconsistency: The /opsx:apply skill template (line 529 of the same file) already implements auto-selection when only one change exists. The fix is straightforward — update the continue template's change selection logic (lines 404-416) to match the apply template's pattern.

Related issues: #663 and #673 deal with other /opsx:continue behavioral quirks but are not duplicates.


View full conversation

Powered by 1Code

21st-connector avatar Feb 07 '26 17:02 21st-connector

Issue Analysis

Root Cause

The /opsx:continue skill template explicitly forbids auto-selection, even when only one change exists. In src/core/templates/skill-templates.ts:416:

**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.

This instruction (lines 404-416) tells the AI agent to always run openspec list --json, present options via AskUserQuestion, and wait for user input — regardless of how many changes are active.

Inconsistency with /opsx:apply

Notably, the /opsx:apply skill template already implements the exact behavior requested here. In src/core/templates/skill-templates.ts:525-532:

If a name is provided, use it. Otherwise:
- Infer from conversation context if the user mentioned a change
- Auto-select if only one active change exists
- If ambiguous, run `openspec list --json` to get available changes and use the AskUserQuestion tool to let the user select

So /opsx:apply auto-selects when there's one change, but /opsx:continue always prompts. This inconsistency is likely unintentional.

Suggested Fix

Update the change selection logic in getContinueChangeSkillTemplate() (line 404-416 of src/core/templates/skill-templates.ts) to match the pattern used by getApplyChangeSkillTemplate():

1. **Select the change**

   If a name is provided, use it. Otherwise:
   - Infer from conversation context if the user mentioned a change
   - Auto-select if only one active change exists
   - If ambiguous, run `openspec list --json` to get available changes and use the **AskUserQuestion tool** to let the user select

   Always announce: "Using change: <name>" and how to override (e.g., `/opsx:continue <other>`).

This would replace the current step 1 (lines 404-416) and remove the "Do NOT guess or auto-select" guardrail.

Files to Modify

  • src/core/templates/skill-templates.ts — getContinueChangeSkillTemplate() function, lines 404-416. Update the change selection instructions to auto-select when only one active change exists.

Related Issues

  • #663 — Reports different /opsx-continue behavioral issues (agent not stopping between artifacts)
  • #673 — Requests a way to update artifacts without triggering continue

Both are related to the /opsx:continue workflow but address different aspects.

21st-connector avatar Feb 07 '26 17:02 21st-connector

Fix up in #1468: the continue/update/verify/sync/archive workflows now select a change the way /opsx:apply has since #513 — use the given name, infer from conversation context, auto-select when only one active change exists, and only prompt when it's genuinely ambiguous (always announcing "Using change: " with how to override). The templates' "Do NOT guess or auto-select" instruction was the cause of the stall you described.

clay-good avatar Jul 28 '26 01:07 clay-good