feat(remote-connect): support targeted session rollback and edit-resend from remote control - #3137
Merged
Merged
Conversation
BingCHuanJ
force-pushed
the
feat/remote-session-rollback-v1
branch
from
September 20, 2026 04:12
68b026d to
63f67ee
Compare
…nd from remote control The remote control surface previously offered only resend and delete, where delete was a local hide that left the turn and file mutations intact on the desktop. Port the targeted rollback and edit-and-resend capability to OpenBitFun 1.0.1: - Project the owning turn identity onto user `ChatMessage`s (`turn_id` + `turn_index`). Targeted rollback addresses turns rather than messages, and `turn_index` carries the same optimistic-concurrency guard the desktop sends so a stale transcript cannot retire the wrong turn. - Add `RemoteCommand::RollbackSessionToTurn` and `RemoteResponse::SessionRolledBack` to the owner contract in `openbitfun-services-integrations`, routed through the session command group. - Implement `RemoteSessionRuntimeHost::rollback_session_to_turn` in core on top of `AgentRuntime::rollback_session_to_turn`, passing the workspace ownership gate (`ensure_remote_binding_runtime_ownership`) and rejecting remote workspaces. - Mobile web gains "edit & resend" and "roll back to here" on user messages, using `MobileConfirmSheet` and `MobileTextarea` to conform to `@openbitfun/ui/mobile` component boundaries. - Disable rollback mutations while a turn is active to preserve consistency with desktop `assertSessionIdleForHistoryMutation`. - Nudge the stream poller immediately upon rollback completion to pull the authoritative message snapshot from the host. - Provide full i18n support across en-US, zh-CN, and zh-TW.
BingCHuanJ
force-pushed
the
feat/remote-session-rollback-v1
branch
from
September 20, 2026 07:16
63f67ee to
9f16efb
Compare
3 tasks
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
Add real session rollback and "edit & resend" support to the mobile remote control surface, backed by the desktop's existing targeted-rollback transaction.
Motivation
Previously, the mobile interface only offered resend and delete. "Delete" only hid the bubble in the mobile browser without actually rolling back the turn or restoring modified files on the host desktop.
This PR connects the mobile web client to the host's actual rollback capability so users can:
What Changed
openbitfun-services-integrations):RemoteCommand::RollbackSessionToTurnandRemoteResponse::SessionRolledBack.turn_idandturn_indexfor turn-level addressing and optimistic concurrency checks.openbitfun-core):rollback_session_to_turnonRemoteSessionRuntimeHost, delegating to the desktop's rollback port while enforcing workspace ownership checks and rejecting remote SSH workspaces.src/mobile-web):@openbitfun/ui/mobilecomponents (MobileConfirmSheet,MobileTextarea).en-US,zh-CN, andzh-TW.Verification
cargo test -p openbitfun-services-integrations --features remote-connect --test remote_connect_contracts(73 passed)cargo test -p openbitfun-services-integrations --features remote-connect --lib remote_connect::tests(18 passed)cargo test -p openbitfun-core --features remote-connect --lib service_agent_runtime::tests(22 passed)pnpm --dir src/mobile-web run test:ui-components(15 passed)pnpm --dir src/mobile-web run type-check(passed, 0 errors)pnpm --dir src/mobile-web run build(passed)en-US,zh-CN,zh-TW).Checklist
Maintainer review and fixes
AI-assisted review and follow-up implementation by Codex. Fixed in
fdad071ab:session_rollback_v1; older hosts retain their existing actions without receiving an unknown rollback command.A follow-up CI failure exposed an incomplete
RemoteSessionManagermock in the Web UI-owned mobile integration suite.bf262c6e2updates that mock and adds rendered-chat regressions for rollback failure and target-switch isolation (6 tests passed).Focused validation of the updated head:
service_agent_runtime::tests: 22 passed.Remote coverage: simulated remote-control protocol/Chrome stream tests, including control-device switching and old-host compatibility. Real phone-to-desktop file restoration, SSH workspace rejection, Peer Device Mode, and Detached Dispatch were not exercised end to end. The host continues to reject rollback for remote workspaces explicitly. No CI checks were bypassed; merge waits for the updated head's CI.
Queue integration review
Follow-up review in
e087a2230fixes a stale-controller race: remote rollback now requires idle at the host, checked under the same session-operation lock used for submission, before queue retirement or cancellation. A concurrent submission causes a clear rejection and leaves accepted work intact. The additive runtime request field defaults to the legacy maintenance policy for existing callers.Edit/resend failures now restore image attachments alongside the edited text. Rollback responses reject malformed composer text and array elements.
Validation: 42 focused scheduler tests (including lock contention and retained queued work), 22 service runtime tests, legacy rollback DTO round trip, 21 mobile workspace/protocol tests, 7 rendered chat submission/rollback tests, and mobile TypeScript passed. A pre-existing lineage DTO test fixture was supplied its missing optional workspace ID so the contract suite compiles. These are simulated remote-control and runtime tests, not physical-phone or live SSH/peer E2E evidence.
PR #3180 will additionally test this rollback guard against the host-owned queue, including blocked/unconsumed steering entries and preservation of the queue epoch and receipts.