Skip to content

fix(remote-connect): register session revert port and streamline mobile message actions - #3245

Open
BingCHuanJ wants to merge 17 commits into
GCWing:mainfrom
BingCHuanJ:fix/remote-session-revert-port
Open

BingCHuanJ wants to merge 17 commits into
GCWing:mainfrom
BingCHuanJ:fix/remote-session-revert-port

Conversation

@BingCHuanJ

Copy link
Copy Markdown
Contributor

Summary

This PR fixes the issue where rolling back or editing messages in remote control sessions fails with agent session revert port is not registered. It also refines the message action menus and confirmation dialogs in mobile-web for a cleaner user experience.

Problem

  1. Missing Revert Port: CoreRemoteSessionRuntimeHost did not inject the global scheduler when setting up the agent runtime host, leaving the session_revert port unregistered on remote session instances.
  2. Redundant Message Actions: For messages that have already been delivered with a valid turn index, a plain "Resend" action remained visible alongside "Edit & resend", causing confusion.
  3. Verbose Confirmation Copy: Confirmation dialogs for rollback and editing contained lengthy descriptions that cluttered small mobile screens.
  4. Edge Cases: Double-clicking confirmations could trigger duplicate in-flight requests, and switching sessions while a request was pending could cause stale callbacks to mutate active state.

Changes

  • Backend (service_agent_runtime.rs):
    • Injected get_global_scheduler() during runtime host construction and registered .with_session_revert_port(session_revert).
    • Added source-level assertions to guard against port registration regression.
    • Normalized Windows paths in history routing tests for cross-platform reliability.
  • Frontend (mobile-web):
    • Action Menu: Hid redundant plain "Resend" for successfully sent turns, keeping only "Edit & resend", "Roll back to here", "Copy", and "Delete" (ChatMessageActions.tsx).
    • Copy & Typography: Streamlined confirmation dialog text across zh-CN, zh-TW, and en-US (messages.ts).
    • Robustness:
      • Guarded in-flight rollback requests with an attempt-scoped Symbol lock to prevent rapid clicks and isolate responses across session switches.
      • Added RFC 4648-compliant image data URL validation and ensured drafts restore cleanly even when composer text is empty.
    • Test Fixtures: Supported Chromium/Edge auto-discovery on Windows and fixed Vite /@fs/ paths in browser test fixtures.

Verification

All automated tests pass cleanly:

  • openbitfun-core: 35 tests passed (service_agent_runtime, rollback, staged_revert).
  • openbitfun-services-integrations: 25 tests passed (remote_connect_contracts).
  • mobile-web: 136 tests passed (including UI components, workspace identity, and all browser end-to-end suites).
  • TypeScript type-check and production build passed with 0 errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant