fix: agents-llama container missing CLAUDE_AUTOCOMPACT_PCT_OVERRIDE — sessions exceed llama context window #409

Closed
opened 2026-04-08 08:21:41 +00:00 by dev-bot · 0 comments
Collaborator

Problem

The local llama server (Qwen3.5-35B-A3B) has 131K context. Claude Code assumes 200K and triggers auto-compaction at ~83.5% = ~167K tokens. Without the compaction override, sessions grow past 131K and crash:

API Error: 400 request (132353 tokens) exceeds the available context size (131072 tokens)

The dev agent gets stuck in a loop — it tries to resume the oversized session, gets the same error, and never recovers.

The fix is known: ~/claude-local.sh on the host sets CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=60 (120K/200K = 60%), leaving ~11K buffer. This env var is not set in the agents-llama container.

Fix

Add to the agents-llama compose environment (or docker run -e):

CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=60

Also add CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 from the same script.

Affected files

  • docker-compose.yml template in lib/generators.sh (add to agents-llama environment block)

Acceptance criteria

  • CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=60 is set in agents-llama container
  • Sessions compact before exceeding 131K context
  • No exceed_context_size_error crashes
## Problem The local llama server (Qwen3.5-35B-A3B) has 131K context. Claude Code assumes 200K and triggers auto-compaction at ~83.5% = ~167K tokens. Without the compaction override, sessions grow past 131K and crash: API Error: 400 request (132353 tokens) exceeds the available context size (131072 tokens) The dev agent gets stuck in a loop — it tries to resume the oversized session, gets the same error, and never recovers. The fix is known: ~/claude-local.sh on the host sets CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=60 (120K/200K = 60%), leaving ~11K buffer. This env var is not set in the agents-llama container. ## Fix Add to the agents-llama compose environment (or docker run -e): CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=60 Also add CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 from the same script. ## Affected files - docker-compose.yml template in lib/generators.sh (add to agents-llama environment block) ## Acceptance criteria - [ ] CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=60 is set in agents-llama container - [ ] Sessions compact before exceeding 131K context - [ ] No exceed_context_size_error crashes
dev-bot added the
backlog
priority
labels 2026-04-08 08:21:41 +00:00
dev-bot self-assigned this 2026-04-08 09:24:02 +00:00
dev-bot added
in-progress
and removed
backlog
labels 2026-04-08 09:24:02 +00:00
dev-bot removed their assignment 2026-04-08 09:29:03 +00:00
dev-bot removed the
in-progress
label 2026-04-08 09:29:03 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: disinto-admin/disinto#409
No description provided.