hermes - ✅(Solved) Fix Bug: gateway.display_config helper API is missing while committed tests import it [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#13705Fetched 2026-04-22 08:04:37
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
cross-referenced ×1

tests/gateway/test_display_config.py already expects gateway.display_config to export get_effective_display() and get_platform_defaults(), but those helpers do not exist in gateway/display_config.py. The narrow test subset fails on main with ImportError before it can exercise the intended behavior.

Error Message

ImportError: cannot import name 'get_effective_display' from 'gateway.display_config' ImportError: cannot import name 'get_platform_defaults' from 'gateway.display_config'

Root Cause

tests/gateway/test_display_config.py already expects gateway.display_config to export get_effective_display() and get_platform_defaults(), but those helpers do not exist in gateway/display_config.py. The narrow test subset fails on main with ImportError before it can exercise the intended behavior.

Fix Action

Fixed

PR fix notes

PR #13741: fix(gateway): add missing display config helper API

Description (problem / solution / changelog)

What does this PR do?

Adds the missing gateway.display_config helper API expected by the committed test suite.

Specifically:

  • adds get_platform_defaults(platform_key) to expose built-in display defaults safely
  • adds get_effective_display(user_config, platform_key) to return the fully resolved display bundle for a platform
  • adds focused regression tests covering known-platform defaults, unknown-platform fallback, and effective per-platform resolution

This fixes the contract drift described in issue #13705, where tests referenced helper functions that were not implemented/exported.

Fixes #13705

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • Tests (adding or improving test coverage)

Changes Made

  • updated gateway/display_config.py
  • updated tests/gateway/test_display_config.py

How to Test

  1. Run: py -3 -m pytest tests\gateway\test_display_config.py -q -o addopts="" --basetemp C:\Users\cgold\Desktop\hermes\hermes-agent\.pytest-tmp\run -p no:cacheprovider
  2. Confirm the test file passes
  3. Verify the new helpers are importable from gateway.display_config

Platform Tested

  • Windows 11

Changed files

  • gateway/display_config.py (modified, +22/-0)
  • tests/gateway/test_display_config.py (modified, +58/-0)

Code Example

source venv/bin/activate
pytest -q tests/gateway/test_display_config.py -k 'get_effective_display or get_platform_defaults' -o addopts=''

---

ImportError: cannot import name 'get_effective_display' from 'gateway.display_config'
ImportError: cannot import name 'get_platform_defaults' from 'gateway.display_config'
RAW_BUFFERClick to expand / collapse

Summary

tests/gateway/test_display_config.py already expects gateway.display_config to export get_effective_display() and get_platform_defaults(), but those helpers do not exist in gateway/display_config.py. The narrow test subset fails on main with ImportError before it can exercise the intended behavior.

Affected code

  • gateway/display_config.py:1-187 — file defines only resolve_display_setting() and _normalise()
  • tests/gateway/test_display_config.py:230-255 — imports and asserts behavior for get_effective_display() / get_platform_defaults()

Why this is a bug

This is a concrete production/test contract drift on the default branch. The helpers are referenced by committed tests but never implemented/exported, so the targeted test block is permanently red.

Minimal reproduction

source venv/bin/activate
pytest -q tests/gateway/test_display_config.py -k 'get_effective_display or get_platform_defaults' -o addopts=''

Observed failure:

ImportError: cannot import name 'get_effective_display' from 'gateway.display_config'
ImportError: cannot import name 'get_platform_defaults' from 'gateway.display_config'

Expected behavior

  • gateway.display_config should export the helper API that the test module imports.
  • The helper tests should execute behavior assertions instead of failing at import time.

Actual behavior

  • Both helper tests fail immediately with ImportError.

Suggested investigation

Either implement/export the missing helpers in gateway.display_config or remove/update the stale test expectations. Given the surrounding code, a small wrapper around resolve_display_setting() plus a copy of the platform defaults looks like the intended direction.

extent analysis

TL;DR

Implement or export the missing get_effective_display() and get_platform_defaults() helpers in gateway/display_config.py to resolve the ImportError.

Guidance

  • Verify the intended behavior of get_effective_display() and get_platform_defaults() by reviewing the surrounding code and test expectations in tests/gateway/test_display_config.py.
  • Implement the missing helpers in gateway/display_config.py as suggested, potentially using a small wrapper around resolve_display_setting() and a copy of the platform defaults.
  • Update or remove the stale test expectations in tests/gateway/test_display_config.py if the helpers are not intended to be implemented.
  • Run the minimal reproduction command to verify the fix: pytest -q tests/gateway/test_display_config.py -k 'get_effective_display or get_platform_defaults' -o addopts=''

Example

# gateway/display_config.py
def get_effective_display():
    # implementation using resolve_display_setting()
    pass

def get_platform_defaults():
    # return a copy of the platform defaults
    pass

Notes

The implementation details of get_effective_display() and get_platform_defaults() are not provided, so the example above is a placeholder. The actual implementation should be based on the surrounding code and test expectations.

Recommendation

Apply workaround by implementing or exporting the missing helpers, as it is a concrete production/test contract drift that needs to be addressed to resolve the ImportError and ensure the tests execute correctly.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

  • gateway.display_config should export the helper API that the test module imports.
  • The helper tests should execute behavior assertions instead of failing at import time.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - ✅(Solved) Fix Bug: gateway.display_config helper API is missing while committed tests import it [1 pull requests, 1 participants]