Repository navigation
fix(agent,host,desktop,mobile): a queued edit keeps its place; host-remote store init retries - #1604
Merged
Merged
Conversation
A queued message edited from the send-queue panel used to be a cancellation and a re-send: the corrected text was a new prompt, which enters at the back of the queue. So fixing a typo in the second of four waiting messages sent it after the fourth — the order the reader built, arriving as an order they never chose (reported 2026-11-14). The Agent now has an edit that is an edit: `edit_queued_run` swaps the accepted payload's `message` in place. Same run id, same sequence, same position; the files, images, model-context sidecar and frozen run settings the prompt was accepted with stay exactly as they were, so a correction changes the words and nothing else. A parked row is editable too and stays parked — editing is not the press that starts it, and it does not reset the wait the parking rule measured. - `InMemoryRunQueue::edit_queued` does the in-place swap, re-deriving the queue's byte accounting (and shrinking the global reservation) or refusing the whole edit when the corrected text would not fit. - The durable acceptance is rewritten too (`replace_queued_receipt_input`): a restart restores the corrected words instead of the version the reader already fixed away. The acceptance's identity — run id, sequence, fingerprint — is deliberately untouched, so a retried request id stays the same acceptance. - Wired through the host (`agent_bridge`, `application::queue`, the Tauri command and the remote host's prompt route) and used by all three clients that offer the pencil: this machine's queue, a paired computer's, and the phone. - A host too old to know the command answers "Unsupported command"; the two remote clients fall back to the cancel-and-re-send they used before, files included, rather than failing the edit. Editing *which files* a queued row carries (phone only) still goes through that path. Tests: queue ordering/limit/parked cases at the queue, the handler and the session (durable receipt round trip), the command registry sweeps, and the three client surfaces rewritten to assert the in-place command instead of the re-send.
huichen
enabled auto-merge (squash)
November 13, 2026 20:31
`remote::test_support::init_store` called `store::initialize_app_store`
directly, so a `SQLITE_BUSY` — a task outside the cancel registries still
mid-write on the freshly published test HOME's `app.db` — failed a whole
suite run instead of one attempt. `TestHome` has retried exactly that
since it was written (the comment there names the condition); the fixtures
that only publish a HOME never did, and the Windows `host-remote` job
failed on it:
remote_host::sync_measurement::tests::the_gzip_declaration_...:
store init under test HOME: Database(SqliteFailure(Error { code:
DatabaseBusy, extended_code: 5 }, Some("database is locked")))
Move the retry into one `initialize_store_retrying_busy` that both HOME
fixtures call, so the two cannot drift apart on it again, and cover the
remote fixture with the `arm_busy_fault` seam `TestHome`'s retry test
already uses: with the fault armed, `init_store` has to consume the first
attempt and leave a usable store behind. Calling
`store::initialize_app_store` from `init_store` again fails that test
("the armed fault is consumed by the first attempt").
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.
What
Editing a message that is still waiting in the send queue now corrects the queued item in place — same run id, same position, same files, same parked state — instead of cancelling it and re-sending at the back of the queue. Remote clients talking to an older host keep the old cancel-and-resend behaviour on purpose.
The second commit fixes the two red
host-remoteCI jobs on this branch: the remote fixtures' test HOME published anapp.dband then calledstore::initialize_app_storedirectly, so aSQLITE_BUSYfrom a task still mid-write failed the whole suite instead of one attempt. The retry thatTestHomehas always had now lives in oneinitialize_store_retrying_busyhelper that both fixtures call.Commits
fix(agent,host,desktop,mobile): editing a queued message keeps its placetest(host): retry a busy store in the remote fixtures' store initVerification
cargo fmt --all -- --check: clean.cargo check/cargo clippy --all-targets -D warningsforfuture-agent,future-host,future-rpc,futureos: clean.cargo test -p future-host --lib: 2248 passed / 0 failed / 15 ignored;cargo test -p future-rpc: green.cargo test -p future-agent --lib: 3074 passed with 5 failures inagent/src/sandbox— the identical five fail atorigin/mainin a full parallel run and pass when the module runs alone, so they are pre-existing and not from this diff.tsc --noEmitclean, eslint clean on the changed sources, the changed vitest suites green (186 tests).tsc --noEmitclean, the changed jest suites green (88 tests, node 22 — this suite fails under the default node 26).make check-docs: green.cargo test -p future-host --lib -- --test-threads=4 remoteand the affected remote suites locally before it was pushed.User-visible changes
Editing a message still waiting in the send queue corrects it in place instead of moving it to the back of the queue (revert
d744cbe9b); a remote client paired with an older host deliberately keeps the old behaviour. No migration, no default or permission change.