Repository navigation
Conversation
6 tasks
Contributor
Author
|
Added the configured compaction-mode tooltip in 4a4f25a, with custom descriptions preserved and both legacy modes and modern config options covered. Refactoring is separate in #67 and based on this PR. Both changes are synced to yan-ad/crabcode:yan-flavor at 62a9a4f; flavor validation passes (61 ACP, 21 compaction, 4 stdio tests, with five repeated parallel stdio runs). Existing flavor lifecycle behavior and concurrent install/upgrade commits are preserved. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix ACP automatic compaction using the context usage reported by the provider, rather than only the persisted transcript estimate. Sessions could show usage beyond the configured threshold while never automatically compacting;
/compactstill worked because it bypasses that threshold gate.ACP versus TUI context and credit analysis
ACP does not have a separate larger model context limit or credit allowance. Both paths use the model's configured/discovered limits, the shared compaction threshold (
context_window - reserved), and the same provider/tool loop.Before this fix:
Delayed compaction can increase billed input because each model/tool request resends a larger context; cached input still occupies the context window and can carry provider-dependent charges. Cumulative billed usage is not the same thing as current context size. This change does not claim measured cost savings or change provider pricing.
Remaining differences outside this focused fix: TUI scopes prompt tool guidance to the active agent, whereas ACP composes it from the full registry. Both paths still check automatic compaction at turn boundaries, not midway through a running tool loop. Auto-compaction still requires known model limits and a sufficiently large compactable head, and compaction failures remain logged rather than making the prompt fail.
Validation
cargo test acp:: --bin crabcode: 75 passed.cargo test session::compaction:: --bin crabcode: 21 passed.cargo test --test acp_stdio: 8 passed, including the local mock-provider regression (also run repeatedly on its own).cargo fmt --all -- --checkandgit diff --check: passed.cargo test --bin crabcode -- --test-threads=1: 1,850 passed, 3 ignored, 1 unrelated existing failure:ui::components::chat::tests::test_edit_tool_renders_codex_style_diff_summaryexpects a basename from a hardcoded/Users/carlo/Desktop/Projects/crabcodepath on another checkout. The parallel full-unit run additionally exposes existing catalog/Ollama shared-state test failures.Built the required remote-client assets using the existing
remote-client-buildrecipe's Bun commands before Rust validation; no dependency or generated-asset changes are included.Follow-up: compaction mode tooltip
A configured visible
compactionagent without a description now advertisesCompaction agent. Summarizes conversation context for continued work.in both legacyavailableModesand modern modeconfigOptions. Explicit descriptions remain unchanged. This does not add a built-in selectable compaction agent, expose hidden/subagents, or change how automatic compaction runs.