Fission-AI/OpenSpec · error · StoreError

workset_open_json_unsupported

workset_open_json_unsupported

Error message

workset open hands this terminal to the chosen tool and has no JSON mode.

What it means

Mode guard in workset open: --json was requested, but open hands the terminal over to an external editor/tool process and therefore has no machine-readable output mode. Thrown before any tool launch so JSON callers fail fast.

Solutions

  1. Drop --json when running openspec workset open
  2. Use another workset subcommand if you need JSON output
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/commands/workset.ts:341 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Fission-AI/OpenSpec@6926ccb18a (2026-08-25). Data as JSON: /api/errors/4047afeac52670c3. Report an issue: GitHub.

Appendix: source

Thrown at src/commands/workset.ts:341

          workset.tool !== undefined
            ? `  (opens in ${findOpener(table, workset.tool)?.label ?? workset.tool})`
            : '';
        console.log(`${workset.name}${toolLabel}`);
        for (const row of formatMemberRows(workset.members)) {
          console.log(`  ${row}`);
        }
      }
    } catch (error) {
      emitFailure(options.json, { worksets: [], status: [] }, error, 'workset_error');
    }
  }

  async open(name: string, options: WorksetOpenOptions = {}): Promise<void> {
    let prepared: PreparedOpen | undefined;

    try {
      if (options.json) {
        throw new StoreError(
          'workset open hands this terminal to the chosen tool and has no JSON mode.',
          'workset_open_json_unsupported',
          {
            target: 'workset.tool',
            fix: 'Inspect worksets with: openspec workset list --json',
          }
        );
      }

      // Regenerate the derived file FIRST (under the lock), so every
      // cannot-drive failure below can name an existing, current file.
      prepared = await withWorksetsLock(async (state): Promise<PreparedOpen> => {
        const workset = getWorkset(state, name);
        if (workset === null) {
          throw worksetNotFoundError(name, state);
        }

        const checks = await Promise.all(

View on GitHub (pinned to 6926ccb18a)