You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Invoking /opsx-new in Factory Droid returns error #717
Running /opsx-new in Factory Droid agent returns error. First it returns:
ASK USER
Error: Invalid AskUser questionnaire format at line 1: Unexpected line. Expected [question], [topic], or
[option]. Remove headers or code fences.
Then directly another one:
ASK USER
Error: Invalid AskUser questionnaire format at line 1: [question] must have 2-10 [option] lines (got 0)
What I tried
Things I tried, but didn't help:
removing all commands, skills and rerunning openspec init
The enrichment comment has been posted on issue #717. Here's a summary of the findings:
Root cause: The Factory Droid adapter (src/core/command-generation/adapters/factory.ts) passes command body content through without any transformation. The command templates contain natural-language instructions like Use the **AskUserQuestion tool**..., but Factory Droid has its own native AskUser parser that expects a bracket-based format ([question], [option], [topic]). When the AI agent tries to ask the user a question, Factory Droid's parser fails because it receives markdown text instead of its bracket syntax.
Key issue: Open-ended questions (no preset options) are fundamentally incompatible with Factory Droid's questionnaire model, which requires 2-10 [option] lines per [question].
Scope: This likely affects all 8 workflow commands that reference AskUserQuestion, not just /opsx-new.
The comment includes specific file references, potential fix approaches, and links to related issues (#232, #259).
The error originates from Factory Droid's own AskUser parser, which expects a bracket-based questionnaire format ([question], [option], [topic]), but the generated command file contains a natural-language instruction to use the AskUserQuestion tool instead.
When Factory Droid encounters Step 1 of the /opsx-new command, the AI agent attempts to invoke Factory Droid's native ASK USER feature. Factory Droid then tries to parse the agent's output as its own bracket-based questionnaire format and fails because the output doesn't conform.
What the template instructs the agent to do (in .factory/commands/opsx-new.md):
Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
> "What change do you want to work on? Describe what you want to build or fix."
What Factory Droid's parser expects:
[question]
What change do you want to work on?
[option]
Option A
[option]
Option B
The two error messages confirm this:
"Unexpected line. Expected [question], [topic], or [option]. Remove headers or code fences." — the parser received markdown-formatted text instead of bracket syntax
"[question] must have 2-10 [option] lines (got 0)" — no [option] lines were found because the format is completely different
This bug likely affects all commands that reference AskUserQuestion, not just /opsx-new. The following workflow templates contain AskUserQuestion references:
new-change.ts (/opsx-new)
continue-change.ts (/opsx-continue)
archive-change.ts (/opsx-archive)
ff-change.ts (/opsx-ff)
bulk-archive-change.ts (/opsx-bulk-archive)
verify-change.ts (/opsx-verify)
sync-specs.ts (/opsx-sync)
apply-change.ts (/opsx-apply)
Potential Approaches
Add a body transformation in the Factory adapter — Similar to how opencode.ts transforms command references, factory.ts could transform AskUserQuestion tool references into Factory Droid's native bracket-based [question]/[option] syntax. This keeps the templates tool-agnostic while making the output Factory Droid-compatible.
Remove or rephrase the AskUserQuestion instruction — Replace tool-specific references with more generic phrasing that doesn't trigger Factory Droid's AskUser parser (e.g., "Ask the user what they want to build"). This would be simpler but may reduce the quality of the interaction in tools that do support a structured AskUser tool.
Hybrid approach — Keep templates as-is but add a Factory-specific transformation utility (similar to transformToHyphenCommands) that converts AskUserQuestion references to Factory Droid's questionnaire format, or strips them if open-ended questions aren't supported in the bracket format (which requires 2-10 options).
The open-ended question format (no preset options) is particularly problematic because Factory Droid requires 2-10 [option] lines per [question]. An open-ended prompt with no options is fundamentally incompatible with Factory Droid's questionnaire model.
The $ARGUMENTS placeholder mentioned in the archived Factory Droid spec is not being injected into the command body, which may also contribute to the agent needing to ask the user for input rather than receiving it via arguments.
Activity
21st-connector commentedon Feb 17, 2026
Task completed.
The enrichment comment has been posted on issue #717. Here's a summary of the findings:
Root cause: The Factory Droid adapter (
src/core/command-generation/adapters/factory.ts) passes command body content through without any transformation. The command templates contain natural-language instructions likeUse the **AskUserQuestion tool**..., but Factory Droid has its own native AskUser parser that expects a bracket-based format ([question],[option],[topic]). When the AI agent tries to ask the user a question, Factory Droid's parser fails because it receives markdown text instead of its bracket syntax.Key issue: Open-ended questions (no preset options) are fundamentally incompatible with Factory Droid's questionnaire model, which requires 2-10
[option]lines per[question].Scope: This likely affects all 8 workflow commands that reference AskUserQuestion, not just
/opsx-new.The comment includes specific file references, potential fix approaches, and links to related issues (#232, #259).
View full conversation
Powered by 1Code
21st-connector commentedon Feb 17, 2026
Issue Analysis
Root Cause
The error originates from Factory Droid's own AskUser parser, which expects a bracket-based questionnaire format (
[question],[option],[topic]), but the generated command file contains a natural-language instruction to use theAskUserQuestion toolinstead.When Factory Droid encounters Step 1 of the
/opsx-newcommand, the AI agent attempts to invoke Factory Droid's nativeASK USERfeature. Factory Droid then tries to parse the agent's output as its own bracket-based questionnaire format and fails because the output doesn't conform.What the template instructs the agent to do (in
.factory/commands/opsx-new.md):What Factory Droid's parser expects:
The two error messages confirm this:
"Unexpected line. Expected [question], [topic], or [option]. Remove headers or code fences."— the parser received markdown-formatted text instead of bracket syntax"[question] must have 2-10 [option] lines (got 0)"— no[option]lines were found because the format is completely differentRelevant Code
src/core/command-generation/adapters/factory.ts:22-29— passescontent.bodythrough without any transformationsrc/core/templates/workflows/new-change.ts:96-97— the natural-language instruction that Factory Droid can't interpretsrc/core/shared/skill-generation.ts:95—body: template.contentmaps template content directly to command bodysrc/core/command-generation/generator.ts:21—adapter.formatFile(content)passes content to adapter without shared transformationsrc/core/command-generation/adapters/opencode.ts:23-26— appliestransformToHyphenCommands()to the body, showing that per-adapter body transformation is an established patternAffected Commands
This bug likely affects all commands that reference AskUserQuestion, not just
/opsx-new. The following workflow templates containAskUserQuestionreferences:new-change.ts(/opsx-new)continue-change.ts(/opsx-continue)archive-change.ts(/opsx-archive)ff-change.ts(/opsx-ff)bulk-archive-change.ts(/opsx-bulk-archive)verify-change.ts(/opsx-verify)sync-specs.ts(/opsx-sync)apply-change.ts(/opsx-apply)Potential Approaches
Add a body transformation in the Factory adapter — Similar to how
opencode.tstransforms command references,factory.tscould transformAskUserQuestion toolreferences into Factory Droid's native bracket-based[question]/[option]syntax. This keeps the templates tool-agnostic while making the output Factory Droid-compatible.Remove or rephrase the AskUserQuestion instruction — Replace tool-specific references with more generic phrasing that doesn't trigger Factory Droid's AskUser parser (e.g., "Ask the user what they want to build"). This would be simpler but may reduce the quality of the interaction in tools that do support a structured AskUser tool.
Hybrid approach — Keep templates as-is but add a Factory-specific transformation utility (similar to
transformToHyphenCommands) that converts AskUserQuestion references to Factory Droid's questionnaire format, or strips them if open-ended questions aren't supported in the bracket format (which requires 2-10 options).Related Issues
Additional Notes
no preset options) is particularly problematic because Factory Droid requires 2-10[option]lines per[question]. An open-ended prompt with no options is fundamentally incompatible with Factory Droid's questionnaire model.$ARGUMENTSplaceholder mentioned in the archived Factory Droid spec is not being injected into the command body, which may also contribute to the agent needing to ask the user for input rather than receiving it via arguments.fix(templates): replace Claude-only AskUserQuestion instruction with …