| feat(context): land Phase 1.5–6 context module + dual-parity probes
Implements all six phases of the context module rewrite per
docs/politdeck-context-refactor-development-guide.md:
- Phase 1.5: CanonicalModelErrorCode (PTL/RTL/MOR), case-insensitive
PTL classification on both Anthropic and OpenAI protocols, anthropic
signature_delta → CanonicalThinkingBlock.signature, control_boundary
schema with compactMetadata + microcompactMetadata, transcript
recordControlBoundary + replay slicing, ProjectSessionStorage
toolResultsDir.
- Phase 2: ContextRuntime full protocol, 5-section PromptAssembler
(default / user / system / custom / append), MessageProjector with
tool-call/result pairing repair + sliding window, DefaultContextRuntime.
- Phase 3: ToolResultBudget replaces oversized tool_results with the
new CanonicalToolResultReferenceBlock and persists originals to disk
(write-exclusive flag).
- Phase 4: InputProcessor three-layer slash-command dispatch driven by
ExtensionResolver, AttachmentResolver for text / base64 image / pdf
size estimation (intentional difference vs poppler/sharp).
- Phase 5: TokenBudgetManager (char/4 + multimedia constant),
CompactionEngine with legacy buildPostCompactMessages ordering
(B→S→K→A→H), AutoCompactionPolicy thresholds, MicroCompactionEngine
time-based path, ContextOverflowRecovery (50% / 25% / give_up).
- Phase 6: PluginRuntimeExtensionResolver bridging
PolitDeckLoadedPlugin commands/skills, MemoryAttachmentBuilder
feeding MemoryResolver output into the prompt.
Adds a dual-parity test suite (tests/context/parity +
tests/fixtures/context/dual-parity) covering rough_token estimation,
findLastCompactBoundaryIndex, buildPostCompactMessages ordering,
truncateHead keepRatio, and PTL classification — each scenario cites
its legacy source path so updates can be retraced.
New module 245/245 unit tests pass; OpenRouter Kimi K2.6 e2e for both
agent tool-use and DefaultContextRuntime prompt flow are green.
Also bundles the previously uncommitted TUI e2e tracing helpers
(scripts/tui-e2e-record.tsx Proxy wrapWithTrace, ActivityLine spinner)
that supported the context refactor debugging.
Co-authored-by: Cursor <cursoragent@cursor.com>
| 25 天前 |
| chore: scrub stale claudecodeui/claude-code-main residuals
Remove legacy brand leftovers from the pre-PilotDeck era so the repo
stops mentioning unrelated upstream projects and stops carrying parity
fixtures that point at a third-party tree no longer present.
- Drop src/context/memory/edgeclaw-memory-core/README.md (old CloudCLI
install guide that referenced a claude-code-main/ sibling dir).
- Delete tests + fixtures whose only purpose was to assert byte-for-byte
parity against third-party/claude-code-main/** (legacy-behavior tool
scenarios, dual-parity legacy context scenarios, the parity test
helper, and the six parity-* tests that consumed them).
- Rewrite stale code comments in apps/desktop, src/context/compaction,
src/agent/sub, src/context/memory/.../app.css and PermissionsSettingsTab
to drop dangling third-party/claude-code-main/... mirror references
and rename claudecodeui -> PilotDeck ui/server / ui shell.
- Repoint the auth-screen "PilotDeck is open source" footer link from
github.com/siteboon/claudecodeui to github.com/OpenBMB/PilotDeck.
- Align memory source tag written by ui/server with the one used by
the in-process src/** provider (claudecodeui -> pilotdeck) so the
memory_turns SQLite column is consistent across both write paths.
- Update VAPID web-push contact mailto domain (claudecodeui.local ->
pilotdeck.local).
- Drop two stale .gitignore entries for bundle tarballs that the current
build pipeline never produces.
CCR (/api/ccr/* routes, CCRConfig types, <ccr-subagent-model> tag,
CCR_SENTINEL) is intentionally untouched — those are kept for frontend
back-compat. Comparison mentions of "Claude Code" / "Claude Sonnet 4.6"
in README marketing copy are also intentional and untouched.
Co-authored-by: Cursor <cursoragent@cursor.com>
| 8 天前 |
| fix(context): prevent multimodal content from accumulating in context
Separate PDF binary data from tool_result into supplementalMessages,
enforce a 10-page limit for PDFs without explicit pages parameter,
remove image duplication in projectToolResults, add COMPACTABLE_TOOLS
filtering to MicroCompactionEngine with proper multimodal size
estimation, and strip multimedia before full compaction summarization.
Co-authored-by: Cursor <cursoragent@cursor.com>
| 10 天前 |
| fix(context): prevent multimodal content from accumulating in context
Separate PDF binary data from tool_result into supplementalMessages,
enforce a 10-page limit for PDFs without explicit pages parameter,
remove image duplication in projectToolResults, add COMPACTABLE_TOOLS
filtering to MicroCompactionEngine with proper multimodal size
estimation, and strip multimedia before full compaction summarization.
Co-authored-by: Cursor <cursoragent@cursor.com>
| 10 天前 |
| chore: scrub stale claudecodeui/claude-code-main residuals
Remove legacy brand leftovers from the pre-PilotDeck era so the repo
stops mentioning unrelated upstream projects and stops carrying parity
fixtures that point at a third-party tree no longer present.
- Drop src/context/memory/edgeclaw-memory-core/README.md (old CloudCLI
install guide that referenced a claude-code-main/ sibling dir).
- Delete tests + fixtures whose only purpose was to assert byte-for-byte
parity against third-party/claude-code-main/** (legacy-behavior tool
scenarios, dual-parity legacy context scenarios, the parity test
helper, and the six parity-* tests that consumed them).
- Rewrite stale code comments in apps/desktop, src/context/compaction,
src/agent/sub, src/context/memory/.../app.css and PermissionsSettingsTab
to drop dangling third-party/claude-code-main/... mirror references
and rename claudecodeui -> PilotDeck ui/server / ui shell.
- Repoint the auth-screen "PilotDeck is open source" footer link from
github.com/siteboon/claudecodeui to github.com/OpenBMB/PilotDeck.
- Align memory source tag written by ui/server with the one used by
the in-process src/** provider (claudecodeui -> pilotdeck) so the
memory_turns SQLite column is consistent across both write paths.
- Update VAPID web-push contact mailto domain (claudecodeui.local ->
pilotdeck.local).
- Drop two stale .gitignore entries for bundle tarballs that the current
build pipeline never produces.
CCR (/api/ccr/* routes, CCRConfig types, <ccr-subagent-model> tag,
CCR_SENTINEL) is intentionally untouched — those are kept for frontend
back-compat. Comparison mentions of "Claude Code" / "Claude Sonnet 4.6"
in README marketing copy are also intentional and untouched.
Co-authored-by: Cursor <cursoragent@cursor.com>
| 8 天前 |
| fix(context): prevent multimodal content from accumulating in context
Separate PDF binary data from tool_result into supplementalMessages,
enforce a 10-page limit for PDFs without explicit pages parameter,
remove image duplication in projectToolResults, add COMPACTABLE_TOOLS
filtering to MicroCompactionEngine with proper multimodal size
estimation, and strip multimedia before full compaction summarization.
Co-authored-by: Cursor <cursoragent@cursor.com>
| 10 天前 |
| fix(context): handle tool_result_reference in pairing, projection, and subagent filtering
Treat tool_result_reference as a valid tool result in collectToolResultIds,
stripUnpairedToolResults, repairToolResultPairing, isToolResultOnly, and
filterIncompleteToolCalls so externalized results are not orphaned.
Co-authored-by: Cursor <cursoragent@cursor.com>
| 20 天前 |