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
openspec config set workflows '[...]' fails — config set cannot set the array-typed workflows key #1216
There is no way to set the array-typed workflows config key via openspec config set. Any value is treated as a string and rejected by schema validation, so switching to the custom profile non-interactively is impossible — even though config set advertises "auto-coerce types" and workflows is a known top-level key.
Environment
OpenSpec CLI: 1.4.1 (latest from npm @fission-ai/openspec)
Node: >= 20
OS: Linux
Scenario: switching the global profile from core to custom to enable new / ff workflows
Steps to reproduce
openspec config set profile custom # OK
openspec config set workflows '["new","ff","apply","archive"]'
profile is now left as custom while workflows is unset, so getProfileWorkflows('custom', undefined) resolves to [] (zero workflows). If openspec update runs in this state, the project loses all /opsx:* commands and skills.
Expected result
The value should be parsed as an array and stored, configuring the custom profile non-interactively (e.g. workflows: ["new","ff","apply","archive"]).
Root cause
coerceValue (core/config-schema.js) only coerces boolean, number, or string:
exportfunctioncoerceValue(value,forceString=false){if(forceString)returnvalue;if(value==='true')returntrue;if(value==='false')returnfalse;constnum=Number(value);if(!isNaN(num)&&isFinite(num)&&value.trim()!=='')returnnum;returnvalue;// arrays / JSON fall through as a raw string}
workflows is declared as z.array(z.string()) in GlobalConfigSchema and is the only array-typed settable key. Because coerceValue never produces an array, config set workflows ... always fails Zod validation, despite workflows being present in KNOWN_TOP_LEVEL_KEYS and the command help reading "Set a value (auto-coerce types)".
Workarounds
Interactive picker: openspec config profile (no preset argument).
Hand-edit ~/.config/openspec/config.json and add the workflows array manually.
Suggested fix
JSON-parse values for array/object-typed keys in config set (e.g. attempt JSON.parse and fall back to the current string coercion), or
add an explicit --json flag / a repeatable --append <workflow> form for list keys, and/or
document that workflows cannot be set via config set and must go through the interactive openspec config profile picker.
Activity
Parse config JSON containers (Fission-AI#1216)
Parse config JSON containers (Fission-AI#1216) (Fission-AI#1244)
Parse config JSON containers (Fission-AI#1216) (Fission-AI#1244)
Parse config JSON containers (Fission-AI#1216) (Fission-AI#1244)