# ClosedWindowProcessor

**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#L169)

Deduplicates file views — keeps only the most recent read of each file.
Older reads of the same file are replaced with a pointer.

Inspired by SWE-agent's ClosedWindowProcessor pattern.

Targets tools that read files: read_file, glob_search, grep_search.
Identifies the file path from tool input, and for duplicate paths,
replaces older outputs with "[Outdated — re-read in a later turn]".

**Implements:** `HistoryProcessor`

## Methods

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

## Properties

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

## Where it refuses work

- `ClosedWindowProcessor` stops the work with an early return when `indicesToElide.size === 0`.
- `ClosedWindowProcessor` stops the work with an early return when `!indicesToElide.has(i)`.
- `ClosedWindowProcessor` stops the work with an early return when `parsed.path`.
- `ClosedWindowProcessor` stops the work with an early return when `parsed.pattern`.
- `ClosedWindowProcessor` stops the work with an early return when `pathMatch`.

## When something fails

- `ClosedWindowProcessor` handles failure in 1 place: it turns it into a return value in all 1.
