Skip to content

Conversation

@slkzgm
Copy link
Contributor

@slkzgm slkzgm commented Jan 19, 2026

Part of the optional remote backend mode RFC (#54).

What

Adds a Tauri-side remote backend proxy layer that can (optionally) forward a subset of backend commands to the daemon introduced in #58.

  • New module: src-tauri/src/remote_backend.rs
  • Wires the proxy into existing command paths so local mode remains the default and unchanged.

Why

This is the next incremental step after:

The goal is to allow the UI to keep using the same Tauri commands/events, while the Rust side can swap between:

  • local (current behaviour)
  • remote (daemon over localhost JSON-RPC)

Notes

  • Strictly opt-in behind backendMode=remote.
  • No changes to default behaviour.

Validation

  • npm ci
  • npm run typecheck
  • npm run build

Rust compilation/tests require platform WebKitGTK deps on Linux; CI should cover this.

@Dimillian
Copy link
Owner

This is ready: #114 should I merge it?

@slkzgm
Copy link
Contributor Author

slkzgm commented Jan 19, 2026

#114 still looks relevant to merge.

It enables a native Windows build, but it does not address the core #54 constraint: keeping codex and the repo/tooling running inside WSL/Linux with identical performance and path semantics.

The optional remote backend work discussed in #54 remains useful for WSL2, dev boxes, containers, and stricter privilege boundaries. In practice, #114 makes that direction more valuable by providing a solid native Windows client baseline.

So yes, feel free to merge #114. It should not block #121 or the rest of the #54 plan.

@Dimillian
Copy link
Owner

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6ec46ebf58

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@slkzgm slkzgm force-pushed the pr5-remote-backend-proxy-v2 branch from 6ec46eb to f8b7c5a Compare January 19, 2026 17:36
@Dimillian
Copy link
Owner

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 404dae659c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 44 to 48
.send(message)
.map_err(|_| DISCONNECTED_MESSAGE.to_string())?;

rx.await
.map_err(|_| DISCONNECTED_MESSAGE.to_string())?

Choose a reason for hiding this comment

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

P2 Badge Avoid hanging calls after remote disconnect

If the daemon drops the TCP connection (e.g., a remote backend restart), the reader task exits and drains only the pending requests that existed at that moment, but call() still allows new requests to be enqueued and then awaits a oneshot with no timeout. Because the write task can still accept the send even though the socket is closed, those later calls can wait forever with no response and no disconnect error surfaced to the UI. This will leave any remote-mode Tauri command hanging indefinitely until the app restarts. Consider marking the client disconnected when the read loop ends or propagating write failures to drain pending/new calls.

Useful? React with 👍 / 👎.

Copy link
Contributor Author

@slkzgm slkzgm Jan 19, 2026

Choose a reason for hiding this comment

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

Pushed a small follow-up that prevents remote-mode commands from hanging after a daemon disconnect (restart, TCP drop).

  • The client now tracks a shared connected flag.
  • When the read loop ends or the write loop hits an IO error, it marks the client disconnected and drains pending, completing all waiting calls with remote backend disconnected.
  • New calls fail fast once disconnected.

Commit: 214785c

Copy link
Contributor Author

@slkzgm slkzgm Jan 19, 2026

Choose a reason for hiding this comment

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

Small correction: the fix was rebased, so the current commit in the PR is 65b28e5 (fix(remote): fail fast on daemon disconnect).

@slkzgm slkzgm force-pushed the pr5-remote-backend-proxy-v2 branch from 404dae6 to 65b28e5 Compare January 19, 2026 20:55
@Dimillian Dimillian merged commit f073211 into Dimillian:main Jan 20, 2026
5 checks passed
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