fix(tests): add missing mocks for vision fallback and codex gateway tests - #4297
Closed
crazywriter1 wants to merge 1 commit into
Closed
fix(tests): add missing mocks for vision fallback and codex gateway tests#4297crazywriter1 wants to merge 1 commit into
crazywriter1 wants to merge 1 commit into
Conversation
crazywriter1
force-pushed
the
fix/flaky-test-missing-mocks
branch
from
March 31, 2026 17:54
1faa3e6 to
4044899
Compare
…ests - Mock _resolve_custom_runtime in vision auto fallback test so the custom endpoint is actually reachable in test environment - Mock _resolve_gateway_model in codex gateway test so the model field is populated correctly These tests were failing in CI due to missing runtime config.
crazywriter1
force-pushed
the
fix/flaky-test-missing-mocks
branch
from
April 6, 2026 19:02
4044899 to
ab4a59c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes 2 pre-existing test failures that affect
mainand all open PRs (e.g. #4245, #4246).These tests pass locally in some environments but consistently fail in CI because they depend on runtime config resolution that behaves differently without a real
config.yamlorhermes_clisetup.Failing tests
1.
test_vision_auto_falls_back_to_custom_endpointtests/agent/test_auxiliary_client.pyassert None is not NoneOPENAI_BASE_URLandOPENAI_API_KEYenv vars expecting the vision auto-fallback to pick up the custom endpoint. However,_try_custom_endpoint()delegates to_resolve_custom_runtime()which importshermes_cli.runtime_provider.resolve_runtime_provider— in CI this resolution returns(None, None)because there is no config file, so the custom endpoint is never constructed._resolve_custom_runtimeto return the test endpoint values directly, matching what the test already sets via env vars.2.
test_gateway_run_agent_codex_path_handles_internal_401_refreshtests/test_codex_execution_paths.pyassert '⚠️ Codex Responses request 'model' must be a non-empty string.' == 'Recovered via refresh'HERMES_MODELenv var but_run_agent()resolves the model via_resolve_gateway_model()which reads fromconfig.yaml, not env vars. Without a config file, it returns an empty string — the codex API then rejects the request with a validation error before the 401-refresh logic is ever reached._resolve_gateway_modelto return the test model string directly.Changes
tests/agent/test_auxiliary_client.py: Added_resolve_custom_runtimemock (+2 lines)tests/test_codex_execution_paths.py: Added_resolve_gateway_modelmock (+1 line)Test plan