Problem
The context-tracker.js module has maxContext: 200000 hardcoded as default. With Claude Opus 4.6 (1M context window), this causes premature bracket escalation:
| Prompts |
With 200K (current) |
With 1M (correct) |
| 50 |
32.5% → DEPLETED |
91% → FRESH |
| 100 |
10% → CRITICAL |
82% → FRESH |
| 133 |
0% → CRITICAL |
76% → FRESH |
Impact: Handoff warnings firing prematurely, unnecessary heavy token injection (2500 budget instead of 800), and false CRITICAL state when 80%+ context is still available.
Root Cause
context-tracker.js line 57:
const DEFAULTS = {
avgTokensPerPrompt: 1500,
maxContext: 200000, // ← hardcoded, doesn't reflect actual model
};
Fix Applied
1. Model registry in core-config.yaml
models:
active: claude-opus-4-6
registry:
claude-opus-4-6:
contextWindow: 1000000
avgTokensPerPrompt: 1500
claude-sonnet-4-6:
contextWindow: 200000
avgTokensPerPrompt: 1500
claude-haiku-4-5:
contextWindow: 200000
avgTokensPerPrompt: 1200
2. context-tracker.js → getModelConfig()
New function reads models.active from core-config.yaml, resolves the contextWindow from the registry, and passes it to estimateContextPercent(). Features:
- Cached per process (read once, no I/O overhead)
- Graceful fallback to 200K default if config missing/malformed
- Backward-compatible —
options parameter still allows override for tests
resetModelConfigCache() exported for test cleanup
3. Version bump
context-tracker.js v1.0.0 → v1.1.0
Recommendation for Developers
- Add the
models section to your project's core-config.yaml
- Set
models.active to match your Claude Code model
- When new models are released, add them to the registry
Files Changed
.aiox-core/core-config.yaml — added models section
.aiox-core/core/synapse/context/context-tracker.js — dynamic config reader
Commit
9dd94fb — fix(synapse): dynamic context window from model registry instead of hardcoded 200K
Problem
The
context-tracker.jsmodule hasmaxContext: 200000hardcoded as default. With Claude Opus 4.6 (1M context window), this causes premature bracket escalation:Impact: Handoff warnings firing prematurely, unnecessary heavy token injection (2500 budget instead of 800), and false CRITICAL state when 80%+ context is still available.
Root Cause
context-tracker.jsline 57:Fix Applied
1. Model registry in
core-config.yaml2.
context-tracker.js→getModelConfig()New function reads
models.activefromcore-config.yaml, resolves thecontextWindowfrom the registry, and passes it toestimateContextPercent(). Features:optionsparameter still allows override for testsresetModelConfigCache()exported for test cleanup3. Version bump
context-tracker.jsv1.0.0 → v1.1.0Recommendation for Developers
modelssection to your project'score-config.yamlmodels.activeto match your Claude Code modelFiles Changed
.aiox-core/core-config.yaml— addedmodelssection.aiox-core/core/synapse/context/context-tracker.js— dynamic config readerCommit
9dd94fb—fix(synapse): dynamic context window from model registry instead of hardcoded 200K