Repository navigation
fix: harden agent, desktop, and mobile reliability - #637
Merged
Merged
Conversation
tallcode
enabled auto-merge (squash)
September 15, 2026 02:56
huichen
added a commit
that referenced
this pull request
Sep 26, 2026
Restores the follow-up coalescing removed in #637, this time behind an opt-in `enqueue_coalescing` busy policy so only callers that can absorb a folded run opt in. Agent: - `BusyPolicy::EnqueueCoalescing` queues like `enqueue_if_busy` but lets the run boundary fold a consecutive run of such requests into one. - `InMemoryRunQueue::drain_coalescing_after_first` takes that prefix atomically: the front must itself have opted in, folding stops at the first request that did not (order and identity preserved) and at the merged-payload byte cap; folded requests leave the queue, release their quota and are recorded terminal with reason `merged`. - `start_next_scheduled` merges text, model-context sidecar, images and attachments in queue order (nothing dropped, nothing reordered), keeps the front request's run identity, and takes the EXECUTION configuration (model, thinking, cwd, permissions, sandbox) from the LAST folded request, so #637's "front config silently reused for later requests" cannot happen. The accepted message carries `coalesced_run_ids`. TUI: submits with the coalescing policy, and renders a folded submission as `merged into the previous run` (`RunState::Merged`) instead of leaving it at `queued (#n)`. Loop: the supervisor outbox delivers batches with the coalescing policy — batches are fire-and-forget state syncs, so the ones that queue behind a busy orchestrator fold into one reconciliation run instead of each starting and being superseded on its own. CLI `--follow-up`, the IM bridges and Desktop/Mobile keep plain `enqueue_if_busy`: they stream their own run and would stall on a merged ack they never receive.
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
Validation
cargo fmt -p future-agent --checkcargo clippy -p future-agent --all-targets -- -D warningscargo test -p future-agent --lib -- --test-threads=1(1767 passed, 1 ignored)cargo fmt --check --manifest-path desktop/src-tauri/Cargo.tomlcargo clippy --manifest-path desktop/src-tauri/Cargo.toml --all-targets -- -D warningscargo test --manifest-path desktop/src-tauri/Cargo.toml --no-default-features --lib -- --test-threads=1(976 passed)git diff --check