v0.1.6
What's new
- (feat) Auto-detect the model context window — when
modelContextLimitis omitted, the engine queries the live LLM runtime viaagent.ctx.llm.resolveModelInfo(provider, model)and uses the API-reportedcontextWindow(cached per provider+model). An explicitmodelContextLimitstill wins; failed/unavailable detection falls back to the default (128000).acp_statusnow reports the window source:context window: N (configured | auto-detected from <provider>/<model> | default (auto-detection unavailable)). - (feat) Engine nudge thresholds lowered to 0.70 / 0.85 — the engine defaults for
nudgeMaxContextLimitPct/nudgeEmergencyThresholdPctare now 0.70 / 0.85 (downstream of the kernel/pi defaults 0.75 / 0.95). Rationale: the host'scompaction-basicauto-compaction line sits at 80%, so the old 95% emergency line could never fire and left only a 5% margin before the window fills. The forced nudge now triggers before the host's 80% line. Explicit user values still win. - docs: clarify nudge trigger semantics — the growth path has no percentage floor (fires when some tier's pending tokens ≥ 50k AND usage grew ≥ 22.5k since the last check); 70% is the guaranteed over-limit line, 85% is the emergency line.
nudgeMinContextLimitPctis validation-only.
Live verification
- Auto-detection: with
modelContextLimitomitted,/acp statuson a restarted service reportedcontext window: 1000000 (auto-detected from deepseek-official/deepseek-v4-flash). - Threshold test (window forced to 30000, no explicit nudge thresholds → engine defaults):
/acp statusshowedestimated context: 18795 / 30000 (63%); after injecting ~60k chars of context, surface hit 100% and the pre-step hook injected the emergency nudge (⚠️ Context usage is at 100% of the window…+ compressible-range table) into the agent's next turn — the full chain config → window → threshold → inject works end to end.
Tests
54/54 passing (+3 regression tests: auto-window detection ×9 in tests/window.test.ts, engine threshold defaults/overrides in tests/config.test.ts, status window-source output), typecheck clean, build 47.24 KB.