t8y2/dbx · error · ValueError

unknown workload kind: {workload['kind']}

Error message

unknown workload kind: {workload['kind']}

What it means

execute_workload dispatches on workload['kind'], supporting exactly 'rpc' (single method call) and 'paged' (execute_query_page paging loop). Any other kind string raises ValueError. This guards against malformed workload definitions in the benchmark scenario file.

Source

Thrown at agents/drivers/hive-go/bench/agent_compare.py:491

    for _ in range(operations):
        started = time.perf_counter()
        execute_workload(process, workload, session_id)
        samples.append(elapsed_ms(started))
    return samples


def execute_workload(
    process: AgentProcess,
    workload: dict,
    agent_session_id: str = "",
) -> object:
    params = dict(workload.get("params", {}))
    if agent_session_id:
        params["agentSessionId"] = agent_session_id
    if workload["kind"] == "rpc":
        return process.call(workload["method"], params)
    if workload["kind"] != "paged":
        raise ValueError(f"unknown workload kind: {workload['kind']}")
    first = process.call(
        "execute_query_page",
        {
            "sql": workload["sql"],
            "maxRows": workload["max_rows"],
            "pageSize": workload["page_size"],
            **({"agentSessionId": agent_session_id} if agent_session_id else {}),
        },
    )
    rows = len(first.get("rows", []))
    session_id = first.get("session_id")
    has_more = first.get("has_more", False)
    try:
        while has_more:
            page = process.call(
                "fetch_query_page",
                {
                    "sessionId": session_id,

View on GitHub (pinned to c0390bff16)

Solutions

  1. Correct the workload 'kind' to exactly 'rpc' or 'paged'
  2. Check where the workload dict is generated and fix the kind value at the source
  3. Add/enable support in execute_workload if a new kind is genuinely needed

Example fix

// before
{"kind": "page", "sql": "SELECT ..."}
// after
{"kind": "paged", "sql": "SELECT ..."}
Defensive patterns

Strategy: validation

Validate before calling

def validate_workload(workload: dict) -> None:
    kind = workload.get("kind")
    if kind not in ("rpc", "paged"):
        raise SystemExit(
            f"workload kind must be 'rpc' or 'paged', got {kind!r}"
        )
for w in workloads:
    validate_workload(w)  # before starting any agents

Type guard

def is_supported_workload(workload: dict) -> bool:
    return workload.get("kind") in ("rpc", "paged")

Try / catch

try:
    rows = execute_workload(process, workload, ...)
except ValueError as e:
    if "unknown workload kind" in str(e):
        print(f"Fix scenario config: {e}")
        skip_workload(workload)
    else:
        raise

Prevention

When it happens

Trigger: A workload dict in the benchmark scenario whose 'kind' field is misspelled ('page', 'Paged', 'query') or set to an entirely unsupported value by a new/edited scenario definition.

Common situations: Hand-editing workload JSON/YAML and introducing a typo; adding a new workload kind to a config before the harness supports it; schema drift between scenario generator output and the harness.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05). Data as JSON: /api/errors/82f913d89b267f74. Report an issue: GitHub.