Repository navigation
fix(channels): honour NO_PROXY in discord, webex and wecom clients - #40488
Conversation
Builder-Run: build-40249-14f56a951468
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. The fix is a small shared helper that the existing Notes
[DESIGN-REVIEWED] 4d9aad1 Description read[DESCRIPTION-READ] 417caee228abef3b99a0f13bd373ae4e1ee77133e8add61595992d3cd96f41ef That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: the fix acts on the cause in all three clients. The description wrongly says Telegram already honours Notes
What this change shipsInventory (4 items) — 3 justifiedIntent: an operator behind a corporate proxy wants hosts listed in
[FIRST-PRINCIPLES-REVIEWED] 4d9aad1 Description read[DESCRIPTION-READ] 424ade4247759370726d856e38b48ddbc51b8270964ec08d34885c4c0a68c0a4 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Code change approver recommendation: A person should decideWhy: the decider estimates a 12% chance that this change introduces a defect, within the 12% limit for approving on its own, but it is held at tier pending: being reviewed. The PR adds Tier: pending: being reviewed. An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Review verified on head 4d9aad1. Every aiohttp request and WebSocket the Discord, Webex and WeCom clients make now goes through proxy_for_url. The sessions keep trust_env off, so proxy=None really means a direct connection. The helper reads only the environment's bypass list and makes no DNS call on the event loop. test_http_proxy.py and test_channel_proxy_bypass.py pass (35 tests), and reverting any one of the 13 changed call sites makes at least one test fail. With NO_PROXY unset, or not naming a channel host, every call keeps the same proxy as before.
Done well: the loopback test uses a real aiohttp session with a proxy that refuses the request. That proves the bypass works end to end, which mocks alone could not show.
Optional:
- Open PR #34175 adds
is_bypassed(url, environment_only=True), which applies the same rule, and the two PRs conflict insrc/kiro_crew/http_proxy.py. Whichever lands second should delegate to the other's helper so only one bypass rule remains. Telegram's NO_PROXY handling also arrives with #34175, so it is not on main yet. - The Discord intent probe (
discord/intent_probe.py:126-137) and the Discord and Webex credential checks still use the single proxy. Under NO_PROXY they can now report a failure for a bot that runs fine. Wrapping each inproxy_for_urlis a one-line change. Otherwise, correct the probe comment that says it matches the bot. - No test pins the wss default port of 443. Adding
("gateway.discord.gg:443", "wss://gateway.discord.gg/?v=10", None)to the parametrize would cover it.
Problem / Motivation
Goal: A host the operator lists in
NO_PROXYis reached directly by the Discord, Webex and WeCom channels, as Slack and Telegram already do.Why it matters
Not a goal
What changed (motivation → approach → change)
Backwards compatibility
Compatible: with
NO_PROXYunset, or not naming a channel host, every request uses the same proxy as before. Only a host the operator explicitly listed goes direct.Removes nothing: no key, path, record or function is taken away. One helper is added, and the clients' proxy choice is narrowed only by the operator's own
NO_PROXY.Tests
Every test red on the patched tree in Verify, in
backend-1,backend-2,backend-3,backend-5,backend-6,backend-10,backend-11,backend-12, fails at the base commit in the Builder's verify run as well (below, Red without this patch too).Red without this patch too
These tests fail with the patch, and fail at the base commit in the Builder's verify run as well: the draft PR is opened with them red, and GitHub's CI is likely red on them too. Verify lists at most 50 a shard.
Manual verification
Real-machine verification
Screenshots / video
N/A — the patch touches no UI path.
Related Issues
Closes #40249
Sibling sweep
Swept: git grep -n "proxy=self._proxy" -- src/
Sibling: src/kiro_crew/discord/client_rest.py -- changed here
Sibling: src/kiro_crew/discord/client_gateway.py -- changed here
Sibling: src/kiro_crew/discord/client.py -- changed here
Sibling: src/kiro_crew/webex/client.py -- changed here
Sibling: src/kiro_crew/wecom/client.py -- changed here (reply POST and WebSocket); the attachment-ingest session fed by
WeComClient.proxykeeps the single proxy, as the spec saysPattern harvest
Rule candidate: review-prompt
Pattern: an outbound aiohttp call passes a start-up proxy (
proxy=self._proxy) without checking the destination againstNO_PROXYthroughkiro_crew.http_proxyChecklist
Contribution License Agreement
Draft PR by the Autobuilder (its agent's own words are quoted as code), run
build-40249-14f56a951468. The owner marks it ready for review.