Repository navigation
Conversation
yan-ad
added a commit
to yan-ad/crabcode
that referenced
this pull request
Oct 13, 2026
Adapt PR Blankeos#67 to yan-flavor without changing its session storage, cancellation, or stream finalization behavior.
yan-ad
added a commit
to yan-ad/crabcode
that referenced
this pull request
Oct 13, 2026
Sync PR Blankeos#67 follow-up while preserving yan-flavor prompt and cancellation behavior.
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
Split
src/acp/service.rsinto a privateservice/module tree without changing behavior. The original file is 5,549 lines at the updated #64 head;service/mod.rsis now 190 lines and every extracted file is now at most 374 lines, including adjacent test files.Depends on #64. This branch starts from #64's current head, including the compaction-mode tooltip follow-up. Please merge #64 first; until then GitHub's diff against
mainalso includes that prerequisite. The refactor commits are above #64; the latest follow-up further narrows module responsibilities.Closes #65.
Module boundaries
mod.rs: service/session state, capabilities, shared cancellation and error helpers.sessions.rs: new/load/resume/fork/list/close/delete/cancel and persisted attachment handling.prompt.rsandstream.rs: prompt preparation, execution, stream events, transcript recording, and turn finalization.compaction.rs: explicit/automatic compaction, summary generation, transcript replacement, and notifications.usage.rs: provider context measurements, live usage, cumulative billing, and ACP usage updates.config.rs: MCP config, modes, model/reasoning selection, limits, and picker descriptions.commands.rs: command advertisement, expansion, and side questions.attachments.rs: input conversion, image/audio storage, and rollback guard.permissions.rs,questions.rs, andterminals.rs: permission previews/grants, elicitation, and client-terminal bridging/cleanup.notifications.rs: text/tool projections, locations/diffs/media, and transcript replay.test_support.rs: shared test fixtures, compiled only undercfg(test).Tests move alongside their owners; stdio integration tests stay in
tests/acp_stdio.rs. Production imports are explicit, child modules remain private, sibling-used helpers usepub(super), and the server-facingservice::AcpServiceAPI is unchanged.Behavior preservation
No changes to function bodies, public signatures, lock scopes, persistence ordering, cancellation handling, compaction thresholds, context-versus-billing semantics, or terminal cleanup. Compared all 202 functions/methods/types/fixtures/tests against #64 using Rust syntax parsing: production function and method bodies are token-identical; moved test bodies differ only in formatting-only trailing commas. Only internal type/field visibility and import/module placement change.
Validation
cargo test acp:: --bin crabcode: 76 passed.cargo test session::compaction:: --bin crabcode: 21 passed.cargo test --test acp_stdio: 8 passed, including automatic compaction and serialized mode descriptions.cargo fmt --all -- --checkandgit diff --check: passed.ui::components::chat::tests::test_edit_tool_renders_codex_style_diff_summary. It embeds/Users/carlo/Desktop/Projects/crabcodeand expects a basename on other checkouts; the same failure is documented in fix(acp): trigger automatic compaction from provider context usage聽#64.Synced to
yan-ad/crabcode:yan-flavor(refactor commitac52d96, latest smaller-module sync headca801fe), preserving that branch's older lifecycle implementation and concurrent install/upgrade changes. Flavor validation: 61 ACP tests, 21 compaction tests, and 4 stdio tests pass. Five consecutive parallel stdio runs pass after test-only fixtures eliminated models.dev and Ollama discovery dependencies. All 181 flavor functions/types/fixtures/tests are preserved, with function and test bodies token-identical to the flavor baseline.Follow-up: smaller source chunks
The smaller-module follow-up (
3189129) separates models, modes, and MCP config; tool content, tool locations, and replay; attachment storage; command expansion; permission previews; context accounting; transcript recording; and compaction summary construction. Long lifecycle tests are in adjacentservice/tests/files, still compiled as child modules of their owners.This is source organization, not Rust minification or a change to model context size. Related execution flows remain intact rather than splitting functions to satisfy an arbitrary line count. Upstream's largest file is now 374 lines (previously 622); the shared core remains 202 lines. The adapted flavor retains its existing 521-line prompt flow, with all other files at most 349 lines.
Validation after this follow-up: upstream 76 ACP tests, 21 compaction tests, and 8 stdio tests; flavor 61 ACP tests, 21 compaction tests, and 4 stdio tests. Both stdio suites pass in three consecutive complete runs. Formatting and whitespace checks pass. A separate upstream test-only follow-up (
bbea752) isolates mock compaction from runtime-provider discovery without altering authentication tests.