Repository navigation
fix(provider-core): opt out of proxy discovery for qualification - #122
KooshaPari wants to merge 1 commit into
Conversation
Use the supported no_proxy builder API only for exact KCODE_QUALIFICATION_NO_PROXY=1. Preserve normal proxy behavior and exercise shared/fresh clients under identical Mach and network denial. Focused regression: 3 passed, 0 failed; cargo check -p jcode-provider-core --jobs 1 passed. Refs #11. tx-agent: codex tx-validated: cargo-check tx-scope: qualification
🤖 CodeAnt AI — Review Status
|
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📜 Recent review details
📝 Summary
Merge Risk: ⚪ Minimal · up to
|
CodeAnt PR Risk: Low Risk
Assessed commit: |
| // Do not reintroduce system-proxy discovery via Client::new on a fallback. | ||
| builder() | ||
| .build() | ||
| .expect("failed to build qualification provider HTTP client") |
There was a problem hiding this comment.
WARNING: Panic in library code via .expect().
fallback_client() panics if builder().build() fails. The original code gracefully degraded to reqwest::Client::new() on build failure. Library code should avoid panicking; propagate or handle the error instead.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| std::env::var_os("KCODE_QUALIFICATION_NO_PROXY").as_deref() == Some(OsStr::new("1")) | ||
| } | ||
|
|
||
| pub(crate) fn builder() -> reqwest::ClientBuilder { |
There was a problem hiding this comment.
SUGGESTION: Missing doc comment on pub(crate) fn builder().
CodeRabbit's pre-merge check requires 80% docstring coverage; current coverage is 41.67%. Add a doc comment explaining what the builder does and when no_proxy() is applied.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| } | ||
| } | ||
|
|
||
| pub(crate) fn fallback_client() -> reqwest::Client { |
There was a problem hiding this comment.
SUGGESTION: Missing doc comment on pub(crate) fn fallback_client().
CodeRabbit's pre-merge check requires 80% docstring coverage; current coverage is 41.67%. Add a doc comment explaining the fallback behavior and the panic-on-error path.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
Code Review SummaryStatus: 3 Issues Found | Recommendation: Address before merge
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (5 files)
Fix these issues in Kilo Cloud Reviewed by free · Input: 65.3K · Output: 18.7K · Cached: 173.4K |
User description
Under the Mach-denied qualification sandbox, constructing the shared provider HTTP client panicked during macOS system-proxy discovery before passive ACP attachment could proceed. Exact
KCODE_QUALIFICATION_NO_PROXY=1now applies reqwest's supportedClientBuilder::no_proxy()API to generic shared/fresh clients and their fallback construction. Unset and all other values preserve the existing proxy behavior, shared cache, timeouts, pooling, and User-Agent. Dependency features and sandbox grants remain unchanged.The flag belongs only in the isolated child environment before startup. It does not enforce offline operation or change independently constructed clients. Full daemon/ACP and installed-binary qualification remain open.
Validation: baseline RED had two intended failures; the final focused suite passes 3/3. Real clients preserve unset/invalid-value loopback proxy routing, bypass it only for exact opt-in, and build with Mach/network denied only in the opted-in case while the normal-mode NULL panic remains the negative control. The shared cache and fresh-client paths are exercised. The test fixture explicitly sets accepted sockets to blocking before bounded reads and preserves primary failures during cleanup.
cargo check -p jcode-provider-core --jobs 1, scoped formatting, andgit diff --checkpass. No whole suite or hosted/runtime acceptance is claimed.Refs #11. Fork-only delivery to KooshaPari/KCode; no install, shared-daemon restart, upstream publication, merge, or release.
CodeAnt-AI Description
Prevent proxy-discovery crashes in restricted provider qualification
What Changed
Impact
✅ Provider clients start in Mach-restricted qualification✅ Opted-in qualification skips proxy discovery✅ Default proxy routing remains unchanged💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.