Skip to content

Fix/enterprise sso region - #261

Open
sandu-c wants to merge 10 commits into
jwadow:mainfrom
sandu-c:fix/enterprise-sso-region
Open

Fix/enterprise sso region#261
sandu-c wants to merge 10 commits into
jwadow:mainfrom
sandu-c:fix/enterprise-sso-region

Conversation

@sandu-c

@sandu-c sandu-c commented Jul 26, 2026

Copy link
Copy Markdown

No description provided.

xanduc added 9 commits April 6, 2026 18:11
- Respect KIRO_REGION env var for API endpoint instead of letting
  credentials file override it (credentials region stored as SSO region)
- Send profileArn for all auth types when available, not just Kiro Desktop
  (Enterprise SSO OIDC accounts need it too)
- Log 403 response body for easier debugging
Some clients send the API key without the Bearer prefix.
Accept both 'Bearer {key}' and raw '{key}' formats.
When upstream provider accepts connection but stops sending data,
the gateway would hang forever (httpx read timeout resets on TCP
keepalives). Add application-level inactivity timeout (300s default)
that tracks time since last actual data chunk.

Also adds periodic progress logging (every 60s) for long-running
streams so operators have visibility into in-flight requests.

New env vars: STREAMING_INACTIVITY_TIMEOUT, STREAMING_LOG_INTERVAL
When the upstream (Kiro/AWS API) accepts the TCP connection but never
sends HTTP response headers, the gateway hangs indefinitely. This was
the primary cause of today's outages — the retry after a 500 would
send a new request that never got a response.

Add RESPONSE_HEADERS_TIMEOUT (120s default) using asyncio.wait_for
on the streaming client.send() call. Only applies to the pre-streaming
phase; once headers arrive and streaming starts, the existing
inactivity timeout governs.

New env var: RESPONSE_HEADERS_TIMEOUT
Hermes sends the API key without the Bearer prefix. Accept both
formats to maintain compatibility.
# Conflicts:
#	kiro/routes_anthropic.py
#	kiro/routes_openai.py
@cla-bot

cla-bot Bot commented Jul 26, 2026

Copy link
Copy Markdown

Thanks for the PR! 🎉

Before merge, we need a one-time CLA confirmation.
It confirms that you have the right to contribute this code and allow the project to use it.

Full CLA text:
https://github.com/jwadow/kiro-gateway/blob/main/CLA.md

Please reply once with:

I have read the CLA and I accept its terms

You need to write once, all further messages from me can be ignored.

@sandu-c
sandu-c force-pushed the fix/enterprise-sso-region branch from c005691 to fdd8498 Compare July 26, 2026 13:18
@cla-bot

cla-bot Bot commented Jul 26, 2026

Copy link
Copy Markdown

Thanks for the PR! 🎉

Before merge, we need a one-time CLA confirmation.
It confirms that you have the right to contribute this code and allow the project to use it.

Full CLA text:
https://github.com/jwadow/kiro-gateway/blob/main/CLA.md

Please reply once with:

I have read the CLA and I accept its terms

You need to write once, all further messages from me can be ignored.

@sandu-c
sandu-c force-pushed the fix/enterprise-sso-region branch from fdd8498 to 516fab1 Compare July 26, 2026 14:25
@cla-bot

cla-bot Bot commented Jul 26, 2026

Copy link
Copy Markdown

Thanks for the PR! 🎉

Before merge, we need a one-time CLA confirmation.
It confirms that you have the right to contribute this code and allow the project to use it.

Full CLA text:
https://github.com/jwadow/kiro-gateway/blob/main/CLA.md

Please reply once with:

I have read the CLA and I accept its terms

You need to write once, all further messages from me can be ignored.

Gateway has two request paths:
1. Multi-account failover loop (already had retry)
2. Single-request path (was missing retry)

Added retry with 3s/6s delay to the single-request path which is
where ALL actual requests go. Now retries up to 2 times on
INVALID_MODEL_ID before returning error.
@sandu-c
sandu-c force-pushed the fix/enterprise-sso-region branch from 516fab1 to 2693901 Compare July 26, 2026 15:31
@cla-bot

cla-bot Bot commented Jul 26, 2026

Copy link
Copy Markdown

Thanks for the PR! 🎉

Before merge, we need a one-time CLA confirmation.
It confirms that you have the right to contribute this code and allow the project to use it.

Full CLA text:
https://github.com/jwadow/kiro-gateway/blob/main/CLA.md

Please reply once with:

I have read the CLA and I accept its terms

You need to write once, all further messages from me can be ignored.

@ankitcharolia

Copy link
Copy Markdown

@sandu-c could you give a try to this gateway: https://github.com/ankitcharolia/kiro-gateway

It works quite well with All AI harness and actively being developed. The most important thing is that it is ACP compliant

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.

3 participants