-
-
Notifications
You must be signed in to change notification settings - Fork 808
Open
Labels
area: coreCore framework (.aios-core/core/)Core framework (.aios-core/core/)area: synapseSYNAPSE context engineSYNAPSE context enginestatus: needs-triageAwaiting initial triageAwaiting initial triage
Description
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: 12002. 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 —
optionsparameter 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
modelssection to your project'score-config.yaml - Set
models.activeto match your Claude Code model - When new models are released, add them to the registry
Files Changed
.aiox-core/core-config.yaml— addedmodelssection.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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: coreCore framework (.aios-core/core/)Core framework (.aios-core/core/)area: synapseSYNAPSE context engineSYNAPSE context enginestatus: needs-triageAwaiting initial triageAwaiting initial triage