Skip to main content

ContextInspection

@forge/monorepo


@forge/monorepo / backend/src / ContextInspection

Type Alias: ContextInspection

ContextInspection = object

Defined in: backend/src/context/assembler.ts:151

Properties

budget

readonly budget: ContextBudget

Defined in: backend/src/context/assembler.ts:154


modelContextTokens

readonly modelContextTokens: number

Defined in: backend/src/context/assembler.ts:156

The model's hard input limit — the denominator for utilization (#168).


remainingTokens

readonly remainingTokens: number

Defined in: backend/src/context/assembler.ts:164

What is left for history and the model's reply.

Derived here rather than by each client, because max(0, limit - used) is the kind of arithmetic that gets written twice and clamped once. Never negative: the assembler refuses to overflow, so a negative remainder would be a bug reported as a number.


sections

readonly sections: readonly InspectedSection[]

Defined in: backend/src/context/assembler.ts:152


totalTokens

readonly totalTokens: number

Defined in: backend/src/context/assembler.ts:153