Repository navigation
feat(mobile): trigger manual context compaction from the slash menu - #719
Merged
Merged
Conversation
huichen
enabled auto-merge (squash)
September 18, 2026 03:36
This was referenced Sep 18, 2026
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
/menu offers a "Compact context" action above skills, reachable by/compact,/compressor/压缩. It lives in the menu rather than the toolbar (a low-frequency operation must not cost a composer row).compact_contextcommand (advertised ascompaction_v1), forwarding to the same session-scopedcompactRPC the GUI uses and relaying its operation id — one sharedcompact_agent_sessionpath, so both clients accept and validate the operation identically.compaction_*event behind that operation id and reports only what the in-transcript divider cannot: a rejected request, a no-op compaction that leaves no marker, the Agent's failure reason, or a missing result. A lost terminal event is reported as a missing result, never as a failure./querytoken before dispatching, so the command is never left in the draft to be sent as a message (found while verifying in the real UI).Verification
cargo fmt --check,cargo clippy --all-targets,cargo test --lib(1283 passed) — plus acompact_contextbridge test covering the acceptance, an Agent rejection (busy run) and a missing session. Two unrelated pre-existing flakes appeared once each in the full local run (instance::tests::excludes_second_owner_and_releases_on_drop,remote_host::files::flow_tests::prune_preview_cache_removes_expired_files); both pass in isolation and neither touches this diff.npm run lint(eslint + tsc),vitest run(1164 passed).tsc --noEmit, eslint,jest --runInBand(1639 passed), including new tests for the waiter (matching id, buffered early event, timeout, malformed frames), the request, the action gating, the draft cleanup, and every outcome toast.compact-contextscenario opens the menu, asserts the action exists, clicks it, then asserts the draft is empty and the outcome is on screen (m-compact-menu.png,m-compact-outcome.png). Mock data and a mock Desktop host — not a native-device or live-Agent E2E.Docs (compaction + remote connection, en/zh) updated for the phone entry point and the new capability.