{"record":{"id":"3986bd84bae4ba08","repo":"deepseek-ai/deepseek-harness","slug":"session-reference-budget-exceeded","errorCode":"SESSION_REFERENCE_BUDGET_EXCEEDED","errorMessage":"referenced session snapshot cannot fit the configured byte budget","messagePattern":"referenced session snapshot cannot fit the configured byte budget","errorType":"exception","errorClass":"SessionReferenceError","httpStatus":null,"severity":"error","filePath":"packages/context/session-reference/src/index.ts","lineNumber":293,"sourceCode":"        label: source.data.label,\n        capturedThroughSeq: source.data.capturedThroughSeq,\n        ...source.stats,\n        inputIndex: index,\n      })),\n    }\n    const additionalContext: UserMessage = createUserMessage({\n      source,\n      content: [{ type: 'text', text: prompt }],\n    })\n    return { content: acceptedContent, additionalContext }\n  }\n\n  private renderSources(sources: readonly PreparedSource[]): RenderedSource[] {\n    const rendered: RenderedSource[] = []\n    for (const source of sources) {\n      const retained = retainReferencedSession(source.snapshot, source.input.label, this.config.maxReferenceBytes)\n      if (retained === undefined) {\n        throw new SessionReferenceError(\n          'referenced session snapshot cannot fit the configured byte budget',\n          'SESSION_REFERENCE_BUDGET_EXCEEDED',\n        )\n      }\n      rendered.push(retained)\n    }\n    return rendered\n  }\n}\n\nfunction normalizeReferences(\n  targetId: SessionId,\n  references: readonly SessionReferenceInput[],\n  maxReferences: number,\n): Required<SessionReferenceInput>[] {\n  const seen = new Set<SessionId>()\n  const normalized: Required<SessionReferenceInput>[] = []\n  for (const candidate of references as readonly unknown[]) {","sourceCodeStart":275,"sourceCodeEnd":311,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/context/session-reference/src/index.ts#L275-L311","documentation":"Error \"referenced session snapshot cannot fit the configured byte budget\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/context/session-reference/src/index.ts:293 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Raise the configured byte budget or reference a smaller session snapshot."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}