Skip to content

fix(channels): honour NO_PROXY in discord, webex and wecom clients - #40488

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
autobuild/40249
Nov 22, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
autobuild/40249

Conversation

@KiroCrewAutoBuilder

Copy link
Copy Markdown
Collaborator

Problem / Motivation

Goal: A host the operator lists in NO_PROXY is reached directly by the Discord, Webex and WeCom channels, as Slack and Telegram already do.

The Discord, Webex and WeCom clients pick one forward proxy from the environment at start-up and send every request and WebSocket through it. None of them reads `NO_PROXY`. So on a network where the proxy refuses a channel host that is reachable directly, listing that host in `NO_PROXY` does nothing, and the channel fails to connect.

Why it matters

Operators behind a corporate proxy use `NO_PROXY` to send some hosts direct. Today those three channels ignore it: they stay down on such a network, and the only workaround is to remove the proxy for the whole gateway. Slack and Telegram already honour the list, so the channels behave differently under the same environment.

Not a goal

- Changing how the single proxy is resolved at start-up (`HTTPS_PROXY` / `HTTP_PROXY` / `ALL_PROXY` order).
- WeCom's attachment-ingest session and the dashboard's Discord and Webex credential checks: they keep the single resolved proxy.
- Reading OS-level proxy settings (macOS / Windows registry) per request.

What changed (motivation → approach → change)

Symptom: a `NO_PROXY` host still goes through the proxy. Cause: each client passes its start-up `self._proxy` to every aiohttp call and never checks the destination against the bypass list.

Fix: a new shared helper, `kiro_crew.http_proxy.proxy_for_url(proxy, url)`. It returns `None` when `NO_PROXY` lists the URL's host (or `host:port`), and the given proxy otherwise. It reads only the environment (`urllib.request.proxy_bypass_environment`), so it is cheap enough to call per request on the event loop. That is the "environment only" rule the issue suggests.

| Client | Calls that now check the destination |
|---|---|
| Discord | REST ladder (`client_rest._api_request`), gateway WebSocket (`client_gateway._run_connection`), attachment download |
| Webex | `_api`, file upload, content HEAD/GET, U2C discovery, device create/list, Mercury WebSocket |
| WeCom | reply POST, WebSocket connect |

The messaging spec (`docs/system-specs/modules/messaging.md`) says which paths honour `NO_PROXY` and which keep the single proxy.

Backwards compatibility

Compatible: with NO_PROXY unset, 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).

- `test/test_http_proxy.py`: `proxy_for_url` covers a bare host, a leading-dot suffix, `*`, a matching and a non-matching `host:port`, `ws://` default port, an unrelated host, an unparsable URL, a bad port, and no proxy at all.
- `test/test_channel_proxy_bypass.py`: drives each Discord, Webex and WeCom call site through a recording fake session. It asserts the proxy is used with an empty `NO_PROXY` and is `None` when `NO_PROXY` lists the channel hosts.
- `test_a_real_session_goes_direct_for_a_no_proxy_host` (same file): end to end over loopback, with aiohttp's real `ClientSession`, a recording proxy that refuses (502) and a destination that accepts. With `NO_PROXY` empty the reply reaches the proxy. With `NO_PROXY=127.0.0.1` it reaches the destination directly and is delivered.

Proof: PROVEN test/test_channel_proxy_bypass.py::test_discord_paths_honour_no_proxy[discord.com,discord.gg,discordapp.com,webexapis.com,wbx2.com,weixin.qq.com-None], test/test_channel_proxy_bypass.py::test_webex_paths_honour_no_proxy[discord.com,discord.gg,discordapp.com,webexapis.com,wbx2.com,weixin.qq.com-None], test/test_channel_proxy_bypass.py::test_wecom_paths_honour_no_proxy[discord.com,discord.gg,discordapp.com,webexapis.com,wbx2.com,weixin.qq.com-None], test/test_channel_proxy_bypass.py::test_a_real_session_goes_direct_for_a_no_proxy_host[127.0.0.1-False] (head b3e1e419a17e)

Runs (`python3 -m pytest`):
- `test/test_http_proxy.py`, `test/test_channel_proxy_bypass.py` and every test file that references the changed modules (86 files), plus `test/test_chat_slot_reasoning_effort.py` and `test/test_chat_mode_internal_auth_gate.py` at the end, `-n 2`: 3369 passed, 1 skipped, 1 failed. The failure is `test_remote_git_relay_isolation.py::test_an_overrun_lookup_reaps_a_descendant_holding_its_stdout`, a process-reaping test. It fails alone too in this sandbox and touches no code this PR changes.
- The new tests with `test_chat_slot_reasoning_effort.py`, `test_decisions_model_route_apply.py`, `test_chat_mode_internal_auth_gate.py` and `test_dashboard_approval_modes.py` in one process, `-n0`: all passed. An earlier verify shard reported these dashboard tests red "in the full run, green alone". They do not reproduce next to this change. The new test patches only the environment, through the floor fixture, and its clients' own sessions.
- `test/test_flake_pattern_ratchet.py`: 75 passed.
- After the loopback test was added: the two new or changed test files, the WeCom, Webex and Discord client test files, and the flake ratchet, `-n 2`: 534 passed.

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.

backend-1: test/test_messaging_script_hooks.py::test_a_timed_out_hook_with_a_detached_child_does_not_hang_the_turn
backend-1: test/test_remote_git_relay_isolation.py::test_an_overrun_lookup_reaps_a_descendant_holding_its_stdout
backend-1: test/test_session_token_identity.py::TestGrantedOptInResolution::test_every_opt_in_server_resolves_only_under_the_flag
backend-2: test/test_codex_usage.py::test_the_usage_route_carries_the_reading
backend-2: test/test_cli_manifest_signature.py::test_a_wedged_grandchild_does_not_outlive_the_bounded_run
backend-3: test/test_codex_session_mcp.py::test_the_driver_runner_reaps_descendants_on_the_timeout_path
backend-5: test/test_governance_chokepoints.py::TestFilesystemEgressAtGate::test_an_expansion_dependent_argument_keeps_the_reading_title[/srv/$PWD/note.txt]
backend-5: test/test_pid_lifecycle_provider_tree.py::TestSyncKillProviderTree::test_a_zombie_descendant_does_not_count_as_running
backend-5: test/test_pid_lifecycle_provider_tree.py::TestSyncKillProviderTree::test_setsid_grandchild_is_reaped
backend-5: test/test_pid_lifecycle_provider_tree.py::TestSyncKillProviderTree::test_in_group_grandchild_is_reaped
backend-5: test/test_pid_lifecycle_provider_tree.py::TestSyncKillProviderTree::test_the_tree_stops_even_where_the_root_cannot_be_identified_after_it_exits
backend-5: test/test_pid_lifecycle_provider_tree.py::TestSyncKillProviderTree::test_group_signal_alone_reaps_the_tree
backend-5: test/test_pod_e2e_harness_paths.py::test_health_accepts_the_pods_own_serving_codes
backend-5: test/test_pod_e2e_harness_paths.py::test_health_refuses_a_foreign_port_holder_and_names_the_conflict
backend-5: test/test_pid_lifecycle_provider_tree.py::TestSyncKillProviderTree::test_group_is_recovered_when_the_leader_was_reaped_before_teardown
backend-5: test/test_pod_e2e_harness_paths.py::test_health_survives_every_bad_timeout_override[-5-leading '-' is a non-digit, and a past deadline fakes a timeout]
backend-5: test/test_pod_e2e_harness_paths.py::test_health_survives_every_bad_timeout_override[abc-read as a variable NAME inside $(( )); set -u kills the run]
backend-5: test/test_pod_e2e_harness_paths.py::test_health_survives_every_bad_timeout_override[999999999999999999999999-no error, but the deadline lands centuries out]
backend-5: test/test_pod_e2e_harness_paths.py::test_health_survives_every_bad_timeout_override[6 0-whitespace is not a digit]
backend-5: test/test_pod_e2e_harness_paths.py::test_health_accepts_a_valid_timeout_override[5]
backend-5: test/test_pod_e2e_harness_paths.py::test_health_accepts_a_valid_timeout_override[08]
backend-5: test/test_pod_e2e_harness_paths.py::test_health_accepts_a_valid_timeout_override[60]
backend-5: test/test_pod_e2e_harness_paths.py::test_health_probes_at_least_once_when_the_clock_ticks_past_the_deadline
backend-5: test/test_pod_e2e_harness_paths.py::test_handle_refuses_a_name_that_differs_from_the_argument
backend-5: test/test_pod_e2e_harness_paths.py::test_handle_refuses_a_missing_name
backend-5: test/test_pod_e2e_harness_paths.py::test_handle_refuses_a_name_that_is_not_a_non_empty_string[]
backend-5: test/test_pod_e2e_harness_paths.py::test_handle_refuses_a_name_that_is_not_a_non_empty_string[0]
backend-5: test/test_pod_e2e_harness_paths.py::test_handle_refuses_a_name_that_is_not_a_non_empty_string[None]
backend-5: test/test_pod_e2e_harness_paths.py::test_handle_accepts_a_name_that_matches_the_argument
backend-5: test/test_pod_e2e_harness_paths.py::test_handle_refuses_a_missing_health_at_the_door
backend-5: test/test_pod_e2e_harness_paths.py::test_a_bad_handle_is_refused_at_the_door[{"name": "smoke", "base_url": "http://127.0.0.1:7811", "token": "[redacted]", "port": 7811, "health": 200}-None]
backend-5: test/test_pod_e2e_harness_paths.py::test_a_bad_handle_is_refused_at_the_door[{"name": "smoke", "base_url": "http://localhost:7811", "token": "[redacted]", "port": "7811", "health": 200}-None]
backend-5: test/test_pod_e2e_harness_paths.py::test_a_bad_handle_is_refused_at_the_door[{"name": "smoke", "base_url": "http://[::1]:7811", "token": "[redacted]", "port": 7811, "health": 200}-None]
backend-5: test/test_pod_e2e_harness_paths.py::test_a_bad_handle_is_refused_at_the_door[not json at all-not readable JSON]
backend-5: test/test_pod_e2e_harness_paths.py::test_a_bad_handle_is_refused_at_the_door[["base_url"]-not a JSON object]
backend-5: test/test_pod_e2e_harness_paths.py::test_a_bad_handle_is_refused_at_the_door[{"name": "smoke", "base_url": "http://127.0.0.1:7811"}-needs a non-empty base_url and token]
backend-5: test/test_pod_e2e_harness_paths.py::test_a_bad_handle_is_refused_at_the_door[{"token": "[redacted]"}-needs a non-empty base_url and token]
backend-5: test/test_pod_e2e_harness_paths.py::test_a_bad_handle_is_refused_at_the_door[{"name": "smoke", "base_url": "", "token": ""}-needs a non-empty base_url and token]
backend-5: test/test_pod_e2e_harness_paths.py::test_a_bad_handle_is_refused_at_the_door[{"name": "smoke", "base_url": "http://127.0.0.1:5476", "token": "[redacted]", "port": "05476", "health": 200}-port must be a canonical decimal integer in 1..65535]
backend-5: test/test_pod_e2e_harness_paths.py::test_a_bad_handle_is_refused_at_the_door[{"name": "smoke", "base_url": "http://127.0.0.1:7811", "token": "[redacted]", "port": " 7811", "health": 200}-port must be a canonical decimal integer in 1..65535]
backend-5: test/test_pod_e2e_harness_paths.py::test_a_bad_handle_is_refused_at_the_door[{"name": "smoke", "base_url": "http://127.0.0.1:7811", "token": "[redacted]", "port": "+7811", "health": 200}-port must be a canonical decimal integer in 1..65535]
backend-5: test/test_pod_e2e_harness_paths.py::test_a_bad_handle_is_refused_at_the_door[{"name": "smoke", "base_url": "http://127.0.0.1:7811", "token": "[redacted]", "port": 7811.0, "health": 200}-port must be a canonical decimal integer in 1..65535]
backend-5: test/test_pod_e2e_harness_paths.py::test_a_bad_handle_is_refused_at_the_door[{"name": "smoke", "base_url": "http://127.0.0.1:1", "token": "[redacted]", "port": 0, "health": 200}-port must be a canonical decimal integer in 1..65535]
backend-5: test/test_pod_e2e_harness_paths.py::test_a_bad_handle_is_refused_at_the_door[{"name": "smoke", "base_url": "http://127.0.0.1:65535", "token": "[redacted]", "port": 65536, "health": 200}-port must be a canonical decimal integer in 1..65535]
backend-5: test/test_pod_e2e_harness_paths.py::test_a_bad_handle_is_refused_at_the_door[{"name": "smoke", "base_url": "http://127.0.0.1:5476", "token": "[redacted]", "port": 5476, "health": 200}-base_url port 5476 is the configured live plane]
backend-5: test/test_pod_e2e_harness_paths.py::test_a_bad_handle_is_refused_at_the_door[{"name": "smoke", "base_url": "http://127.0.0.1:7777", "token": "[redacted]", "port": 7777, "health": 200}-base_url port 7777 is reserved for a production gateway]
backend-5: test/test_pod_e2e_harness_paths.py::test_a_bad_handle_is_refused_at_the_door[{"name": "smoke", "base_url": "http://127.0.0.1:7812", "token": "[redacted]", "port": 7811, "health": 200}-does not match base_url port]
backend-5: test/test_pod_e2e_harness_paths.py::test_a_bad_handle_is_refused_at_the_door[{"name": "smoke", "base_url": "http://127.0.0.1:7811", "token": "[redacted]"}-canonical decimal]
backend-5: test/test_pod_e2e_harness_paths.py::test_a_bad_handle_is_refused_at_the_door[{"name": "smoke", "base_url": "http://127.0.0.1:7811", "token": "[redacted]", "port": 7811, "health": 200}-token contains whitespace or a control character]
backend-5: test/test_pod_e2e_harness_paths.py::test_a_bad_handle_is_refused_at_the_door[{"name": "smoke", "base_url": "http://127.0.0.1:7811", "token": "[redacted]", "port": 7811, "health": 200}-token contains characters outside the generated token format]
backend-5: test/test_pod_e2e_harness_paths.py::test_a_bad_handle_is_refused_at_the_door[{"name": "smoke", "base_url": "http://127.0.0.1:7811/ bad", "token": "[redacted]", "port": 7811, "health": 200}-base_url contains whitespace or a control character]
backend-5: test/test_pod_e2e_harness_paths.py::test_a_bad_handle_is_refused_at_the_door[{"name": "smoke", "base_url": "http://10.0.0.5:7811", "token": "[redacted]", "port": 7811, "health": 200}-is not loopback]
backend-5: test/test_pod_e2e_harness_paths.py::test_a_bad_handle_is_refused_at_the_door[{"name": "smoke", "base_url": "http://127.0.0.1", "token": "[redacted]", "port": 7811, "health": 200}-explicit port]
backend-5: test/test_pod_e2e_harness_paths.py::test_a_bad_handle_is_refused_at_the_door[{"name": "smoke", "base_url": "https://127.0.0.1:7811", "token": "[redacted]", "port": 7811, "health": 200}-must be http]
backend-5: test/test_pod_e2e_harness_paths.py::test_a_bad_handle_is_refused_at_the_door[{"name": "smoke", "base_url": "http://127.0.0.1:7811", "token": "[redacted]", "port": 7811, "health": 200, "checkout": 42}-checkout must be a string]
backend-5: test/test_pod_e2e_harness_paths.py::test_handle_refuses_the_configured_live_port
backend-6: test/test_crew_log_previous_latch.py::TestTheAnswerSurvivesTheProcess::test_a_new_process_cites_the_store_the_old_one_opened
backend-6: test/test_crew_log_previous_latch.py::TestTheAnswerSurvivesTheProcess::test_a_new_process_still_has_the_mapping_for_a_slot_with_no_unit
backend-6: test/test_kiro_prerequisite_sandbox.py::TestTimedOutProbeIsNotAMissingBinary::test_a_persistent_timeout_warns_once_not_once_per_probe
backend-6: test/test_process_tree_refresh.py::TestLateChildrenVouchAfterARefresh::test_a_group_member_the_leader_cannot_reach_is_not_recorded_and_cannot_vouch
backend-6: test/test_usage.py::TestApiKiroUsage::test_slow_session_scan_returns_billing_then_refreshes
backend-6: test/test_usage.py::TestApiKiroUsage::test_fresh_fetch
backend-6: test/test_usage.py::TestApiKiroUsage::test_error_not_cached
backend-6: test/test_usage.py::TestApiKiroUsage::test_carries_the_token_history_of_the_usage_shards
backend-6: test/test_usage.py::TestApiKiroUsage::test_an_unreadable_directory_still_answers_the_full_shape
backend-6: test/test_usage.py::TestApiKiroUsage::test_missing_directory_preserves_billing_and_refreshes
backend-6: test/test_usage.py::TestApiKiroUsage::test_unavailable_sentinel_yields_empty_billing
backend-10: test/test_acp_client_process_lifecycle.py::TestIsOurChild::test_basename_check[own_pid_matches_with_basename]
backend-10: test/test_acp_client_process_lifecycle.py::TestIsOurChild::test_basename_check[basename_match_returns_true]
backend-10: test/test_acp_client_process_lifecycle.py::TestIsOurChild::test_basename_check[novel_binary_tracked]
backend-10: test/test_acp_client_process_lifecycle.py::TestReadBasename::test_reads_basename_from_ps
backend-10: test/test_codex_host_binary.py::TestVersionChild::test_timeout_kills_and_reaps_the_probe_tree
backend-10: test/test_opencode_session_mcp.py::test_the_driver_runner_reaps_descendants_on_the_timeout_path
backend-11: test/test_node_modules_txn.py::TestAsyncBuild::test_a_cancel_while_npm_starts_kills_its_group
backend-12: test/test_env.py::TestAugmentedPath::test_windows_drops_the_fixed_posix_roots

Manual verification

The loopback before/after run under Real-machine verification. Still to do: a real proxy with the live channel hosts, on a networked machine.

Real-machine verification

Run on one machine over loopback only: a real aiohttp `ClientSession`, a local proxy that refuses with 502, and a local destination. This build environment has no network, no credentials and no way to start a cloud machine, so live Discord, Webex and WeCom endpoints were not used.

Machine: the Builder's build sandbox (own computer, no cloud machine), Linux 6.1, Python 3.12.16
Before (base 14f56a951468, WeCom's reply line back to `proxy=self._proxy` with nothing else changed): `python3 -m pytest -n0 test/test_channel_proxy_bypass.py -k real_session` -> `[127.0.0.1-False]` FAILED, `assert ['proxy'] == ['destination']`, logged `WeCom reply failed: http=502, platform refused`. The host was on `NO_PROXY`, yet the reply went through the refusing proxy.
After (this patch): the same command -> 2 passed. With `NO_PROXY=127.0.0.1` the reply went direct and was delivered; with `NO_PROXY` empty it still used the proxy.
Cleanup: own computer; the loopback servers close when the test exits, and no files, processes or cloud resources remain.

To do: the same check against a real HTTPS proxy and the live channel hosts needs a networked machine, which a maintainer can run with the steps in the issue (`HTTPS_PROXY` set, the channel host in `NO_PROXY`).

Screenshots / video

N/A — the patch touches no UI path.

Related Issues

Closes #40249

The issue this fixes is linked automatically.

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.proxy keeps the single proxy, as the spec says

Pattern harvest

Rule candidate: review-prompt

Pattern: an outbound aiohttp call passes a start-up proxy (proxy=self._proxy) without checking the destination against NO_PROXY through kiro_crew.http_proxy

Checklist

- [x] A Conventional Commits title (`feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...`); PR Hygiene does not count commits
- [x] Existing tests pass and new tests added for new functionality
- [x] Self-review completed; code follows project style guidelines
- [x] Documentation updated (if applicable)
- [x] No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributed under the project's Apache-2.0 license.

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.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 4d9aad113064a4c71bdb2243c5b8cce9cf70bfff touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 4d9aad113064a4c71bdb2243c5b8cce9cf70bfff — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks. The fix is a small shared helper that the existing http_proxy owner already hosts, and it only narrows the proxy where the operator's own NO_PROXY lists a host.

Notes

  • proxy_for_url and resolve_proxy in http_proxy.py both turn a URL into a host:port bypass check, but they parse it differently (wss default port, ValueError handling). Having resolve_proxy reuse that parsing would leave one bypass rule rather than two that can drift.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 4d9aad113064a4c71bdb2243c5b8cce9cf70bfff — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks: the fix acts on the cause in all three clients. The description wrongly says Telegram already honours NO_PROXY, and Telegram keeps the same gap.

Notes

  • Item 4 — symptom-level (1 unfixed sibling): the description says "Slack and Telegram already honour the list". But telegram/client_http.py:176 _proxy_for bypasses only loopback and otherwise returns self._proxy. The pattern proxy=self._proxy passed per request with no NO_PROXY check appears in 4 channel clients, and this PR fixes 3. Subtraction: replace the body of Telegram's _proxy_for with None if _url_is_loopback(url) else proxy_for_url(self._proxy, url), or drop Telegram from the "already honour" claim.

What this change ships

Inventory (4 items) — 3 justified

Intent: an operator behind a corporate proxy wants hosts listed in NO_PROXY reached directly by the Discord, Webex and WeCom channels. This is a FIX.

  1. Discord REST, gateway WebSocket and attachment downloads go direct to a NO_PROXY host — justified
  2. Webex API, upload, content, U2C, device and Mercury WebSocket go direct to a NO_PROXY host — justified
  3. WeCom reply POST and WebSocket go direct to a NO_PROXY host — justified
  4. New public helper http_proxy.proxy_for_url that checks the environment only — symptom-level: the Telegram sibling is unfixed and the description claims it already works

[FIRST-PRINCIPLES-REVIEWED] 4d9aad1

Description read

[DESCRIPTION-READ] 424ade4247759370726d856e38b48ddbc51b8270964ec08d34885c4c0a68c0a4

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 4d9aad113064a4c71bdb2243c5b8cce9cf70bfff — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 4d9aad1

Verdict parsed from the review's SHA-scoped output markers for commit 4d9aad113064a4c71bdb2243c5b8cce9cf70bfff.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 4d9aad113064a4c71bdb2243c5b8cce9cf70bfff false-positive: <reason, 20 to 500 characters>

@github-actions

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 4d9aad113064a4c71bdb2243c5b8cce9cf70bfff and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 4d9aad1

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 4d9aad113064a4c71bdb2243c5b8cce9cf70bfff false-positive: <reason, 20 to 500 characters>

@KiroCrewAutoBuilder
KiroCrewAutoBuilder marked this pull request as ready for review November 22, 2026 00:38
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 22, 2026
@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: 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 http_proxy.proxy_for_url, a helper that reads only the environment. It wraps it with urllib.request.proxy_bypass_environment("host:port"), which strips the port and matches the bare host, a host:port entry, a dot-suffix or *. The helper is used at every per-request proxy call site in the Discord, Webex and WeCom clients. I grepped for proxy= under discord/, webex/ and wecom/, and every client call site now goes through the helper, with the same URL it sends to. The only paths still on the single proxy are the ones the PR lists as out of scope: WeCom attachment ingest, the dashboard credential checks, and the Discord intent probe. With NO_PROXY unset, proxy_bypass_environment returns False and the result is the old self._proxy, so nothing changes. A bypass can only come from the operator's own environment, so no trust boundary is weakened. The sessions use aiohttp's default trust_env=False, so proxy=None really does mean a direct connection. The tests cover the helper's edge cases, each client's call sites through a recording session, and a real loopback run with a proxy that refuses (it fails without the fix). CI is green.

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 4d9aad1130 · 312 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@KiroCrewCaptain
KiroCrewCaptain enabled auto-merge (squash) November 22, 2026 01:52

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 in src/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 in proxy_for_url is 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.

@KiroCrewCaptain
KiroCrewCaptain merged commit 0385782 into main Nov 22, 2026
106 of 114 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the autobuild/40249 branch November 22, 2026 01:52
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Discord and Webex clients send every host through the proxy and ignore NO_PROXY

2 participants