Skip to content

Bound Web model context without truncating transcripts#320

Merged
oratis merged 2 commits into
mainfrom
codex/web-context-budget
Jul 26, 2026
Merged

Bound Web model context without truncating transcripts#320
oratis merged 2 commits into
mainfrom
codex/web-context-budget

Conversation

@oratis

@oratis oratis commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • cap the Web provider history view at 64k estimated tokens by default (LISA_WEB_CONTEXT_TOKENS is bounded/configurable)
  • reserve that budget for the current text and attachments before selecting historical messages
  • keep the canonical TenantRuntime history and append-only SessionStore transcript complete
  • avoid provider-invalid context boundaries by excluding orphan leading tool_result and trailing tool_use fragments
  • inject the latest durable reflection summary when older messages are omitted, marked and sanitized as historical data rather than instructions
  • tell the model that omitted detail remains recoverable through memory_search
  • load reflection summaries per tenant and refresh them after manual/background reflection

Dependency

Stacked on #319 (which follows #318 and #317). Merge in stack order and retarget successors to main.

Validation

  • npm run typecheck
  • focused context/session/agent tests — 23 passed
  • npm test — 1461 passed, 1 skipped, 0 failed
  • npm run build

@oratis
oratis changed the base branch from codex/voice-cost-governance to main July 26, 2026 07:03
@oratis
oratis marked this pull request as ready for review July 26, 2026 07:05
@oratis
oratis merged commit 4ccdefe into main Jul 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant