Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,8 @@ todo = "deny"
unimplemented = "deny"
disallowed_methods = "deny"
disallowed_macros = "deny"

# Bounded SSE replay fairness; keep HTTP and core channel types on one revision.
[patch.crates-io]
agentkit-acp-http = { git = "https://github.com/danielkov/rust-sdk", rev = "03eab519aa5ecfc97a43bf17f9721c38c065c47b" }
agentkit-acp-sdk = { git = "https://github.com/danielkov/rust-sdk", rev = "03eab519aa5ecfc97a43bf17f9721c38c065c47b" }
13 changes: 7 additions & 6 deletions src/gateway/http_client/recovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,9 @@ pub(super) async fn run(
Timeout,
}
let event = {
// select polls its left branch first. Keep timeout > driver >
// inbound frame > stdin priority; disabled branches never poll
// select polls its left branch first. Drain admitted inbound
// frames before driving more HTTP work: timeout > inbound frame
// > driver > stdin. Disabled branches never poll
// their underlying receiver or deadline.
let timeout = std::pin::pin!(async {
if phase != "live" {
Expand All @@ -340,11 +341,11 @@ pub(super) async fn run(
std::future::pending().await
}
});
match select(timeout, select(&mut transport, select(frame, line))).await {
match select(timeout, select(frame, select(&mut transport, line))).await {
Either::Left(_) => Event::Timeout,
Either::Right((Either::Left((result, _)), _)) => Event::Driver(result),
Either::Right((Either::Right((Either::Left((frame, _)), _)), _)) => {
Event::Frame(frame)
Either::Right((Either::Left((frame, _)), _)) => Event::Frame(frame),
Either::Right((Either::Right((Either::Left((result, _)), _)), _)) => {
Event::Driver(result)
}
Either::Right((Either::Right((Either::Right((line, _)), _)), _)) => {
Event::Line(line)
Expand Down
Loading
Loading