stablyai/orca · error · RuntimeClientError

linear_invalid_workspace

linear_invalid_workspace

Error message

--workspace all is not valid for issue

What it means

Thrown by the Linear issue-fetch request builder when `--workspace all` is supplied while targeting a single issue. A specific Linear issue lives in exactly one workspace, so the 'all workspaces' scope (valid for listing/searching across workspaces) is meaningless for issue retrieval. The builder rejects it early so the request never reaches the Linear API.

Source

Thrown at src/cli/linear-request-builders.ts:140

    comments: full || flags.get('comments') === true,
    children: full || flags.get('children') === true,
    attachments: full || flags.get('attachments') === true,
    relations: full || flags.get('relations') === true,
    activity: full || flags.get('activity') === true
  }
  if (flags.has('depth') && !includes.children) {
    throw new RuntimeClientError('invalid_argument', '--depth requires --children or --full')
  }
  const requestedDepth = getOptionalNonNegativeIntegerFlag(flags, 'depth')
  if (requestedDepth !== undefined && requestedDepth > LINEAR_CHILDREN_MAX_DEPTH) {
    throw new RuntimeClientError(
      'invalid_argument',
      `--depth must be at most ${LINEAR_CHILDREN_MAX_DEPTH}`
    )
  }
  const workspaceId = getOptionalStringFlag(flags, 'workspace')
  if (workspaceId === 'all') {
    throw new RuntimeClientError(
      'linear_invalid_workspace',
      '--workspace all is not valid for issue'
    )
  }
  const input = getOptionalStringFlag(flags, 'id')
  return {
    input,
    current: input ? false : flags.get('current') === true,
    workspaceId,
    include: includes,
    depth: clampLinearIssueDepth(requestedDepth),
    context: buildLinearCurrentContext(cwd, remote)
  }
}

export function buildWriteTargetRequest(
  flags: Map<string, string | boolean>,
  cwd: string,

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Drop `--workspace all` from the issue command; a single issue is already workspace-scoped by its ID prefix.
  2. If you need a different workspace, pass a concrete workspace id: `--workspace <team-or-workspace-id>`.
  3. If you genuinely want issues across all workspaces, use `linear list` or `linear search` instead of `linear issue`.

Example fix

// before
linear issue LIN-123 --workspace all
// after
linear issue LIN-123
Defensive patterns

Strategy: validation

Validate before calling

// before calling the issue builder
const workspace = flags.get('workspace')
if (commandIsSingleIssueFetch && workspace === 'all') {
  flags.delete('workspace') // or throw your own preflight error
}
// or assert at the shell layer:
// if [[ "$CMD" == "issue" && "$WORKSPACE" == "all" ]]; then exit 2; fi

Type guard

function isAcceptableIssueWorkspace(ws: string | undefined): boolean {
  return ws === undefined || ws !== 'all'
}

Prevention

When it happens

Trigger: Calling `linear issue <id> --workspace all`, or combining `--current` with `--workspace all` when the command resolves to a single issue. Any code path that funnels through buildSingleIssueRequest (or equivalent) with workspaceId === 'all' triggers it at src/cli/linear-request-builders.ts:140.

Common situations: Copy-pasting a `--workspace all` flag from a successful `linear list`/`linear search` invocation into an `linear issue` command. Scripts that set `--workspace all` globally for all Linear subcommands. Aliases or shell wrappers that inject workspace defaults.

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/22cfbc4e3665b5ff. Report an issue: GitHub.