Kind: Class
Source: atloria-monorepo/libs/agent-core/src/context/model-compactor.ts
Methods
| Method | Signature | Returns |
|---|---|---|
compact | compact(items: unknown[]) | Promise<string> |
getSummary | getSummary() | `CompactionSummary |
setSummary | setSummary(summary: CompactionSummary) | void |
getEvents | getEvents() | readonly CompactionEvent[] |
formatSummaryForContext | formatSummaryForContext() | string |
hasPendingCompaction | hasPendingCompaction() | boolean |
flush | flush() | Promise<void> |
reset | reset() | void |
Where it refuses work
ModelCompactorstops the work withErrorwhen!content— “Compaction model returned empty content”.ModelCompactorstops the work withErrorwhen!parsed.sessionGoal && typeof parsed.sessionGoal !== 'string'— “Invalid compaction summary: missing sessionGoal”.ModelCompactorstops the work withErrorwhen!parsed.progress || typeof parsed.progress !== 'object'— “Invalid compaction summary: missing progress”.ModelCompactorstops the work with an early return whenhistoryText.length < 100.ModelCompactorstops the work with an early return when!this.currentSummary.ModelCompactorstops the work with an early return whenthis.config.useV1Endpoint.
When something fails
ModelCompactorhandles failure in 1 place: it logs it and continues in all 1.
Was this page helpful?