{"record":{"id":"8c477b03fb2bd905","repo":"NousResearch/hermes-agent","slug":"value-too-large-max-max-value-bytes-bytes-per-k","errorCode":null,"errorMessage":"value too large (max {MAX_VALUE_BYTES} bytes per key)","messagePattern":"value too large \\(max (.+?) bytes per key\\)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"cron/notepad.py","lineNumber":89,"sourceCode":"    with _lock:\n        conn = _connect()\n        try:\n            _initialize_schema(conn)\n            with conn:\n                yield conn\n        finally:\n            conn.close()\n\n\ndef _validate(job_id: str, key: str, value: str) -> None:\n    if not str(job_id):\n        raise ValueError(\"job_id must be non-empty\")\n    if not key:\n        raise ValueError(\"key must be non-empty\")\n    if len(key) > MAX_KEY_CHARS:\n        raise ValueError(f\"key too long (max {MAX_KEY_CHARS} characters)\")\n    if len(value.encode(\"utf-8\")) > MAX_VALUE_BYTES:\n        raise ValueError(\n            f\"value too large (max {MAX_VALUE_BYTES} bytes per key)\"\n        )\n\n\ndef set_note(job_id: str, key: str, value: str) -> Dict[str, Any]:\n    \"\"\"Upsert one key. Raises ValueError when a size cap would be exceeded.\"\"\"\n    job_id, key, value = str(job_id), str(key), str(value)\n    _validate(job_id, key, value)\n    now = _hermes_now().isoformat()\n    with _transaction() as conn:\n        row = conn.execute(\n            \"\"\"SELECT COALESCE(SUM(LENGTH(CAST(key AS BLOB))\n                 + LENGTH(CAST(value AS BLOB))), 0)\n               FROM cron_notepad WHERE job_id=? AND key<>?\"\"\",\n            (job_id, key),\n        ).fetchone()\n        other_bytes = int(row[0])\n        entry_bytes = len(key.encode(\"utf-8\")) + len(value.encode(\"utf-8\"))","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/cron/notepad.py#L71-L107","documentation":"Error \"value too large (max {MAX_VALUE_BYTES} bytes per key)\" thrown in NousResearch/hermes-agent.","triggerScenarios":"Thrown at cron/notepad.py:89 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce the value size below the per-key byte cap, or split it across keys."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c896c09c42910c584c4c7d2325b58c14713ea42c","analyzedAt":"2026-08-14T17:18:01.089Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}