Skip to content

fix: update opencode-go base_url + clean up test_issue1894 provider overlap tests#2975

Merged
3 commits merged into
nesquena:masterfrom
someaka:fix/test-cleanup-base-url-docstrings
May 26, 2026
Merged

fix: update opencode-go base_url + clean up test_issue1894 provider overlap tests#2975
3 commits merged into
nesquena:masterfrom
someaka:fix/test-cleanup-base-url-docstrings

Conversation

@someaka

@someaka someaka commented May 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Three commits cleaning up tests/test_issue1894_provider_overlap.py:

1. Canonicalize opencode-go base_url in tests

api.opencode.ai/go/v1opencode.ai/zen/go/v1 — the canonical URL per hermes_cli/auth.py:406. The upstream source code (api/config.py) already uses the correct URL; this synchronizes the test assertions to match.

2. Remove vestigial # noqa: N801 + add docstrings

  • File has zero classes — the noqa: N801 suppression was leftover cruft with no purpose
  • Converted inline # comments above each of the 5 test functions into proper """docstrings""" for discoverability via pytest --doc and standard tooling
  • Converted the module-level # description block into a """module docstring"""

3. Consistent section separators

Remaining # --- section separators that were left behind during the docstring conversion are now removed — all 4 test groups are uniformly formatted.

Verification

5 passed, 1 warning in 2.78s
  • pytest tests/test_issue1894_provider_overlap.py — all 5 pass
  • ruff check — clean, no violations
  • python3 -m py_compile — syntax OK

@nesquena-hermes

Copy link
Copy Markdown
Collaborator

Summary

Fixture-only cleanup. The behavior under test (resolve_model_provider overlap resolution) is unchanged — this just realigns the base_url strings in the three Case-1/Case-2 fixtures with the canonical OpenCode Go endpoint, plus a noqa + docstring polish pass. All five assertions still pass because they compare against the fixture they themselves install.

Code reference

The canonical URL is owned by the agent, not the WebUI. From the hermes-agent registry (hermes_cli/auth.py:398-406):

"opencode-go": ProviderConfig(
    id="opencode-go",
    ...
    inference_base_url="https://opencode.ai/zen/go/v1",
    ...
),

The WebUI side (api/config.py) only references opencode-go by id and never hard-codes the inference URL — the only mentions are descriptive comments at api/config.py:1134 and :1173. So this PR is bringing the test fixture into line with the agent-side source of truth.

Diagnosis / Recommendation

The diff is fine and the URL change matches hermes_cli/auth.py:406. One minor accuracy note for the PR description: it says "the upstream source code (api/config.py) already uses the correct URL", but api/config.py has no inference URL constant for opencode-go at all — the only canonical value lives in the agent's auth.py. The fixture was diverging from the agent, not from api/config.py. The change is still correct; just the rationale paragraph reads slightly off.

The docstring conversion and # noqa: N801 removal are unobjectionable. The file has no classes (Pep8-N801 is the class-naming rule), so the suppression was vestigial as you say.

Two small follow-ups worth considering (non-blocking):

  1. The Case-4 test (test_openrouter_suffix_still_works) still installs opencode-go indirectly via _apply_config_overrides defaults — worth a quick read to confirm the defaults dict in _apply_config_overrides doesn't itself carry the old URL string. The diff doesn't touch that helper, so if it has the URL inline, future readers will see a mismatch. (Tests still pass either way; this is just consistency.)
  2. If the agent ever rotates the canonical URL again, a single named constant exported from api/config.py (or imported from the agent registry) and referenced by all three test cases would make the next rotation a one-line change.

Verification

pytest tests/test_issue1894_provider_overlap.py per the PR body — five tests, fixture-only diff, no behavior change. LGTM as-is.

@nesquena-hermes nesquena-hermes closed this pull request by merging all changes into nesquena:master in a6c65de May 26, 2026
@nesquena-hermes

Copy link
Copy Markdown
Collaborator

Merged in Release DJ / v0.51.138 (stage-batch20 — 7-PR ultra-safe batch with PRs #2948 #2949 #2950 #2960 #2972 #2975 #2982).

Thanks @someaka! 🚢

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.

2 participants