{"record":{"id":"82f913d89b267f74","repo":"t8y2/dbx","slug":"unknown-workload-kind-workload-kind-82f913","errorCode":null,"errorMessage":"unknown workload kind: {workload['kind']}","messagePattern":"unknown workload kind: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agents/drivers/hive-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/hive-go/bench/agent_compare.py#L473-L509","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Correct the workload 'kind' to exactly 'rpc' or 'paged'","Check where the workload dict is generated and fix the kind value at the source","Add/enable support in execute_workload if a new kind is genuinely needed"],"exampleFix":"// before\n{\"kind\": \"page\", \"sql\": \"SELECT ...\"}\n// after\n{\"kind\": \"paged\", \"sql\": \"SELECT ...\"}","handlingStrategy":"validation","validationCode":"def validate_workload(workload: dict) -> None:\n    kind = workload.get(\"kind\")\n    if kind not in (\"rpc\", \"paged\"):\n        raise SystemExit(\n            f\"workload kind must be 'rpc' or 'paged', got {kind!r}\"\n        )\nfor w in workloads:\n    validate_workload(w)  # before starting any agents","typeGuard":"def is_supported_workload(workload: dict) -> bool:\n    return workload.get(\"kind\") in (\"rpc\", \"paged\")","tryCatchPattern":"try:\n    rows = execute_workload(process, workload, ...)\nexcept ValueError as e:\n    if \"unknown workload kind\" in str(e):\n        print(f\"Fix scenario config: {e}\")\n        skip_workload(workload)\n    else:\n        raise","preventionTips":["Keep workload scenario schemas versioned and validated (jsonschema) pre-run","Use constants/enums for 'kind' instead of hand-typed strings","Lint scenario files in CI before expensive benchmark runs","Update the harness and scenario generators together when adding kinds"],"tags":["python","validation","benchmark-config","dispatch"],"backgroundTag":"invalid-config-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"}