logancyang_obsidian-copilot/docs
Logan Yang 795ed5ff6f
fix: hard cap L1 project context + payload diagnostics (#2192)
* docs: add token budget enforcement analysis and fix plan

Document root cause of context window overflow (2.7M tokens sent to 1M
model): L4 chat history bypasses all compaction systems. Add fix plan
with phased approach to enforce token budget at message assembly point.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: correct root cause analysis — L1 unbudgeted, not L4

Previous analysis incorrectly blamed L4 chat history as the primary
culprit. Investigation shows L4 stores only bare L5 text + compacted
responses. The real issue is systemic: no total payload enforcement,
with L1 (project context) being the largest unbudgeted layer and
PROJECT_COMPACT_THRESHOLD being blind to L1 size.

Updated fix plan to be model-agnostic (use autoCompactThreshold as
single budget, no model-specific lookup tables), added contextTurns
deprecation, and history guarantee principle.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: hard cap L1 project context at 600k tokens + payload diagnostics

- Truncate project context at 2.4M chars (~600k tokens) to prevent
  total payload from exceeding model context windows (temporary fix
  until full token budget enforcement is implemented)
- Add per-layer token estimate logging when payload exceeds 2M chars
  to help diagnose context window overflow reports
- Document Obsidian CLI dev tools in CLAUDE.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 22:25:56 -08:00
..
AGENT_PLANNING_REFLECTION_V0.md Replace indexing Notice with in-chat progress card & fix phantom re-indexing (#2173) 2026-02-10 20:08:43 -08:00
AGENT_REASONING_BLOCK.md Migrate to native tool call in plus and agent (#2123) 2026-01-26 18:35:27 -08:00
BEDROCK_TOOL_CALLING.md Migrate to native tool call in plus and agent (#2123) 2026-01-26 18:35:27 -08:00
CITATION_IMPLEMENTATION.md Implement inline citation (#1821) 2025-09-21 20:03:09 -07:00
CONTEXT_ENGINEERING.md fix: hard cap L1 project context + payload diagnostics (#2192) 2026-02-18 22:25:56 -08:00
deprecating-intent-analyzer.md Deprecate IntentAnalyzer (#2069) 2025-12-15 19:15:44 -08:00
MESSAGE_ARCHITECTURE.md Context revamp (#1971) 2025-10-27 23:28:36 -07:00
MIYO_SEARCH_PLAN.md Miyo integration: backend + retriever (#2156) 2026-02-18 18:01:18 -08:00
NATIVE_TOOL_CALLING_MIGRATION.md Migrate to native tool call in plus and agent (#2123) 2026-01-26 18:35:27 -08:00
SELF_HOSTED_SEARCH.md Migrate to native tool call in plus and agent (#2123) 2026-01-26 18:35:27 -08:00
TECHDEBT.md Implement inline citation (#1821) 2025-09-21 20:03:09 -07:00
TODO-composer-tool-redesign.md Agent UIUX Improvements (#2149) 2026-02-04 17:10:28 -08:00
TOKEN_BUDGET_ENFORCEMENT.md fix: hard cap L1 project context + payload diagnostics (#2192) 2026-02-18 22:25:56 -08:00
TOOLS.md Migrate to native tool call in plus and agent (#2123) 2026-01-26 18:35:27 -08:00