Skip to content

move top bid handling to a separate tile#423

Merged
vladimir-ea merged 2 commits intodevelopfrom
ve/top_bid_tile
Mar 19, 2026
Merged

move top bid handling to a separate tile#423
vladimir-ea merged 2 commits intodevelopfrom
ve/top_bid_tile

Conversation

@vladimir-ea
Copy link
Contributor

@vladimir-ea vladimir-ea commented Mar 18, 2026

devin-ai-integration[bot]

This comment was marked as resolved.


use super::*;

// #[test]
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe we should delete this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes - it is deleted

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View 7 additional findings in Devin Review.

Open in Devin Review

Comment on lines +231 to +235
attach_tile(
TopBidTile::new(web_socket_recv),
spine,
TileConfig::new(config.cores.top_bid, flux::utils::ThreadPriority::High),
);
Copy link
Contributor

Choose a reason for hiding this comment

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

🟡 WebSocket receiver dropped on non-submission instances causes silent connection failures

On non-submission instances (config.is_submission_instance == false), the TopBidTile is never created (it's only attached inside the if config.is_submission_instance block at crates/relay/src/main.rs:195-235), so web_socket_recv is dropped when the closure exits at crates/relay/src/main.rs:275. However, web_socket_send is always passed to start_api_service at crates/relay/src/main.rs:179, and the GetTopBid route is always registered in the router (crates/relay/src/api/router.rs:64). When a client connects to /top_bid on a non-submission instance, the HTTP 101 upgrade response succeeds, the async task creates the RawWebSocket, but sender.try_send(socket) (crates/relay/src/api/builder/top_bid.rs:43) immediately fails with TrySendError::Disconnected because the receiver was dropped, and the WebSocket is silently closed. This is a behavioral regression: the old broadcast-based approach kept WebSocket connections alive with pings on non-submission instances.

Prompt for agents
In crates/relay/src/main.rs, the TopBidTile (lines 231-235) is only attached inside the `if config.is_submission_instance` block, but web_socket_send is always passed to start_api_service (line 179). On non-submission instances, web_socket_recv is dropped when the closure exits, causing all try_send calls on web_socket_send to fail immediately.

Two possible fixes:
1. Move the TopBidTile attachment outside the `if config.is_submission_instance` block so it always runs, keeping WebSocket connections alive even on non-submission instances.
2. Only create the channel and pass web_socket_send to start_api_service when is_submission_instance is true, and disable/reject the GetTopBid route on non-submission instances to give clients a clear error instead of a broken WebSocket upgrade.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@0w3n-d is this a concern? I thought top bid would only be active on submission instance?

@vladimir-ea vladimir-ea merged commit e7b6bdf into develop Mar 19, 2026
3 checks passed
@vladimir-ea vladimir-ea deleted the ve/top_bid_tile branch March 19, 2026 09:46
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.

3 participants