mirror of
https://github.com/stablyai/orca.git
synced 2026-11-04 02:57:36 +00:00
* Add native chat hand-off menu on main * Fix saved chat hand-off observations and RPC exports * Reuse indexed chat tabs for hand-off subscriptions * Match saved-chat clear fixture to current journal API
11 lines
395 B
TypeScript
11 lines
395 B
TypeScript
const MAX_CONTEXT_CHARS = 36_000
|
|
|
|
export function trimAgentSessionContext(value: string, source = 'terminal output'): string {
|
|
if (value.length <= MAX_CONTEXT_CHARS) {
|
|
return value
|
|
}
|
|
const omitted = value.length - MAX_CONTEXT_CHARS
|
|
const marker = `\n\n[Earlier ${source} omitted: ${omitted} characters]\n\n`
|
|
return `${marker}${value.slice(-(MAX_CONTEXT_CHARS - marker.length))}`
|
|
}
|