deepseek-ai/deepseek-harness · error · SessionReferenceError
SESSION_REFERENCE_INVALID_CONFIG
SESSION_REFERENCE_INVALID_CONFIG
Error message
session-reference: ${name} must be a positive safe integer What it means
Error "session-reference: ${name} must be a positive safe integer" thrown in deepseek-ai/deepseek-harness.
Source
Thrown at packages/context/session-reference/src/index.ts:94
static inject = ['sessionQuery']
static Config: z<Config> = z.object({
maxReferences: z.number().step(1).min(1).max(MAX_REFERENCES).default(MAX_REFERENCES),
candidateLimit: z.number().step(1).min(1).default(DEFAULT_CANDIDATE_LIMIT),
maxReferenceBytes: z.number().step(1).min(1).default(DEFAULT_MAX_REFERENCE_BYTES),
})
private readonly config: Required<Config>
constructor(ctx: Context, config: Config = {}) {
super(ctx, 'sessionReferenceResolver')
this.config = {
maxReferences: config.maxReferences ?? MAX_REFERENCES,
candidateLimit: config.candidateLimit ?? DEFAULT_CANDIDATE_LIMIT,
maxReferenceBytes: config.maxReferenceBytes ?? DEFAULT_MAX_REFERENCE_BYTES,
}
for (const [name, value] of Object.entries(this.config)) {
if (!Number.isSafeInteger(value) || value <= 0) {
throw new SessionReferenceError(
`session-reference: ${name} must be a positive safe integer`,
'SESSION_REFERENCE_INVALID_CONFIG',
)
}
}
if (this.config.maxReferences > MAX_REFERENCES) {
throw new SessionReferenceError(
`session-reference: maxReferences must not exceed ${MAX_REFERENCES}`,
'SESSION_REFERENCE_INVALID_CONFIG',
)
}
ctx.on('agent/pre-step', async ({ agent, signal }, next): Promise<PreStepDecision> => {
const decision = await next()
if (decision.kind === 'reject') return decision
return {
kind: 'enter',
messages: await this.prepareDirectMessages(agent, decision.messages, signal),
}View on GitHub (pinned to b150a551b8)
Solutions
- Set the named config value to a positive safe integer.
When it happens
Trigger: Thrown at packages/context/session-reference/src/index.ts:94 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24).
Data as JSON: /api/errors/229afbb2e6891bb5.
Report an issue: GitHub.