usestrix/strix · error · ValueError

scope_id and scope_name required for update

Error message

scope_id and scope_name required for update

What it means

For action='update' the Caido scope dispatcher requires both scope_id (which scope to update) and scope_name (the new name); missing either raises ValueError. Update is a full identification of the target plus its replacement name, not a partial patch selector.

Source

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

) -> Any:
    if action == "list":
        result = await scope_list(client)
    elif action == "get":
        if not scope_id:
            raise ValueError("scope_id required for get")
        result = await scope_get(client, scope_id)
    elif action == "create":
        if not scope_name:
            raise ValueError("scope_name required for create")
        result = await scope_create(
            client,
            name=scope_name,
            allowlist=allowlist,
            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 = """

View on GitHub (pinned to 8551339130)

Solutions

  1. Run action='list' to resolve the scope's id.
  2. Call action='update' with both scope_id and the new scope_name (plus allowlist/denylist if changing filters).
  3. If you only wanted filter changes, still supply scope_name — pass the existing name unchanged.

Example fix

# before
scope(client, "update", scope_id=sid, allowlist=[...])

# after
scope(client, "update", scope_id=sid, scope_name="target", allowlist=[...])
Defensive patterns

Strategy: validation

Validate before calling

def scope_id_by_name(client, name: str) -> str:
    for s in scope(client, "list"):
        if s.get("name") == name:
            return s["id"]
    raise LookupError(name)

sid = scope_id_by_name(client, current_name)
scope(client, "update", scope_id=sid, scope_name=new_name, allowlist=al)

Try / catch

try:
    scope(client, "update", scope_id=sid, scope_name=name, allowlist=al)
except ValueError as exc:
    if "required for update" in str(exc):
        sid = scope_id_by_name(client, name)
        scope(client, "update", scope_id=sid, scope_name=name, allowlist=al)
    else:
        raise

Prevention

When it happens

Trigger: Calling action='update' with only scope_id (renaming assumed implicit) or only scope_name (target assumed inferred). Both fields must be present and non-empty.

Common situations: Agent or script reuses the create-style call for updates; caller tries to update filters by name without knowing the id; empty string from an env/variable expansion.

Related errors


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