Wait-loop usage in herd explodes token usage

Đang mở
#64,222 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
ai-infra-agents, cli

Hướng nghiên cứu

Start with the uploaded thread 01a21991-ac2c-7272-831d-91e279a5d945 and trace how Codex handles repeated hc wait timeouts while coordinating with a worker. Check whether retries or continued waiting trigger model calls or consume tokens. Done means waiting for a worker uses no model tokens, and the behavior is covered by a reproducible test.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug CLI model-behavior rate-limits subagent
What version of Codex CLI is running?

codex-cli 0.172.0

What subscription do you have?

Plus

Which model were you using?

Astra (medium) 6.2

What platform is your computer?

Darwin 27.2.0 arm64 arm

What terminal emulator and version are you using (if applicable)?

Terminal.app running herd.app

Codex doctor report
Codex Doctor v0.172.0 · macos-aarch64

Environment
  ✓ system       en-SE
      os                       Mac OS 27.2.1 [64-bit]
      OS language              en-SE
      LC_CTYPE                 en_US.UTF-8
      LANG                     en_US.UTF-8
      VISUAL                   mvim -f
      EDITOR                   mvim -f
      PAGER                    less
      LESS                     -R
  ✓ disk         sufficient free disk space (1454.5 GiB)
      warning threshold        5.0 GiB
      failure threshold        1.0 GiB
      CODEX_HOME available     1454.5 GiB
      worktree available       1454.5 GiB
  ✓ security     no supported endpoint protection detected
      endpoint products        none detected
  ✓ runtime      standalone (unix, package /Users/gsr/.codex/packages/standalone/releases/0.172.0-aarch64-apple-darwin, bin /Users/gsr/.codex/packages/standalone/releases/0.172.0-aarch64-apple-darwin/bin, resources /Users/gsr/.codex/packages/standalone/releases/0.172.0-aarch64-apple-darwin/codex-resources, path /Users/gsr/.codex/packages/standalone/releases/0.172.0-aarch64-apple-darwin/codex-path)
      version                  0.172.0
      install method           standalone (unix, package /Users/gsr/.codex/packages/standalone/releases/0.172.0-aarch64-apple-darwin, bin /Users/gsr/.codex/packages/standalone/releases/0.172.0-aarch64-apple-darwin/bin, resources /Users/gsr/.codex/packages/standalone/releases/0.172.0-aarch64-apple-darwin/codex-resources, path /Users/gsr/.codex/packages/standalone/releases/0.172.0-aarch64-apple-darwin/codex-path)
      commit                   unknown
      executable               ~/.local/bin/codex
  ✓ install      consistent
      context                  standalone (unix, package /Users/gsr/.codex/packages/standalone/releases/0.172.0-aarch64-apple-darwin, bin /Users/gsr/.codex/packages/standalone/releases/0.172.0-aarch64-apple-darwin/bin, resources /Users/gsr/.codex/packages/standalone/releases/0.172.0-aarch64-apple-darwin/codex-resources, path /Users/gsr/.codex/packages/standalone/releases/0.172.0-aarch64-apple-darwin/codex-path)
      managed by               npm: no · bun: no · pnpm: no · Vite+: no · package root —
      PATH entries (1)         ~/.local/bin/codex
  ✓ search       file exists (bundled, /Users/gsr/.codex/packages/standalone/releases/0.172.0-aarch64-apple-darwin/codex-path/rg)
      search command           ~/.codex/packages/standa…le-darwin/codex-path/rg
      search provider          bundled
      search command readiness file exists
  ✓ git          git executable found; execution not verified
      selected git             /opt/homebrew/bin/git
      repo detected            true
      repo root                ~/src/research/track_layout_analyzer
      .git entry               directory
      PATH entries (2)         /opt/homebrew/bin/git
                               /usr/bin/git
      git execution            not inspected (PATH helpers are not executed)
  ✓ terminal     Apple Terminal 488.9
      terminal                 Apple Terminal
      TERM_PROGRAM             Apple_Terminal
      terminal version         488.9
      stdin is terminal        true
      stdout is terminal       true
      stderr is terminal       true
      terminal size            189x51
      color output             enabled
      COLORTERM                truecolor
      effective locale         en_US.UTF-8
  ✓ title        default · project track_layout_analyzer
      title source             default
      title items              activity, project-name
      activity item            true
      project source           git repo root
      project value            track_layout_analyzer
  ✓ state        databases healthy
      CODEX_HOME               ~/.codex (dir)
      log dir                  ~/.codex/log (missing)
      sqlite home              ~/.codex (dir)
      state DB                 ~/.codex/state_5.sqlite (file) · integrity ok
      log DB                   ~/.codex/logs_2.sqlite (file) · integrity ok
      goals DB                 ~/.codex/goals_1.sqlite (file) · integrity ok
      memories DB              ~/.codex/memories_1.sqlite (file) · integrity ok
      active rollouts          140 files · 115.22 MB (avg 842.74 KB)
      archived rollouts        0 files · 0 B (avg 0 B)
      memories v2 DB           ~/.codex/memories_v2_1.sqlite (missing)
      memories v2 DB integrity skipped (missing)
      queue DB                 ~/.codex/queue_1.sqlite (file)
      queue DB integrity       ok
      thread history DB        ~/.codex/thread_history_1.sqlite (file)
      thread history DB integrity ok
      standalone release cache 2 entries in /Users/gsr/.codex/packages/standalone/releases
  ✓ threads      rollout files and state DB thread inventory agree
      default model provider   openai
      rollout DB active files  140
      rollout DB archived files 0
      rollout DB scan errors   0
      rollout DB malformed file names 0
      rollout DB scan cap reached false
      rollout DB rows          140
      rollout DB active rows   140
      rollout DB archived rows 0
      rollout DB missing active rows 0
      rollout DB missing archived rows 0
      rollout DB stale rows    0
      rollout DB archive mismatches 0
      rollout DB duplicate rollout thread ids 0
      rollout DB duplicate DB paths 0
      rollout DB model providers openai=140
      rollout DB sources       vscode=132, cli=8

Configuration
  ✓ config       loaded
      model                    gpt-6.2-astra · openai
      cwd                      ~/src/research/track_layout_analyzer
      config.toml              ~/.codex/config.toml
      config.toml parse        ok
      MCP servers              0
      feature flags            73 enabled · 1 overridden (full list with --all)
      overrides                daemon_auto_start
      configuration scope      invocation config, including cloud-managed policy
      active thread overrides  not inspected
      configured TUI mode      fullscreen
      configuration load ms    3
  ✓ auth         auth is configured
      auth storage mode        File
      auth.json path (file backend/fallback) ~/.codex/auth.json
      stored auth mode         chatgpt
      stored API key           false
      stored ChatGPT tokens    true
      stored agent identity    false
  ✓ mcp          no MCP servers configured
  ✓ sandbox      restricted fs + restricted network · approval OnRequest
      approval policy          OnRequest
      filesystem sandbox       restricted
      denied-read rules        0
      denied-read glob rules   0
      glob scan max depth      unbounded
      managed filesystem source none
      network sandbox          restricted
      linux helper             none
  ✓ sandbox      no explicit filesystem paths to probe

Updates
  ✓ updates      update configuration is locally consistent
      startup update check     true
      update action            standalone installer
      version cache            ~/.codex/version.json
      cached latest version    0.172.0
      last checked at          2026-11-26 07:34 UTC
      latest version           0.172.0
      latest version status    current version is not older

Connectivity
  ✓ network      no proxy env vars
      proxy env vars           none
      system proxy             direct
      respect system proxy     disabled
      managed proxy            not configured
  ✓ websocket    connected (HTTP 101 Switching Protocols) · 15s timeout
      model provider           openai
      provider name            OpenAI
      wire API                 responses
      supports websockets      true
      proxy env vars           none
      connect timeout          15000 ms
      auth mode                chatgpt
      endpoint                 wss://chatgpt.com/backend-api/<redacted>
      DNS                      2 IPv4, 0 IPv6, first IPv4
      handshake result         HTTP 101 Switching Protocols
      reasoning header         false
      server model present     false
  ✓ reachability active provider endpoints are reachable over HTTP
      reachability mode        ChatGPT auth
      ChatGPT inference URL    https://chatgpt.com/backend-api/<redacted> reachable (HTTP 405)

Background Server
  ○ app-server   not running (ephemeral mode)
      daemon state dir         ~/.codex/app-server-daemon
      settings                 ~/.codex/app-server-daemon/settings.json (missing)
      pid file                 ~/.codex/app-server-daemon/app-server.pid (missing)
      update-loop pid file     ~/.codex/app-server-daem…/app-server-updater.pid (missing)
      dedicated pid file       ~/.codex/app-server-daemon/daemon.pid (file)
      dedicated update-loop pid file ~/.codex/app-server-daemon/daemon-updater.pid (file)
      control socket           ~/.codex/app-server-cont…app-server-control.sock
      status                   not running
      mode                     ephemeral

─────────────────────────────────────────────────────────────
20 ok · 1 idle · 0 warn · 0 fail ok
What issue are you seeing?

When codex, acting as coordinator, asked to wait in a loop for the Claude working a new pane, I specifically asked it if this would use tokens and it said now. Within a few minutes more than 50% of my 5-0hour limit was gone.

What steps can reproduce the bug?

Uploaded thread: 01a21991-ac2c-7272-831d-91e279a5d945

What is the expected behavior?

No tokens be used while waiting for a worker.

Additional information

/ps

Background terminals

• hc wait t22 --timeout 55
• Ran hc wait t22 --timeout 55
└ {"children":[],"ended":false,"exit_code":null,"reason":"timeout","signal":…

if Claude is going to do a hc send do you need to wait with timeout? does that cost tokens to wait?

Claude can send the report without a wait. I use hc wait to stay available for it. Elapsed waiting time consumes no model tokens. A timeout costs a few tokens only if it returns to the conversation and I issue another call. I’ve put the retries in a loop so routine timeouts stay out of the conversation.
• Ran hc wait t22 --timeout 55
└ {"children":[],"ended":false,"exit_code":null,"reason":"timeout","signal":…
• Ran hc wait t22 --timeout 55
└ {"children":[],"ended":false,"exit_code":null,"reason":"timeout","signal":…
• Ran hc wait t22 --timeout 55
└ {"children":[],"ended":false,"exit_code":null,"reason":"timeout","signal":…
hc wait t22 --timeout 55
{"children":[],"ended":false,"exit_code":null,"reason":"timeout","signal":null,"status":"working","terminal":"t22","turn":17}

Ngôn ngữ chính
Rust
Star
136k
Fork
21.6k
Merge trung bình
1 phút
Pull request đã merge (30 ngày)
997

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của openai/codex

Tất cả issue của openai/codex

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.