Skip to content

fix(chat): continue external-writer conversations through desktop owner - #1

Open
ZyPulse-zy wants to merge 1 commit into
hebo6:masterfrom
ZyPulse-zy:fix/external-writer-readonly
Open

ZyPulse-zy wants to merge 1 commit into
hebo6:masterfrom
ZyPulse-zy:fix/external-writer-readonly

Conversation

@ZyPulse-zy

Copy link
Copy Markdown

Opening a thread that is already held by Codex Desktop currently fails with RPC -32600: ... already has an active writer. This change lets Android view the original conversation and, when an optional Desktop companion is configured, send text through its existing owner without creating a fork.

Changes

  • Fall back only for the active-writer conflict from thread/resume; read metadata and paginated turns/items without taking ownership. Other RPC failures still surface, and refresh/reconnect restores normal editing when the writer is released.
  • Add an explicit external-writer state, independent of the sub-agent input policy. Keep history and explicit Fork available, preserve drafts, and guard Shell, approvals, queues and conversation settings in both the UI and repository.
  • Refresh external history while the chat is in the foreground. Preserve loaded/in-flight/failed turn details against the actual server summary, fixing repeated processing-detail reloads when full history contains commentary omitted from the summary. Refresh the newest turn's details directly.
  • Add an optional authenticated Python companion that forwards normal app-server traffic and routes text-only sends through the Desktop owner. Delivery is attempted once, inherits Desktop settings and confirms the original thread/message IDs. Clarify the separate “fork into a new conversation” action.
  • Add focused repository/API/sync/cache tests and companion unit/integration tests. Configure Mockito as an explicit test JVM agent.

Validation

  • :app:lintDebug :app:testDebugUnitTest :app:assembleDebug passed locally with JDK 21 / Android SDK 37: 527 tests, 93 classes, no failures; lint has 0 errors and 26 warnings. JDK 26 validation is left to the repository CI.
  • Companion suite: 10/10 passed, including two isolated real CLI app-servers and a mocked Desktop IPC router; the message persists in the original thread without a mobile-side turn/start or thread/fork.
  • Codex CLI 0.159.2 recorded and experimental JSON Schema exported under /tmp; reference Codex/Desktop repositories were read only.
  • A dedicated real Desktop test received and answered a companion-delivered message in the same thread. Mobile same-thread sending was also confirmed by the user. The newest APK's processing-detail fix has not yet had phone UI verification.

Scope and limitations

The companion is optional and experimental. Its codexAndroid/desktop/* methods are application extensions; Desktop owner discovery/follower IPC is private and version-dependent, separate from the CLI Schema. The current adapter supports Unix sockets, with Linux peer checks; Windows named pipes and macOS have not been validated. Cross-Desktop attachments, queue/steer/interrupt, Shell and approval control are not exposed. A CLI/TUI writer or unavailable companion remains read only, with explicit Fork still available.

Fall back to paginated read-only history on active-writer conflicts, guard
local mutations, and optionally route text through the existing Desktop
owner without forking. Preserve turn details across automatic refreshes.
Copilot AI balanced review requested due to automatic review settings October 4, 2026 09:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

2 participants