{"record":{"id":"dda28c7c566d880e","repo":"earendil-works/pi","slug":"invalid-payload","errorCode":"invalid_payload","errorMessage":"Session id must be non-empty, contain only alphanumeric characters, '-', '_', and '.', and start and end with an alphanumeric character","messagePattern":"Session id must be non-empty, contain only alphanumeric characters, '-', '_', and '\\.', and start and end with an alphanumeric character","errorType":"validation","errorClass":"SessionError","httpStatus":null,"severity":"error","filePath":"packages/agent/src/harness/session/jsonl/repo.ts","lineNumber":20,"sourceCode":"import { assertJsonSerializable, Session } from \"../session.ts\";\nimport { type ForkOptions, SessionError, type SessionRepo } from \"../types.ts\";\nimport { metadataFromHeader, parseHeader } from \"./codec.ts\";\nimport { fileResult } from \"./errors.ts\";\nimport { JsonlSessionStorage } from \"./storage.ts\";\nimport type {\n\tJsonlSessionCreateOptions,\n\tJsonlSessionListOptions,\n\tJsonlSessionMetadata,\n\tJsonlSessionRepoFileSystem,\n\tJsonlSessionRepoOptions,\n\tJsonlV4Header,\n} from \"./types.ts\";\n\nconst SESSION_ID_PATTERN = /^[A-Za-z0-9](?:[A-Za-z0-9._-]*[A-Za-z0-9])?$/;\n\nfunction validateSessionId(id: string): void {\n\tif (!SESSION_ID_PATTERN.test(id)) {\n\t\tthrow new SessionError(\n\t\t\t\"invalid_payload\",\n\t\t\t\"Session id must be non-empty, contain only alphanumeric characters, '-', '_', and '.', and start and end with an alphanumeric character\",\n\t\t);\n\t}\n}\n\nfunction jsonlSessionDirectoryName(cwd: string): string {\n\treturn `--${cwd.replace(/^[/\\\\]/, \"\").replace(/[/\\\\:]/g, \"-\")}--`;\n}\n\nasync function jsonlSessionsRoot(options: JsonlSessionRepoOptions): Promise<string> {\n\treturn fileResult(\n\t\tawait options.fs.absolutePath(options.sessionsRoot),\n\t\t`Failed to resolve sessions root ${options.sessionsRoot}`,\n\t);\n}\n\nasync function jsonlSessionDirectory(","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/agent/src/harness/session/jsonl/repo.ts#L2-L38","documentation":"Error \"Session id must be non-empty, contain only alphanumeric characters, '-', '_', and '.', and start and end with an alphanumeric character\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/agent/src/harness/session/jsonl/repo.ts:20 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a session id that starts and ends with an alphanumeric character and contains only alphanumerics, dash, underscore, and dot."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4af9d21d3b4d664e4a29fcabfec85171077248e3","analyzedAt":"2026-08-24T13:07:14.692Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}