# LastNObservationsProcessor

**Kind:** Class

**Source:** [`atloria-monorepo/libs/agent-core/src/context/history-processors.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/libs/agent-core/src/context/history-processors.ts#L127)

Keeps the last N tool outputs in full detail.
Older ones are replaced with extractive summaries.

Directly extracted from the existing elideOldObservations() function
in autonomous-loop.ts — same logic, now composable.

SWE-agent default: n=5.

**Implements:** `HistoryProcessor`

## Methods

| Method | Signature | Returns |
|---|---|---|
| `process` | `process(items: AgentInputItem[])` | `AgentInputItem[]` |

## Properties

| Property | Type |
|---|---|
| `name` | `any` |

## Where it refuses work

- `LastNObservationsProcessor` stops the work with an early return when `outputIndices.length <= this.n`.
- `LastNObservationsProcessor` stops the work with an early return when `!indicesToElide.has(i)`.
