Repeated HTTP connection setup slows multi-step Bedrock tasks
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.5k
- PR merge metrics
- PR metrics pending
Description
What version of Codex CLI is running?
codex-cli 0.155.1
Which model were you using?
gpt-6-astra
What issue are you seeing?
Codex appears to create a fresh HTTP connection for each Responses API request when using AWS Bedrock. During tasks with multiple tool calls, this repeatedly adds connection setup latency.
Environment: Codex CLI 0.155.1, macOS arm64, Astra on Bedrock in us-west-2.
In captured Codex logs, all 20 follow-up requests established new connections, averaging 868 ms of connection setup per request.
A separate benchmark replaying identical model-visible request sequences with fresh versus persistent HTTP clients showed:
| Provider | Fresh clients | Reused client |
|---|---|---|
| Bedrock Mantle | 95.85s | 44.97s |
| Bedrock Runtime | 83.49s | 50.66s |
These tasks contained approximately 27–28 model requests. Input and cached-token counts matched request for request; output totals differed by about 1–2%. These measurements suggest connection reuse could materially improve interactive performance, although the exact benefit needs verification in Codex.
What steps can reproduce the bug?
- Run a Bedrock coding task involving several tool calls.
- Enable HTTP connection logging.
- Observe new connection establishment on successive model requests within the same session.
What is the expected behavior?
Reuse eligible HTTP connections across model requests, while preserving authentication and routing behavior.
Additional information
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Bedrock request path and enable HTTP connection logging to confirm whether successive model requests create new connections. Compare fresh and persistent HTTP clients during a multi-tool-call task; done means eligible connections are reused while authentication and routing behavior remain unchanged, with the reported latency improvement verified in Codex.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, rust
- Domain
- api, cli, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100