Skip to content

fix(test): drop the retired OpenAI provider from the system-prompt test - #4183

Merged
itomek merged 1 commit into
mainfrom
fix/retired-openai-provider-test
Sep 24, 2026
Merged

itomek merged 1 commit into
mainfrom
fix/retired-openai-provider-test

Conversation

@itomek

@itomek itomek commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator

main's Unit Tests lane is red on py3.10, py3.12 and macOS, and has been since #3899 merged. That PR retired the OpenAI provider and deleted src/gaia/llm/providers/openai_provider.py, but left a test importing it. The import sits inside the test function and runs for both parameters, so the Claude case fails too — it is two failures, not one. Every PR opened against main since then inherits a red lane that has nothing to do with its own change.

This keeps the Claude case (the only cloud provider left) and drops the OpenAI half, and clears the same retirement's leftover file references in CLAUDE.md and three agent docs so they stop pointing at a file that no longer exists.

Test plan

  • python -m pytest tests/unit/test_chat_system_prompt_owner.py -q — 15 pass. On origin/main the same command gives 2 failed / 14 passed:
    FAILED test_cloud_provider_receives_native_system_prompt[openai] - ModuleNotFoundError: No module named 'gaia.llm.providers.openai_provider'
    FAILED test_cloud_provider_receives_native_system_prompt[claude] - (same)
    
  • python util/lint.py --black --isort — pass.
  • grep -rn openai_provider CLAUDE.md .claude/agents/ tests/ src/ — no remaining references.

#3899 deleted src/gaia/llm/providers/openai_provider.py but left
test_chat_system_prompt_owner.py importing it. The import is at function
scope and runs for both parameters, so BOTH cases fail, not just the openai
one — main's Unit Tests lane has been red on py3.10, py3.12 and macOS since.

Keeps the Claude case, which is the only cloud provider left, and clears the
same retirement's leftover file references in CLAUDE.md and three agent docs.
@itomek itomek self-assigned this Sep 24, 2026
@github-actions github-actions Bot added devops DevOps/infrastructure changes tests Test changes labels Sep 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Approve

This unbreaks main's Unit Tests lane, which has been red on py3.10, py3.12 and macOS since the OpenAI provider was retired and a test kept importing it. The fix is the right shape: keep the Claude half (the only cloud provider left), drop the OpenAI half, and clear the same retirement's stale file references out of the project docs so nobody is sent to a file that no longer exists.

The doc cleanup is complete — the only surviving mention of the old provider anywhere in the tree is in a historical release note, which correctly stays as-is. No blocking issues.

Real-world evidence

N/A — tests and docs only; no CLI, API, MCP or Agent UI surface changes, so there is nothing for a live run to show. No evidence bundle was produced for this PR, which is expected here. One caveat on my own verification: pytest isn't installed in this review environment, so I could not re-run the suite myself — I confirmed the fix by reading the code paths the test exercises, and the pass/fail counts in the test plan are the author's.

🔍 Technical details

Verified statically

  • src/gaia/llm/providers/ now contains claude.py, lemonade.py, fireworks.py, __init__.py — openai_provider.py is genuinely gone, so the import at the old tests/unit/test_chat_system_prompt_owner.py:107 was an unconditional ModuleNotFoundError for both parametrized cases. The "two failures, not one" claim in the description checks out.
  • Repo-wide grep -rn "openai_provider\|OpenAIProvider" leaves only docs/releases/v0.15.1.mdx:28 — a historical release note describing what shipped in v0.15.1. Correct to leave untouched.
  • The new CLAUDE.md line about openai/litellm being "rejected with a migration error" matches src/gaia/llm/factory.py:34 (raise ValueError(REMOVED_PROVIDER_MESSAGE)), and _PROVIDERS at factory.py:9-12 is exactly {lemonade, claude}. tests/unit/test_removed_llm_providers.py already covers that rejection path, so no coverage is lost by narrowing this test.
  • The ClaudeProvider.__new__ construction still satisfies chat() → _build_params → _client.messages.create: _last_usage is assigned in chat() itself (claude.py:501), _parse_response is mocked, and the remaining reads are _model, _system_prompt, _client — all set by the test.

🟢 Minor — stale attribute on the hand-built provider (tests/unit/test_chat_system_prompt_owner.py:114)

provider._tool_name_map = {} is the only occurrence of that name in the whole repo — ClaudeProvider uses _api_tool_name / _restore_tool_name and never reads _tool_name_map. Since you're already trimming this setup block, it's a free line to drop.

    provider._client = Mock()

(that replaces the _client + _tool_name_map pair — keep the _client line, delete the _tool_name_map one.)

Strengths

  • Fixing the test and the four doc references in one change is exactly what CLAUDE.md asks for — the retirement PR left contradictory docs behind, and this closes them together rather than leaving a second cleanup PR owed.
  • The CLAUDE.md edit does better than deleting the dead line: it adds providers/lemonade.py (previously undocumented) and records why openai/litellm are gone with the issue number, so the next reader doesn't re-add them.
  • Test plan shows the before-state failure output, not just a green after-state — that's the part that proves the diagnosis.

@itomek
itomek added this pull request to the merge queue Sep 24, 2026
Merged via the queue into main with commit dc42bec Sep 24, 2026
31 checks passed
@itomek
itomek deleted the fix/retired-openai-provider-test branch September 24, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops DevOps/infrastructure changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant