Skip to content

fix(harvey): map provider env to the OpenAI-compatible adapter#888

Merged
Yiminnn merged 2 commits into
mainfrom
fix/harvey-openai-env-mapping
Jul 4, 2026
Merged

fix(harvey): map provider env to the OpenAI-compatible adapter#888
Yiminnn merged 2 commits into
mainfrom
fix/harvey-openai-env-mapping

Conversation

@Yiminnn

@Yiminnn Yiminnn commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

What

harvey-lab-harness ended every proxied run on turn 0 with zero LLM activity (suspected_api_error). Root cause: its env_mapping was empty, but Harvey LAB's OpenAI-compatible adapter — the one that serves every proxied provider (deepseek, the azure gpt-5.4-mini gateway, the benchflow-* proxy aliases) — reads OPENAI_BASE_URL / OPENAI_API_KEY, which only exist as BENCHFLOW_PROVIDER_* on the proxy path. With neither set, the adapter hit api.openai.com unauthenticated and the harness loop made zero calls.

Map BENCHFLOW_PROVIDER_BASE_URL → OPENAI_BASE_URL and BENCHFLOW_PROVIDER_API_KEY → OPENAI_API_KEY so the adapter points at the gateway. Direct ANTHROPIC/GEMINI runs are unaffected (those adapters read ANTHROPIC_API_KEY/GOOGLE_API_KEY directly and ignore OPENAI_*).

Verification (daytona, deepseek)

harvey now routes and issues requests (total_requests >= 1) — previously total_requests == 0 / zero activity. This corrects the long-standing "harvey is a harness-level zero-activity defect" classification: it was an unwired adapter, not a broken harness. The remaining HTTP 500s in the run are transient upstream provider errors (benchflow retries them), orthogonal to this fix.

Tests

test_registry_invariants.py: new test_harvey_maps_provider_env_to_openai_compatible_adapter guards the mapping. 184 pass; ruff clean.

harvey-lab-harness ended every proxied run on turn 0 with zero LLM
activity (suspected_api_error). Root cause: its env_mapping was empty, but
Harvey LAB's OpenAI-compatible adapter (the one that serves every proxied
provider — deepseek, the azure gpt-5.4-mini gateway, the benchflow-* proxy
aliases) reads OPENAI_BASE_URL / OPENAI_API_KEY, which only exist as
BENCHFLOW_PROVIDER_* on the proxy path. With neither set, the adapter hit
api.openai.com unauthenticated and the harness loop made zero calls.

Map BENCHFLOW_PROVIDER_BASE_URL -> OPENAI_BASE_URL and
BENCHFLOW_PROVIDER_API_KEY -> OPENAI_API_KEY so the adapter points at the
gateway. Direct ANTHROPIC/GEMINI runs are unaffected (those adapters read
ANTHROPIC_API_KEY / GOOGLE_API_KEY directly and ignore OPENAI_*).

Verified on daytona (deepseek): harvey now routes and issues requests
(total_requests >= 1) — previously total_requests == 0. The remaining
HTTP 500s are transient upstream provider errors (benchflow retries them),
not the harness defect this fixes.
@Yiminnn

Yiminnn commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

The failing parity check is resolved by companion benchflow-ai/agents#53, which syncs harvey's manifest env_mapping to this core change (env_mapping is a data field the agents repo owns). Merge #53 first (or together) and parity goes green — verified locally: test_manifest_byte_identical_to_core passes for harvey with both changes.

Yiminnn added a commit to benchflow-ai/agents that referenced this pull request Jul 4, 2026
Mirrors benchflow-ai/benchflow#888, which adds the OpenAI-compatible
env_mapping to harvey's core AgentConfig (so its adapter reaches the
gateway instead of ending turn 0 with zero activity). env_mapping is a
data field the agents repo owns, so the manifest must carry the same
mapping or the byte-identical parity gate fails.

Verified: test_manifest_parity.py::test_manifest_byte_identical_to_core
passes for harvey-lab-harness with this manifest + the core change.

Co-authored-by: symphony-bot <symphony@benchflow.ai>
@Yiminnn
Yiminnn temporarily deployed to pypi-internal-preview July 4, 2026 01:59 — with GitHub Actions Inactive
@Yiminnn
Yiminnn merged commit d81bf32 into main Jul 4, 2026
9 checks passed
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