fix(skills): bound skill and plugin install HTTP requests - #6851
Merged
Merged
Conversation
The shared platform HTTP client builder sets no timeouts, and the skill installer's client inherited none: a connection that opened but stalled (dead proxy, black-holed route) hung skill and plugin installs and registry sync forever. Plugin installs reuse the skill installer's fetch_tarball machinery, so one client serves both surfaces. Bound the installer client with a tight 10s connect timeout and a generous 600s total request budget — enough for 5 MiB tarballs on slow links while registry sync fans out SYNC_REGISTRY_CONCURRENCY downloads in parallel. A stalled-server regression test pins the bound: the registry fetch must end in a timeout error instead of hanging. Signed-off-by: asto <asto18089@126.com>
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
The shared platform HTTP builder sets no timeouts, and the skill installer's client inherited none: a connection that opened but stalled (dead proxy, black-holed route) hung skill installs, plugin installs (both go through
skills::install::fetch_tarball), and registry sync forever.Bound the installer client with a 10s connect timeout and a 600s total budget — enough for the 5 MiB per-skill cap on slow links while registry sync fans out
SYNC_REGISTRY_CONCURRENCY(8) downloads. A regression test drivesfetch_registryagainst an accept-and-stall server and requires a timeout error instead of a hang; it runs with shortened test-only bounds (cfg!(test)), so it pins the mechanism, not the production values.Testing
cargo test -p codewhale-tui --lib skills::install— stalled-registry test converts the hang into a timeout error (fails without the fix: the outer 30s test bound panics first)cargo clippy -p codewhale-tui --all-targets --all-features --lockedDisclosures: the production 10s/600s numbers themselves are not test-pinned (the behavioral test uses the test shim); an accidental 600→60 change would not be caught. The MCP registry's own client is already bounded and untouched.
Adapted from the Pinvou fork's timeout audit (Pinvou/CodeWhale
d349f2537).Checklist
CHANGELOG.mdchanges