#22794: fix: allow local clients to auto-pair without manual approval
gateway
size: XS
Cluster:
Device Pairing and Gateway Fixes
When a local client (127.0.0.1/loopback) connects and needs pairing or scope/role upgrade, the silent mode should auto-approve. This fix:
1. Changes silent=true for ALL local client pairing requests (not just not-paired)
2. Adds return true after successful auto-approval to prevent rejection
This resolves issues where local sub-agents cannot connect because they get stuck in pairing loop.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Extends auto-pairing for local clients from just initial pairing to include role and scope upgrades, preventing local sub-agents from getting stuck in pairing loops. Changes `silent` flag to apply to all local client pairing scenarios (not just "not-paired"), enabling automatic approval without manual intervention.
<h3>Confidence Score: 4/5</h3>
- This PR is safe to merge with low risk - it's a focused fix for local client auto-pairing
- The changes correctly extend silent mode auto-approval to all local client pairing scenarios (not just initial pairing). The added early return on line 756 makes the control flow explicit. One minor consideration: when `approveDevicePairing` returns null (request doesn't exist), local clients still proceed with connection, which appears intentional for the local trust model but could mask edge cases where the pairing state is inconsistent
- No files require special attention - the single-file change is straightforward and well-scoped
<sub>Last reviewed commit: 2a913e1</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#22253: fix: auto-approve local loopback pairing for role/scope upgrades
by cjpraia · 2026-02-20
90.0%
#22587: fix(gateway): silently auto-approve local paired-device scope upgrades
by abhishekp76 · 2026-02-21
88.1%
#22712: fix(gateway): auto-approve all device pairing for localhost connect...
by NewdlDewdl · 2026-02-21
86.4%
#23708: fix(gateway): auto-approve scope upgrades for loopback clients
by widingmarcus-cyber · 2026-02-22
85.2%
#22280: fix(gateway): silently auto-approve local paired-device scope upgrades
by abhishekp76 · 2026-02-21
84.9%
#21666: fix(gateway): restrict auto-paired device scopes to safe defaults
by AI-Reviewer-QS · 2026-02-20
83.9%
#17425: fix(gateway): auto-approve scope/role upgrades for already-paired d...
by sauerdaniel · 2026-02-15
82.9%
#23690: fix(gateway): subagent sessions fail with pairing required on loopb...
by yinghaosang · 2026-02-22
81.2%
#22365: fix(gateway): auto-approve loopback scope upgrades
by AIflow-Labs · 2026-02-21
79.5%
#19088: fix(gateway): allow startup with unset mode and fix pairing for local…
by mdanassaif · 2026-02-17
77.9%