Files
orca/src/shared/agent-session-compaction.ts
T
Brennan Benson f16212a29c feat(acp): compact Grok, OpenCode and OMP chats (#26502)
* feat(acp): compact Grok, OpenCode and OMP chats

* test(acp): expect Grok compaction capability

* fix(chat): keep skipped compaction outcomes visible across history pages

* fix(acp): a signed-out /compact reports not signed in, as a send does

A /compact the agent refused for sign-in now records the same notSignedIn
fact as an ordinary send, so the chat shows sign-in guidance and the next
send starts a new agent that reads the new login.

* refactor(acp): keep the timeline translator under its line limit after main's growth

Main's OMP per-channel message identity grew acp-timeline-translator.ts past
max-lines with this PR's compaction handling. The running compaction's frame
folding moves beside its ending in acp-compaction-turn.ts, and the
compacting-prompt lookup into AcpPromptTurns; behaviour is unchanged.
2026-10-09 02:05:31 -07:00

16 lines
652 B
TypeScript

import { parseAgentJournalItemKey } from './agent-session-journal-item-key'
import { spelledProviderTimelineItemKey } from './provider-timeline-item-key'
export const AGENT_SESSION_COMPACTION_SKIPPED_PRESENTATION = 'compaction-skipped'
/** Older OMP outcomes carried their meaning in the host's reserved item identity. */
export function isAgentSessionLegacyCompactionResult(itemId: string): boolean {
const identity = parseAgentJournalItemKey(itemId)
return (
identity?.provider === 'legacy' &&
identity.agent === 'omp' &&
spelledProviderTimelineItemKey(identity.recordId)?.startsWith('compaction%3Acompact%3A') ===
true
)
}