usestrix/strix · error · ValueError

Unknown action: {action}

Error message

Unknown action: {action}

What it means

The Caido scope dispatcher ends in an else branch: any action string other than list/get/create/update/delete raises ValueError('Unknown action: {action}'). Valid ScopeAction values are fixed; the dispatcher has no passthrough or default behavior.

Source

Thrown at strix/tools/proxy/caido_api.py:542

            denylist=denylist,
        )
    elif action == "update":
        if not scope_id or not scope_name:
            raise ValueError("scope_id and scope_name required for update")
        result = await scope_update(
            client,
            scope_id,
            name=scope_name,
            allowlist=allowlist,
            denylist=denylist,
        )
    elif action == "delete":
        if not scope_id:
            raise ValueError("scope_id required for delete")
        await scope_delete(client, scope_id)
        result = {"deleted": scope_id}
    else:
        raise ValueError(f"Unknown action: {action}")
    return result


_SITEMAP_ROOTS_QUERY = """
query GetSitemapRoots($scopeId: ID) {
    sitemapRootEntries(scopeId: $scopeId) {
        edges { node {
            id kind label hasDescendants
            metadata { ... on SitemapEntryMetadataDomain { isTls port } }
            request { method path response { statusCode } }
        } }
        count { value }
    }
}
"""

_SITEMAP_DESCENDANTS_QUERY = """
query GetSitemapDescendants($parentId: ID!, $depth: SitemapDescendantsDepth!) {

View on GitHub (pinned to 8551339130)

Solutions

  1. Use one of the five supported actions exactly: list, get, create, update, delete (lowercase).
  2. Check the tool's schema/signature for the action enum in your Strix version.
  3. If an LLM produced the call, constrain the action parameter in the prompt/tool schema to the valid set.

Example fix

# before
scope(client, "remove", scope_id=sid)

# after
scope(client, "delete", scope_id=sid)
Defensive patterns

Strategy: type-guard

Validate before calling

SCOPE_ACTIONS = frozenset({"list", "get", "create", "update", "delete"})

def is_valid_scope_action(action: str) -> bool:
    return action in SCOPE_ACTIONS

if not is_valid_scope_action(action):
    raise ValueError(f"action must be one of {sorted(SCOPE_ACTIONS)}")

Type guard

from typing import Literal
ScopeAction = Literal["list", "get", "create", "update", "delete"]

def is_scope_action(a: object) -> bool:
    return isinstance(a, str) and a in {"list", "get", "create", "update", "delete"}

Try / catch

try:
    scope(client, action, **kwargs)
except ValueError as exc:
    if "Unknown action" in str(exc):
        action = ACTION_ALIASES.get(action, action)  # e.g. remove->delete
        scope(client, action, **kwargs)
    else:
        raise

Prevention

When it happens

Trigger: Calling the scope handler with action='remove', 'fetch', 'GET' (case mismatch), or any other unlisted verb. Usually a typo or assumption that more actions exist.

Common situations: LLM agent inventing an action name; casing differences ('List' vs 'list'); version drift where a docs page mentions an action this Strix version doesn't implement.

Related errors


AI-assisted analysis of usestrix/strix@8551339130 (2026-08-15). Data as JSON: /api/errors/d8500f8478972fa1. Report an issue: GitHub.