Skip to content

v0.1.6

Choose a tag to compare

@Tyan66666 Tyan66666 released this 14 Aug 09:56
· 3 commits to main since this release

What's new

  • (feat) Auto-detect the model context window — when modelContextLimit is omitted, the engine queries the live LLM runtime via agent.ctx.llm.resolveModelInfo(provider, model) and uses the API-reported contextWindow (cached per provider+model). An explicit modelContextLimit still wins; failed/unavailable detection falls back to the default (128000). acp_status now 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 / nudgeEmergencyThresholdPct are now 0.70 / 0.85 (downstream of the kernel/pi defaults 0.75 / 0.95). Rationale: the host's compaction-basic auto-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. nudgeMinContextLimitPct is validation-only.

Live verification

  • Auto-detection: with modelContextLimit omitted, /acp status on a restarted service reported context window: 1000000 (auto-detected from deepseek-official/deepseek-v4-flash).
  • Threshold test (window forced to 30000, no explicit nudge thresholds → engine defaults): /acp status showed estimated 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.