mirror of
https://github.com/jwadow/kiro-gateway.git
synced 2026-04-25 01:15:57 +03:00
[GH-ISSUE #8] [Bug]: Issues with Factory AI Droid #8
Labels
No labels
bug
bug
enhancement
enhancement
fixed
fixed
invalid
needs-info
needs-testing
pull-request
question
upstream
wontfix
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/kiro-gateway-jwadow#8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Kartvya69 on GitHub (Dec 18, 2025).
Original GitHub issue: https://github.com/jwadow/kiro-gateway/issues/8
Gateway Version
v1.0.6
What happened?
Though Droid is working fine but at a specific point of chat it just stops working.
I have enabled Debug logs in my env but I still somehow couldn't get them working for me.
`### Debug Logs
root ➜ /workspaces/1/kiro-openai-gateway (main) $ python3 main.py
2025-12-18 13:09:42 | INFO | main:validate_configuration:201 - Using refresh token from environment
2025-12-18 13:09:42 | INFO | main::290 - Starting Uvicorn server...
2025-12-18 13:09:42 | INFO | main:validate_configuration:201 - Using refresh token from environment
2025-12-18 13:09:42 | INFO | logging:callHandlers:1762 - Started server process [12545]
2025-12-18 13:09:42 | INFO | logging:callHandlers:1762 - Waiting for application startup.
2025-12-18 13:09:42 | INFO | main:lifespan:221 - Starting application... Creating state managers.
2025-12-18 13:09:42 | INFO | logging:callHandlers:1762 - Application startup complete.
2025-12-18 13:09:42 | INFO | logging:callHandlers:1762 - Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
2025-12-18 13:09:47 | INFO | kiro_gateway.routes:chat_completions:195 - Request to /v1/chat/completions (model=claude-opus-4-5-20251101, stream=True)
2025-12-18 13:09:47 | DEBUG | kiro_gateway.routes:chat_completions:214 - Model cache is empty, skipping forced population
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:121 -
Collected tool result for tool_call_id=tooluse_i_tARl7eTZO8tBMzhNovAA
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:121 -
Collected tool result for tool_call_id=tooluse_OsAKKArkR9iVaZF9TxHKQw
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:132 -
Created user message with 2 tool results
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:121 -
Collected tool result for tool_call_id=tooluse_-0InnVk8Rna4Z6P5tK-UNg
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:121 -
Collected tool result for tool_call_id=tooluse_fSGCnjFVTxuE888mmg323A
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:132 -
Created user message with 2 tool results
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:121 -
Collected tool result for tool_call_id=tooluse_c2o4NVysSuWtjsF3pSHb4g
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:132 -
Created user message with 1 tool results
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:121 -
Collected tool result for tool_call_id=tooluse_plNpBJ1tSwqqvD1eL-YxAw
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:121 -
Collected tool result for tool_call_id=tooluse_aR0JocGHRHGIJkBzmdohdg
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:121 -
Collected tool result for tool_call_id=tooluse_LgRGmobORXih9q40b_AKrg
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:121 -
Collected tool result for tool_call_id=tooluse_OvhJTxCCTbG9xq1P7tDUbA
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:132 -
Created user message with 4 tool results
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:121 -
Collected tool result for tool_call_id=tooluse_6Tzpus97TK2RukWt9ZVodA
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:121 -
Collected tool result for tool_call_id=tooluse_lnOEgZeATrOs2FuQ6hF28Q
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:121 -
Collected tool result for tool_call_id=tooluse_JjzzOD_cSsqoYZrdfYDh5g
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:121 -
Collected tool result for tool_call_id=tooluse_V1DTe2EmSlGuf8-AWEbNYw
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:121 -
Collected tool result for tool_call_id=tooluse_vS9kN9dgSIaMFiotGbo2oQ
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:132 -
Created user message with 5 tool results
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:121 -
Collected tool result for tool_call_id=tooluse_Jr8k8JoYThKFBU_gR5JbjA
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:121 -
Collected tool result for tool_call_id=tooluse_PjZ3DsQGSuO1l9zCtW5Y3g
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:121 -
Collected tool result for tool_call_id=tooluse_23GREefFS86yRlenRsuxSg
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:121 -
Collected tool result for tool_call_id=tooluse_wmec6S5PQgWdh8xfNs-4-Q
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:121 -
Collected tool result for tool_call_id=tooluse_1JQu60O0SRejcJTIOBrBMQ
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:132 -
Created user message with 5 tool results
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:121 -
Collected tool result for tool_call_id=tooluse_tmxTq76MSwmzADRS-hIFBA
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:121 -
Collected tool result for tool_call_id=tooluse_-QDL603LQbSOf8d4wyKwig
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:132 -
Created user message with 2 tool results
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:121 -
Collected tool result for tool_call_id=tooluse_z8N27bdLR2qYpOAUMrXWVA
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:121 -
Collected tool result for tool_call_id=tooluse_KmdHDk6dSrmwceow775fIg
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:132 -
Created user message with 2 tool results
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:121 -
Collected tool result for tool_call_id=tooluse_AhrUFJ8RSkiRxLsy57Vdtg
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:132 -
Created user message with 1 tool results
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:121 -
Collected tool result for tool_call_id=tooluse_tCno7eVISBqXHLFZeN_s5w
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:132 -
Created user message with 1 tool results
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:176 -
Merged adjacent messages with role user
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:176 -
Merged adjacent messages with role user
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:176 -
Merged adjacent messages with role user
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:176 -
Merged adjacent messages with role user
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:176 -
Merged adjacent messages with role user
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:176 -
Merged adjacent messages with role user
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:176 -
Merged adjacent messages with role user
2025-12-18 13:09:47 | DEBUG | kiro_gateway.converters:merge_adjacent_messages:176 -
Merged adjacent messages with role user
2025-12-18 13:09:47 | INFO | kiro_gateway.auth:_refresh_token_request:227 - Refreshing Kiro token...
2025-12-18 13:09:48 | INFO | kiro_gateway.auth:_refresh_token_request:262 - Token refreshed, expires: 2025-12-18T14:08:48+00:00
2025-12-18 13:09:52 | INFO | logging:callHandlers:1762 - 127.0.0.1:40446 - "POST /v1/chat/completions HTTP/1.1" 200
2025-12-18 13:10:07 | ERROR | kiro_gateway.streaming:stream_kiro_to_openai_internal:320 - Error during streaming:
2025-12-18 13:10:07 | DEBUG | kiro_gateway.streaming:stream_kiro_to_openai_internal:323 - Streaming completed
2025-12-18 13:10:07 | INFO | kiro_gateway.routes:stream_wrapper:322 - HTTP 200 - POST /v1/chat/completions (streaming) - completed
^C2025-12-18 13:10:10 | INFO | logging:callHandlers:1762 - Shutting down
2025-12-18 13:10:10 | INFO | logging:callHandlers:1762 - Waiting for application shutdown.
2025-12-18 13:10:10 | INFO | main:lifespan:236 - Shutting down application.
2025-12-18 13:10:10 | INFO | logging:callHandlers:1762 - Application shutdown complete.
2025-12-18 13:10:10 | INFO | logging:callHandlers:1762 - Finished server process [12545]`
@jwadow commented on GitHub (Dec 18, 2025):
Hey @Kartvya69 thanks for the detailed report
I pushed a fix that should help - either it fixes the issue completely, or at least you'll get a proper error message instead of that empty one.
Can you try it from main? No release yet since I want to make sure it actually works for you first.
If you already have the repo:
Or fresh clone:
Let me know how it goes and i'll make release 1.0.7
@Kartvya69 commented on GitHub (Dec 18, 2025):
Okay. Lemme try.
@Kartvya69 commented on GitHub (Dec 18, 2025):
Seems like it's fixed thanks. A suggestion add a proxy system where we can add more than one refresh tokens.
Thank you.
@Kartvya69 commented on GitHub (Dec 18, 2025):
Nvm it's back.
`The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/workspaces/op/kiro-openai-gateway/main.py", line 292, in
uvicorn.run(
│ └ <function run at 0x7d7485eb0cc0>
└ <module 'uvicorn' from '/home/codespace/.python/current/lib/python3.12/site-packages/uvicorn/init.py'>
File "/home/codespace/.python/current/lib/python3.12/site-packages/uvicorn/main.py",
line 593, in run
server.run()
│ └ <function Server.run at 0x7d7485eb0540>
└ <uvicorn.server.Server object at 0x7d74860aed20>
File "/home/codespace/.python/current/lib/python3.12/site-packages/uvicorn/server.py", line 67, in run
return asyncio_run(self.serve(sockets=sockets), loop_factory=self.config.get_loop_factory())
│ │ │ │ │ │ └ <function Config.get_loop_factory at 0x7d7485eb0040>
│ │ │ │ │ └ <uvicorn.config.Config object at 0x7d7486524b90>
│ │ │ │ └ <uvicorn.server.Server object at 0x7d74860aed20>
│ │ │ └ None
│ │ └ <function Server.serve at 0x7d7485eb05e0>
│ └ <uvicorn.server.Server object at 0x7d74860aed20>
└ <function run at 0x7d7486d53420>
File "/home/codespace/.python/current/lib/python3.12/asyncio/runners.py", line 194, in run
return runner.run(main)
│ │ └ <coroutine object Server.serve at 0x7d7485ed6500>
│ └ <function Runner.run at 0x7d7486dbac00>
└ <asyncio.runners.Runner object at 0x7d748635e690>
File "/home/codespace/.python/current/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
│ │ │ └ <Task pending name='Task-1' coro=<Server.serve() running at /home/codespace/.python/current/lib/python3.12/site-packages/uvic...
│ │ └ <cyfunction Loop.run_until_complete at 0x7d7485c94580>
│ └ <uvloop.Loop running=True closed=False debug=False>
└ <asyncio.runners.Runner object at 0x7d748635e690>
@Kartvya69 commented on GitHub (Dec 18, 2025):
Ok but it's more interesting because now when I ask the agent to continue, It actually continues working
This is the error shared by the droid when the above error happened
But after a few seconds the error is happening again.
@Kartvya69 commented on GitHub (Dec 18, 2025):
@jwadow Hey I made a pr which is currently working perfect for me. Can you review it.
@jwadow commented on GitHub (Dec 18, 2025):
@Kartvya69 Now I can see the actual error: httpx.ReadTimeout
This is a network timeout - the connection to Kiro API is timing out mid-stream.
Quick fix - try increasing the timeout:
Add this to your
.env:This increases network timeouts from 15 to 60 seconds.
Also I noticed from the paths (
/workspaces/,/home/codespace/) that you might be running on GitHub Codespaces. If so, that could be contributing to the issue - Codespaces adds extra network hops between your environment and Kiro API (AWS).If you're on Codespaces and the problem persists even with higher timeout, consider:
Note: The "continue" workaround you found is actually working as expected - the model picks up where it left off. The "socket connection was closed unexpectedly" error from Droid is just it reporting the same timeout issue.
@jwadow commented on GitHub (Dec 18, 2025):
Ok, i'll check, thanks
@Kartvya69 commented on GitHub (Dec 18, 2025):
Okay thanks.
Thanks for the active support too. 😊