# ol.llx.ai.impl.utils.overflow

_platforms: clj, cljs_

## context-overflow?

### clj

_platforms: clj_

```clojure
(context-overflow? assistant-message)
(context-overflow? assistant-message context-window)
```

Returns true when `assistant-message` appears to be a context-window overflow.

Supports two detection modes:
1. error-message pattern matching for explicit overflow responses.
2. silent overflow heuristic when `context-window` is provided and
   `(:usage :input + :cache-read)` exceeds it.

[source,window=_blank](https://github.com/outskirtslabs/llx/blob/main/src/ol/llx/ai/impl/utils/overflow.cljc#L32-L52)

### cljs

_platforms: cljs_

```clojure
(context-overflow? assistant-message)
(context-overflow? assistant-message context-window)
```

Returns true when `assistant-message` appears to be a context-window overflow.

Supports two detection modes:
1. error-message pattern matching for explicit overflow responses.
2. silent overflow heuristic when `context-window` is provided and
   `(:usage :input + :cache-read)` exceeds it.

[source,window=_blank](https://github.com/outskirtslabs/llx/blob/main/src/ol/llx/ai/impl/utils/overflow.cljc#L32-L52)
