fix(session): simplify reference byte limits

This commit is contained in:
Yichen Jiang
2026-07-21 20:16:18 +08:00
parent f03b01d8bc
commit 8c6e28cef8
10 changed files with 85 additions and 67 deletions
@@ -1,24 +1,20 @@
/** Configuration and stable diagnostics for session references. */
/** Default maximum references accepted by one message. */
export const DEFAULT_MAX_REFERENCES = 3
/** Hard maximum references accepted by one message. */
export const MAX_REFERENCES = 3
/** Default number of discovery candidates returned to a host. */
export const DEFAULT_CANDIDATE_LIMIT = 50
/** Default UTF-8 budget for one rendered reference JSON object. */
export const DEFAULT_MAX_REFERENCE_BYTES = 65_536
/** Default UTF-8 budget for the complete injected reference prompt. */
export const DEFAULT_MAX_TOTAL_BYTES = 196_608
/** Session-reference service configuration. */
export interface Config {
/** Maximum distinct source sessions referenced by one message. */
/** Maximum distinct source sessions referenced by one message, from one to three. */
maxReferences?: number
/** Default host candidate-list limit. */
candidateLimit?: number
/** Maximum rendered UTF-8 bytes for one source snapshot. */
maxReferenceBytes?: number
/** Maximum rendered UTF-8 bytes for the complete injected prompt. */
maxTotalBytes?: number
}
/** Stable failure codes exposed to host adapters. */