openai / openai/codex

Repeated HTTP connection setup slows multi-step Bedrock tasks

Open
#46,807 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

aws-bedrock bug CLI connectivity performance
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?
  1. Run a Bedrock coding task involving several tool calls.
  2. Enable HTTP connection logging.
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.