# Class AvailabilityCache

Bounded TTL cache for model availability probe results. Thread-safe for single-threaded Node.js; no locks needed.

- Defined in packages/nexus-agents/src/config/model-availability.ts:57

##### Index

### Constructors

constructor

### Accessors

size

### Methods

get
set
markUnavailable
markAvailable
isKnownUnavailable
entries
clear

## Constructors

### constructor

- new AvailabilityCache(config?: AvailabilityCacheConfig): AvailabilityCache

  #### Parameters

  - config: AvailabilityCacheConfig = {}

  #### Returns AvailabilityCache

  - Defined in packages/nexus-agents/src/config/model-availability.ts:62

## Accessors

### size

- get size(): number

  Number of cached entries.

  #### Returns number

  - Defined in packages/nexus-agents/src/config/model-availability.ts:122

## Methods

### get

- get(
  modelId:
  | "claude-opus"
  | "claude-sonnet"
  | "claude-haiku"
  | "gemini-3-pro"
  | "gemini-pro"
  | "gemini-3-flash"
  | "gemini-flash"
  | "codex-5.3"
  | "codex-5.2"
  | "codex-5.1-mini"
  | "opencode-default"
  | "opencode-custom-opus"
  | "opencode-custom-sonnet"
  | "openrouter-nemotron-super"
  | "openrouter-qwen-coder",
  ): ProbeResult
  | undefined

  Get a cached probe result, or undefined if expired/missing.

  #### Parameters

  - modelId:
    | "claude-opus"
    | "claude-sonnet"
    | "claude-haiku"
    | "gemini-3-pro"
    | "gemini-pro"
    | "gemini-3-flash"
    | "gemini-flash"
    | "codex-5.3"
    | "codex-5.2"
    | "codex-5.1-mini"
    | "opencode-default"
    | "opencode-custom-opus"
    | "opencode-custom-sonnet"
    | "openrouter-nemotron-super"
    | "openrouter-qwen-coder"

  #### Returns ProbeResult | undefined

  - Defined in packages/nexus-agents/src/config/model-availability.ts:68

### set

- set(result: ProbeResult): void

  Store a probe result, evicting oldest if at capacity.

  #### Parameters

  - result: ProbeResult

  #### Returns void

  - Defined in packages/nexus-agents/src/config/model-availability.ts:79

### markUnavailable

- markUnavailable(
  modelId:
  | "claude-opus"
  | "claude-sonnet"
  | "claude-haiku"
  | "gemini-3-pro"
  | "gemini-pro"
  | "gemini-3-flash"
  | "gemini-flash"
  | "codex-5.3"
  | "codex-5.2"
  | "codex-5.1-mini"
  | "opencode-default"
  | "opencode-custom-opus"
  | "opencode-custom-sonnet"
  | "openrouter-nemotron-super"
  | "openrouter-qwen-coder",
  error: string,
  ): void

  Mark a model as unavailable without a full probe.

  #### Parameters

  - modelId:
    | "claude-opus"
    | "claude-sonnet"
    | "claude-haiku"
    | "gemini-3-pro"
    | "gemini-pro"
    | "gemini-3-flash"
    | "gemini-flash"
    | "codex-5.3"
    | "codex-5.2"
    | "codex-5.1-mini"
    | "opencode-default"
    | "opencode-custom-opus"
    | "opencode-custom-sonnet"
    | "openrouter-nemotron-super"
    | "openrouter-qwen-coder"
  - error: string

  #### Returns void

  - Defined in packages/nexus-agents/src/config/model-availability.ts:90

### markAvailable

- markAvailable(
  modelId:
  | "claude-opus"
  | "claude-sonnet"
  | "claude-haiku"
  | "gemini-3-pro"
  | "gemini-pro"
  | "gemini-3-flash"
  | "gemini-flash"
  | "codex-5.3"
  | "codex-5.2"
  | "codex-5.1-mini"
  | "opencode-default"
  | "opencode-custom-opus"
  | "opencode-custom-sonnet"
  | "openrouter-nemotron-super"
  | "openrouter-qwen-coder",
  latencyMs: number,
  ): void

  Mark a model as available.

  #### Parameters

  - modelId:
    | "claude-opus"
    | "claude-sonnet"
    | "claude-haiku"
    | "gemini-3-pro"
    | "gemini-pro"
    | "gemini-3-flash"
    | "gemini-flash"
    | "codex-5.3"
    | "codex-5.2"
    | "codex-5.1-mini"
    | "opencode-default"
    | "opencode-custom-opus"
    | "opencode-custom-sonnet"
    | "openrouter-nemotron-super"
    | "openrouter-qwen-coder"
  - latencyMs: number

  #### Returns void

  - Defined in packages/nexus-agents/src/config/model-availability.ts:101

### isKnownUnavailable

- isKnownUnavailable(
  modelId:
  | "claude-opus"
  | "claude-sonnet"
  | "claude-haiku"
  | "gemini-3-pro"
  | "gemini-pro"
  | "gemini-3-flash"
  | "gemini-flash"
  | "codex-5.3"
  | "codex-5.2"
  | "codex-5.1-mini"
  | "opencode-default"
  | "opencode-custom-opus"
  | "opencode-custom-sonnet"
  | "openrouter-nemotron-super"
  | "openrouter-qwen-coder",
  ): boolean

  Check if a model is known-unavailable (cached and not expired).

  #### Parameters

  - modelId:
    | "claude-opus"
    | "claude-sonnet"
    | "claude-haiku"
    | "gemini-3-pro"
    | "gemini-pro"
    | "gemini-3-flash"
    | "gemini-flash"
    | "codex-5.3"
    | "codex-5.2"
    | "codex-5.1-mini"
    | "opencode-default"
    | "opencode-custom-opus"
    | "opencode-custom-sonnet"
    | "openrouter-nemotron-super"
    | "openrouter-qwen-coder"

  #### Returns boolean

  - Defined in packages/nexus-agents/src/config/model-availability.ts:111

### entries

- entries(): readonly ProbeResult[]

  Get all cached entries (for diagnostics).

  #### Returns readonly ProbeResult[]

  - Defined in packages/nexus-agents/src/config/model-availability.ts:117

### clear

- clear(): void

  Clear all cached entries.

  #### Returns void

  - Defined in packages/nexus-agents/src/config/model-availability.ts:127