Skip to content

fix(agents): cap Gemini at 0.60.0, keep Codex in the scrollback, count Gemini usage once - #444

Merged
artempartos merged 2 commits into
developfrom
chore/bump-agent-clis
Oct 8, 2026
Merged

artempartos merged 2 commits into
developfrom
chore/bump-agent-clis

Conversation

@artempartos

@artempartos artempartos commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Follows #443 (CLI pins, Cursor/Kiro pinning) and #446 (Codex trust-dialog detector), both merged; this branch is rebased on them. #443 left two problems that a headless session hits, and this PR fixes them before 1.0.1 ships:

Runtime develop (after #443) This PR Why
Gemini CLI 0.63.0 0.60.0 0.61+ stops headless sessions on a build-file dialog (below)
Codex 0.161.0, alternate screen on 0.161.0, [tui] fullscreen_transcript = false 0.157 moved the conversation out of the tmux scrollback

Antigravity stays at 1.1.27: 1.3.1 no longer reads enableTelemetry from settings.json, so its telemetry would follow each user's Google account setting (recorded in docs/operations/antigravity-cli.md, from #443).

What changes

  • Gemini CLI capped at 0.60.0.
    • From 0.61.0, --yolo no longer approves edits to build files (package.json, lockfiles, Dockerfile, Makefile, …). The policy engine turns them into a "Build File Modification" confirmation that nobody answers in a session (upstream #29250, no opt-out; packages/core/src/policy/policy-engine.ts, absent at v0.60.0 and present from v0.61.0).
    • 0.63.0 adds an "Untrusted Command Flags" prompt after MCP output (#29579, open upstream as a false-positive bug).
    • The canary will keep reporting 0.63 as newer; docs/operations/gemini-cli.md says why.
  • Codex [tui] fullscreen_transcript = false.
    • The default flipped from false (0.156) to true (0.161, config/src/types.rs:861).
    • With it on, the conversation is drawn on the alternate screen, out of the tmux scrollback that our live log tail and quota sweep read.
  • Gemini usage counted once.
    • gemini_cli.token.usage is a CUMULATIVE metric (each export repeats the running total) and arrives in a separate request from the gemini_cli.api_response logs.
    • The adapter added the metric up and fell back to the logs for any payload without metrics, which every logs request is. So each response was counted at least twice.
    • Usage now comes from the api_response records alone, one per model response.
  • OTLP contract pinned.
    • bin/capture-agent-otlp <id> [image] runs a CLI image against test/otlp_capture/mock.py, a canned reply with known token counts. The telemetry goes through the real docker/otlp-ingest, and the script saves what the app receives as test/fixtures/files/otlp/<id>-<version>.json.
    • otlp_contract_test.rb parses those files with the real adapters and requires a capture for the pinned version, so raising a pin without re-capturing fails CI.
    • Captures are included for Claude Code 2.1.294, Codex 0.161.0 and Gemini CLI 0.60.0.
  • New error texts recognised:
    • Codex's "refresh token has expired / was already used" (an auth error);
    • Antigravity's "log out (/logout) and log back in (/login)" sign-out and "AI credits balance is too low" quota stop, both from 1.2.5+/1.3.1, ready for the next agy raise.
  • Docs. docs/architecture/agent-runtime-registry.md gains the re-capture step, and a note to read release notes for headless defaults, not just credentials.

Verification

All checks ran locally on arm64 images built from this branch's Dockerfiles.

  • Gemini build-file guard:
    • 0.63.0 has the guard: isBuildFile and "Build File" appear in 6 files, "Untrusted Command Flags" in 3.
    • 0.60.0 has none of these.
    • 0.60.0's --help still lists --model, --yolo, mcp, skills and hooks.
  • Codex alternate screen, with the real 0.161.0 TUI in tmux against the mock model:
    • without the [tui] block: alternate_on=1, history_size=0;
    • with it: alternate_on=0, history_size=18, and the prompt and reply are in the scrollback.
    • The only startup warning was the mock model's missing metadata.
  • OTLP: I re-captured Claude Code 2.1.294, Codex 0.161.0 and Gemini CLI 0.60.0 headless; each finished without a dialog. Metric and event names and attribute keys are identical to the committed fixtures, which still match the 1.0.0 images.
  • Earlier smoke tests on amd64 GHCR images of this branch before the rebase (tag bcb65d0) passed 14/14 checks: versions, launch flags and auth-banner strings.
  • Not run locally: rubocop and the Rails tests. CI on this PR is the check.

Follow-ups (not in this PR)

  • Claude Code 2.1.287+: MCP servers can open a URL prompt that waits for a person, and InteractivePromptDetector doesn't know it yet.
  • Claude on Bedrock: Opus/Fable now default to a 1M context (CLAUDE_CODE_DISABLE_1M_CONTEXT is not set), which affects cost.
  • A live session with real vendor auth was not run. Staging has QA credentials for Claude Code and Codex only.

🤖 Generated with Claude Code

artempartos and others added 2 commits October 8, 2026 21:48
- Gemini CLI stops at 0.60.0: from 0.61.0 `--yolo` no longer approves
  edits to build files (package.json, lockfiles, Dockerfile…) and opens a
  dialog a headless session cannot answer (upstream #29250); 0.63.0 adds
  an "Untrusted Command Flags" prompt after MCP output (#29579).
- Codex 0.157 made `tui.fullscreen_transcript` default to true, drawing
  the conversation on the alternate screen, out of the scrollback the
  log tail and quota sweep read; config.toml turns it off.
- Codex's "refresh token has expired / was already used" is recognised
  as a sign-in failure, and Antigravity's sign-out ("log out (/logout)
  and log back in (/login)", 1.2.5+) and "AI credits balance is too low"
  are recognised ahead of the next agy raise.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>
Gemini CLI's gemini_cli.token.usage metric is CUMULATIVE (every export
repeats the running total) and arrives in a separate request from the
gemini_cli.api_response logs. The adapter added the metric up, and fell
back to the logs whenever a payload had no metrics — which a logs-only
request never does — so every session counted its tokens at least twice.
Usage now comes from the api_response records alone, one per response.

bin/capture-agent-otlp runs a CLI image against a mock model API with its
telemetry through docker/otlp-ingest and writes the JSON the app receives
to test/fixtures/files/otlp/<id>-<version>.json. otlp_contract_test parses
those with the real adapters and requires a capture for the pinned
version, so raising a pin without re-capturing fails in CI. Captured for
Claude Code 2.1.294, Codex 0.161.0 and Gemini CLI 0.60.0: same metric and
event names and attributes as 1.0.0's CLIs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>
@artempartos
artempartos force-pushed the chore/bump-agent-clis branch from 7a17e81 to 805fefb Compare October 8, 2026 13:53
@artempartos artempartos changed the title chore(agents): raise the agent CLI pins for 1.0.1 fix(agents): cap Gemini at 0.60.0, keep Codex in the scrollback, count Gemini usage once Oct 8, 2026
@artempartos
artempartos marked this pull request as ready for review October 8, 2026 14:05
@artempartos
artempartos merged commit 490c727 into develop Oct 8, 2026
9 checks passed
@artempartos artempartos mentioned this pull request Oct 8, 2026
artempartos added a commit that referenced this pull request Oct 11, 2026
…s scroll

Claude Code picks its fullscreen renderer on a fresh install, and every
agent container is one. That renderer enters the alternate screen inside
the 80x24 detached tmux pane and repaints a single frame with cursor
moves, so nothing reaches the scrollback: the stored log replays as one
frozen frame, the live tail and quota scan see 24 rows, and the ANSI-
stripped MCP log reads as glued words.

CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN=1 is checked before the fresh-install
branch in the CLI's renderer choice (verified in the 2.1.294 binary the
image pins) and selects the classic renderer, which prints the
conversation into the scrollback. Codex had the same problem, fixed in
#444 via tui.fullscreen_transcript=false.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>
artempartos added a commit that referenced this pull request Oct 11, 2026
…s scroll (#465)

Claude Code picks its fullscreen renderer on a fresh install, and every
agent container is one. That renderer enters the alternate screen inside
the 80x24 detached tmux pane and repaints a single frame with cursor
moves, so nothing reaches the scrollback: the stored log replays as one
frozen frame, the live tail and quota scan see 24 rows, and the ANSI-
stripped MCP log reads as glued words.

CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN=1 is checked before the fresh-install
branch in the CLI's renderer choice (verified in the 2.1.294 binary the
image pins) and selects the classic renderer, which prints the
conversation into the scrollback. Codex had the same problem, fixed in
#444 via tui.fullscreen_transcript=false.

Signed-off-by: Artem Petrov <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

1 participant