Repository navigation
fix(agent): reuse HTTP connections for Future model refreshes - #562
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
reqwest::blocking::Clientfor Future model-catalog refreshes instead of constructing and dropping a connection pool on every/api/v1/modelsrequest.Scope
This fixes the confirmed connection-pool lifetime issue in model-catalog refreshes. It does not claim to eliminate all new connections or speed up model generation. LLM clients already retain their HTTP clients; their SSE terminal/cancellation behavior is deliberately unchanged so completion does not wait for HTTP EOF.
Draft / do not merge: requested for review only.
Validation
Rust 1.97.0, Windows, isolated HOME/USERPROFILE:
cargo fmt -p future-agent --check— passed.cargo clippy -p future-agent --all-targets -- -D warnings— passed.cargo test -p future-agent fetch_future_models_reuses_connection_with_current_credentials— passed. The same regression test failed against the original per-request Client implementation (server observed EOF before the second request).cargo test -p future-agentandcargo test -p future-agent --quiet --no-fail-fast— run; not green on this Windows host. Patched unit suite: 1704 passed, 35 failed, 1 ignored.cli_smoke: 15 passed, 2 failed. All other integration test targets passed.cargo test -p future-agent --quiet --no-fail-fast -- --skip fetch_future_models_reuses_connection_with_current_credentials. Baseline: 1703 passed, the same 35 unit failures, 1 ignored, and the same 2 cli_smoke failures. Restored the fix and reran checks afterward.The pre-existing failures concern Windows/POSIX path assumptions, redirected-home assumptions, Unix shell commands, SQLite file locking, and profile smoke tests. In the changed module, the sole existing failure is
cache_path_falls_back_to_tmp_without_home(/home/x\\.future/...vs/home/x/.future/...). These unrelated issues are not changed in this PR.