Skip to content

Gate API key to OAuth token exchange on oauth_exchange == true#1148

Merged
ericmj merged 1 commit into
mainfrom
ericmj/fix-oauth-exchange-gating
Apr 24, 2026
Merged

Gate API key to OAuth token exchange on oauth_exchange == true#1148
ericmj merged 1 commit into
mainfrom
ericmj/fix-oauth-exchange-gating

Conversation

@ericmj
Copy link
Copy Markdown
Member

@ericmj ericmj commented Apr 24, 2026

The second-priority branch in build_hex_core_config attempted to exchange
the API key for an OAuth token whenever auth_key and trusted were set,
relying on the first branch to short-circuit for the disabled case. That
left the branch's condition incomplete: any state not caught by branch 1
would fire exchange, even states that should not (e.g. organization
repos propagated from a parent without oauth_exchange set, which resolve
to an explicit nil).

Make both branches self-gated on the oauth_exchange flag so the
intent is local to each clause. Also clarify preflight comments in
remote_converger.

The second-priority branch in build_hex_core_config attempted to exchange
the API key for an OAuth token whenever auth_key and trusted were set,
relying on the first branch to short-circuit for the disabled case. That
left the branch's condition incomplete: any state not caught by branch 1
would fire exchange, even states that should not (e.g. organization
repos propagated from a parent without oauth_exchange set, which resolve
to an explicit nil).

Make both branches self-gated on the oauth_exchange flag so the
intent is local to each clause. Also clarify preflight comments in
remote_converger.
@ericmj ericmj force-pushed the ericmj/fix-oauth-exchange-gating branch from 9600449 to 6410ea9 Compare April 24, 2026 13:42
@ericmj ericmj merged commit 573f566 into main Apr 24, 2026
20 checks passed
@ericmj ericmj deleted the ericmj/fix-oauth-exchange-gating branch April 24, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant