Skip to content

fix(gemini-cli): allowlist install hosts on the environment baseline - #1282

Open
stateofkate wants to merge 1 commit into
stagingfrom
fix/gemini-cli-install-hosts
Open

fix(gemini-cli): allowlist install hosts on the environment baseline#1282
stateofkate wants to merge 1 commit into
stagingfrom
fix/gemini-cli-install-hosts

Conversation

@stateofkate

Copy link
Copy Markdown
Collaborator

Problem

Harbor's GeminiCli.install bootstraps nvm, a Node runtime, and the
@google/gemini-cli npm package during agent setup, which runs under the
[environment] network baseline. An agent-phase allowlist only applies around
agent.run(), so it can never cover the install.

On any task whose [environment] baseline is an allowlist, every gemini-cli
trial died before consuming a token:

curl: (35) Recv failure: Connection reset by peer
Error: NVM failed to load

curl: (35) is an actively reset connection — not DNS (6) or timeout (28).

Evidence

From the gemini-3.7 backfill (gemini-cli @ gemini/gemini-3.7-flash, k=5):

status trials
SUCCESS 510
FAILED (nvm egress) 394

All failures at attempts=6/6 — retries exhausted, nothing self-heals.

The split is per task and perfectly bimodal: 72 task versions all-fail,
45 all-ok, 0 mixed. The failing ones declare

[environment]
network_mode = "allowlist"
allowed_hosts = ["x.ai", "api.x.ai"]  # x.ai serves the grok CLI installer

i.e. they were authored for grok-build and allowlist only what its installer
needs. Other agents on those same tasks are unaffected (grok-build 36 ok,
claude-code 27 ok) because only gemini-cli fetches its runtime at setup.

Fix

claude-code and opencode already merge their install hosts into the
environment baseline for exactly this reason — gemini-cli was missing the same
arm. Its host set is identical to opencode's (both use harbor's shared
nvm_node_install_snippet), so it is aliased rather than duplicated.

  • On a public baseline the merge is a no-op (harbor ignores extra hosts
    there), so public-setup tasks keep their agent phase unchanged.
  • The restricted Daytona Compose shape is excluded, matching the opencode arm.
  • No task content changes → no new task versions, and existing trials stay
    comparable within their version.

Tests

Two regression tests, mirroring the opencode precedent. Both were verified to
fail against unmodified runner.py/model_hosts.py (AttributeError: module 'oddish.workers.harbor.runner' has no attribute '_gemini_cli_environment_hosts')
before the fix was restored.

tests/test_harbor_runner.py is otherwise unchanged: the suite has 2 failures
(test_restricted_cursor_gets_transport_hosts_and_web_hardening,
test_run_harbor_trial_async_skips_temp_root_preflight_without_task_patch)
that reproduce identically on clean origin/staging and are unrelated to this
change.

Harbor's `GeminiCli.install` bootstraps nvm, a Node runtime and the
`@google/gemini-cli` npm package during agent SETUP, which runs under the
`[environment]` network baseline. An agent-phase allowlist only takes effect
around `agent.run()`, so it can never cover the install.

On any task whose `[environment]` baseline is an allowlist, every gemini-cli
trial therefore died before consuming a token:

    curl: (35) Recv failure: Connection reset by peer
    Error: NVM failed to load

Observed across the gemini-3.7 backfill: 394 FAILED trials, all at
attempts=6/6 (retries exhausted, so nothing self-heals). The split was
perfectly bimodal per task -- 72 task versions all-fail, 45 all-ok, 0 mixed --
because the failing ones are allowlisted to `x.ai` alone, the host grok-build's
installer needs. Other agents on those same tasks are unaffected (grok-build
36 ok, claude-code 27 ok), since only gemini-cli fetches its runtime at setup.

claude-code and opencode already merge their install hosts into the
environment baseline for exactly this reason; gemini-cli was simply missing
the same arm. The host set is identical to opencode's (both use harbor's
shared `nvm_node_install_snippet`), so it is aliased rather than duplicated.

On a public baseline the merge is a no-op -- harbor ignores extra hosts there
-- so public-setup tasks keep their agent phase unchanged. No task content
changes, so no new task versions are cut and existing trials stay comparable.
@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
oddish-app Ready Ready Preview Aug 18, 2026 12:33am

@github-actions

Copy link
Copy Markdown
Contributor

Oddish preview

Commit: 40ae37fbe5171ad3d9dbfedb24f91267790fa1f8

Surface Link Target
Frontend https://pr-1282.oddish.app Vercel preview for 40ae37f
Backend oddish-pr-1282 oddish-pr-1282
Database project kexdnajhuxvqcsopugsi project kexdnajhuxvqcsopugsi

Vercel deployment URL: https://oddish-psey0xw0r.oddish.app

Plan:

  • Frontend deploy: true
  • Backend deploy: true
  • Migrations: false

This comment is updated by the PR Preview workflow.

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