{"record":{"id":"8825434eb297eee5","repo":"t8y2/dbx","slug":"unknown-workload-kind-workload-kind","errorCode":null,"errorMessage":"unknown workload kind: {workload['kind']}","messagePattern":"unknown workload kind: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agents/drivers/argo-go/bench/agent_compare.py","lineNumber":491,"sourceCode":"    for _ in range(operations):\n        started = time.perf_counter()\n        execute_workload(process, workload, session_id)\n        samples.append(elapsed_ms(started))\n    return samples\n\n\ndef execute_workload(\n    process: AgentProcess,\n    workload: dict,\n    agent_session_id: str = \"\",\n) -> object:\n    params = dict(workload.get(\"params\", {}))\n    if agent_session_id:\n        params[\"agentSessionId\"] = agent_session_id\n    if workload[\"kind\"] == \"rpc\":\n        return process.call(workload[\"method\"], params)\n    if workload[\"kind\"] != \"paged\":\n        raise ValueError(f\"unknown workload kind: {workload['kind']}\")\n    first = process.call(\n        \"execute_query_page\",\n        {\n            \"sql\": workload[\"sql\"],\n            \"maxRows\": workload[\"max_rows\"],\n            \"pageSize\": workload[\"page_size\"],\n            **({\"agentSessionId\": agent_session_id} if agent_session_id else {}),\n        },\n    )\n    rows = len(first.get(\"rows\", []))\n    session_id = first.get(\"session_id\")\n    has_more = first.get(\"has_more\", False)\n    try:\n        while has_more:\n            page = process.call(\n                \"fetch_query_page\",\n                {\n                    \"sessionId\": session_id,","sourceCodeStart":473,"sourceCodeEnd":509,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/argo-go/bench/agent_compare.py#L473-L509","documentation":"execute_workload only understands workload kinds \"rpc\" and \"paged\"; anything else raises ValueError with the unknown kind. It is a strict enum-style validation on the workload dict produced by configured_workloads.","triggerScenarios":"A workload dict whose `kind` is neither \"rpc\" nor \"paged\" reaches execute_workload — via benchmark_workload, benchmark_concurrency, or concurrency_worker — typically from a hand-edited workload config or a new kind added in config without a handler in execute_workload.","commonSituations":"Typo like \"page\" or \"Paged\" (case-sensitive check); user added a new workload kind (e.g. \"stream\") in config but only edited the config, not the dispatcher; older workload JSON format migrated incorrectly.","solutions":["Change the workload's `kind` in the config to \"rpc\" or \"paged\"","Fix casing/typo — the comparison is exact and case-sensitive","If a new kind is needed, add an explicit branch in execute_workload implementing it","Add validation in configured_workloads so bad kinds are rejected with a list of valid kinds"],"exampleFix":"// before\n{\"kind\": \"page\", \"sql\": \"SELECT ...\"}\n// after\n{\"kind\": \"paged\", \"sql\": \"SELECT ...\", \"max_rows\": 1000, \"page_size\": 100}","handlingStrategy":"validation","validationCode":"VALID_KINDS = {\"rpc\", \"paged\"}\nfor w in workloads:\n    if w.get(\"kind\") not in VALID_KINDS:\n        raise ValueError(f\"{w.get('kind')!r} not in {sorted(VALID_KINDS)}\")","typeGuard":"def is_valid_workload(w: dict) -> bool:\n    return w.get(\"kind\") in (\"rpc\", \"paged\")","tryCatchPattern":"try:\n    rows = execute_workload(process, workload, agent_session_id)\nexcept ValueError as e:\n    if str(e).startswith(\"unknown workload kind\"):\n        print(f\"skipping workload: {e}\")\n    else:\n        raise","preventionTips":["Only use \"rpc\" or \"paged\" as workload kinds in configs","Mind exact lowercase spelling — no \"Paged\" or \"page\"","When adding a new kind, update execute_workload's dispatcher, not just the config","Validate workload JSON at load time with a schema check"],"tags":["validation","configuration","enum"],"backgroundTag":"invalid-enum-value","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}