Skip to content

app-server: Add egress websocket transport#15951

Merged
euroelessar merged 23 commits intomainfrom
codex/websocket-reverse-4
Apr 6, 2026
Merged

app-server: Add egress websocket transport#15951
euroelessar merged 23 commits intomainfrom
codex/websocket-reverse-4

Conversation

@euroelessar
Copy link
Copy Markdown
Collaborator

No description provided.

@euroelessar euroelessar requested a review from owenlin0 March 27, 2026 04:29
Comment thread codex-rs/app-server/src/transport/remote_control/protocol.rs Outdated
Comment thread codex-rs/app-server/src/transport/remote_control/protocol.rs Outdated
tokio::spawn(async move {
let server_envelope = QueuedServerEnvelope {
event: ServerEvent::Pong {
status: PongStatus::Unknown,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

PongStatus::Active?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

this is unhappy path if app server doesn't know about the client

Comment thread codex-rs/app-server/src/transport/remote_control/client_tracker.rs Outdated
Comment thread codex-rs/app-server/src/transport/remote_control/protocol.rs
Comment thread codex-rs/app-server/src/transport/remote_control/protocol.rs Outdated
Comment thread codex-rs/app-server/src/transport/remote_control/protocol.rs Outdated
Comment thread codex-rs/app-server/src/transport/remote_control/protocol.rs
Comment thread codex-rs/app-server/src/transport/remote_control/protocol.rs
Copy link
Copy Markdown
Collaborator

@owenlin0 owenlin0 left a comment

Choose a reason for hiding this comment

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

i noticed migration was renamed: codex-rs/state/migrations/0024_drop_logs.sql, why is that? shouldn't remote_control_enrollments.sql be 0024?

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub(crate) struct ClientEnvelope {
#[serde(flatten)]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm generally not a fan of #[serde(flatten)], do we need it?

Copy link
Copy Markdown
Collaborator Author

@euroelessar euroelessar Apr 6, 2026

Choose a reason for hiding this comment

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

options are either have flatten here or duplicate client_id/stream_id/seq_id/cursor across all branches of the enum
do you strongly prefer one over another?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

don't feel strongly, up to you

@euroelessar
Copy link
Copy Markdown
Collaborator Author

i noticed migration was renamed: codex-rs/state/migrations/0024_drop_logs.sql, why is that? shouldn't remote_control_enrollments.sql be 0024?

oh, yes, I have fix for this locally but somehow didn't push, let me fix that

&self,
websocket_url: &str,
account_id: Option<&str>,
) -> anyhow::Result<Option<(String, String, String)>> {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should we define a type like RemoteControlEnrollment, similar to the other sqlite tables we have? Option<(String, String, String>) looks awkward

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

updated

@@ -0,0 +1,219 @@
use super::*;

const REMOTE_CONTROL_ACCOUNT_ID_NONE: &str = "";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should we have account_id actually be nullable in the DB? seems weird to deal with ""

Copy link
Copy Markdown
Collaborator Author

@euroelessar euroelessar Apr 6, 2026

Choose a reason for hiding this comment

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

it looks like in sqlite NULL values are not equal to other NULLs, so can not be part of unique constraint/primary key..

@euroelessar euroelessar merged commit 73dab20 into main Apr 6, 2026
28 of 30 checks passed
@euroelessar euroelessar deleted the codex/websocket-reverse-4 branch April 6, 2026 21:56
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants