docs: add proactive context usage and compaction guidance

This commit is contained in:
William Valentin
2026-02-16 15:44:13 -08:00
parent fee8be1de0
commit 9c8da41610
5 changed files with 187 additions and 1 deletions
+32
View File
@@ -3500,6 +3500,38 @@
"docs/plans/state.json"
],
"test_status": "pnpm typecheck + pnpm test:run src/cli/setup/channels.test.ts src/cli/setup/config.test.ts src/cli/setup/integration.test.ts src/cli/setup/sections.test.ts src/daemon/routing.test.ts src/gateway/handlers/services.test.ts src/gateway/tailscale.test.ts src/models/local/llamacpp.test.ts src/models/local/ollama.test.ts src/models/openai.baseurl.test.ts src/tools/executor.test.ts src/tools/registry.test.ts passing"
},
"proactive-context-usage-and-compaction-signals": {
"status": "completed",
"date": "2026-02-16",
"updated": "2026-02-16",
"summary": "Implemented proactive context-window management end-to-end: orchestrator now exposes estimated context budget, emits staged context alerts, writes checkpoint summaries to memory near threshold, and can auto-compact proactively. Gateway now emits `context_warning` stream events during `agent.send`, serves `system.contextUsage` snapshots, and dashboard usage UI includes context budget visibility. Added config schema support under `compaction.proactive`, mapped runtime wiring in both WS SessionBridge and channel routing paths, and updated protocol/docs/default config examples with focused tests.",
"files_modified": [
"src/context/compaction.ts",
"src/backends/native/prompts.ts",
"src/backends/native/orchestrator.ts",
"src/backends/native/orchestrator.test.ts",
"src/config/schema.ts",
"src/config/schema.test.ts",
"src/gateway/session-bridge.ts",
"src/daemon/routing.ts",
"src/gateway/protocol.ts",
"src/gateway/protocol.test.ts",
"src/gateway/handlers/agent.ts",
"src/gateway/handlers/agent.test.ts",
"src/gateway/handlers/system.ts",
"src/gateway/handlers/handlers.test.ts",
"src/gateway/server.ts",
"src/daemon/services.ts",
"src/gateway/ui/pages/chat.js",
"src/gateway/ui/pages/usage.js",
"docs/api/PROTOCOL.md",
"README.md",
"docs/performance/TUNING.md",
"config/default.yaml",
"docs/plans/state.json"
],
"test_status": "pnpm test:run src/backends/native/orchestrator.test.ts src/config/schema.test.ts src/gateway/handlers/agent.test.ts src/gateway/handlers/handlers.test.ts src/gateway/protocol.test.ts + pnpm typecheck passing"
}
},
"overall_progress": {