{"record":{"id":"901a7c3f4c3675f0","repo":"JuliusBrussee/caveman","slug":"cachebench-session-q-request-d-w","errorCode":null,"errorMessage":"cachebench: session %q request %d: %w","messagePattern":"cachebench: session %q request (.+?): %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cachebench/corpus.go","lineNumber":644,"sourceCode":"\t}\n\treturn prefix, nil\n}\n\nfunc buildCorpusTrace(provider ProviderConfig, corpus AgentCorpus, counter *corpusTokenCounter) (Trace, error) {\n\tstarted := time.Date(2026, 8, 10, 0, 0, 0, 0, time.UTC)\n\trequests := make([]TraceRequest, 0, len(corpus.Rows))\n\trequestNumber := map[string]int{}\n\telapsed := map[string]time.Duration{}\n\tepochVersion := map[string]int{}\n\tstableIdentity := map[string]string{}\n\tfor _, row := range corpus.Rows {\n\t\trequestNumber[row.SessionID]++\n\t\tif requestNumber[row.SessionID] > 1 {\n\t\t\telapsed[row.SessionID] += time.Duration(row.PreGap * float64(time.Second))\n\t\t}\n\t\tbody, err := corpusProviderBody(provider, row.Input)\n\t\tif err != nil {\n\t\t\treturn Trace{}, fmt.Errorf(\"cachebench: session %q request %d: %w\", row.SessionID, requestNumber[row.SessionID], err)\n\t\t}\n\t\tprefix, err := corpusPrefix(row.Input, counter)\n\t\tif err != nil {\n\t\t\treturn Trace{}, err\n\t\t}\n\t\tstableCount := 0\n\t\tfor _, message := range row.Input {\n\t\t\tif message.Role != \"system\" && message.Role != \"developer\" {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tstableCount++\n\t\t}\n\t\tidentity, identityErr := corpusStableIdentity(row.Input, stableCount)\n\t\tif identityErr != nil {\n\t\t\treturn Trace{}, identityErr\n\t\t}\n\t\tif epochVersion[row.SessionID] == 0 {\n\t\t\tepochVersion[row.SessionID] = 1","sourceCodeStart":626,"sourceCodeEnd":662,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/cacheengine/cachebench/corpus.go#L626-L662","documentation":"Wrap in buildCorpusTrace: building the provider request body for the given session/request number failed (schema/shape error from the wrapped call). The interpolated session id and request number locate the offending corpus row.","triggerScenarios":"Thrown at cacheengine/cachebench/corpus.go:644 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped error and the cited request's messages","Regenerate the corpus row that produced the failing request"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"766dce6b1394ebb56a3090748d5a0240a5aefb36","analyzedAt":"2026-08-18T03:14:35.516Z","contentChangedAt":"2026-08-18T03:14:35.516Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}