Skip to content

fix(diagnostics): use internal_api_base instead of hardcoded port 8000#3827

Open
cyq1017 wants to merge 5 commits into
odysseus-dev:devfrom
cyq1017:codex/odysseus-diagnostics-loopback-port-gpt55
Open

fix(diagnostics): use internal_api_base instead of hardcoded port 8000#3827
cyq1017 wants to merge 5 commits into
odysseus-dev:devfrom
cyq1017:codex/odysseus-diagnostics-loopback-port-gpt55

Conversation

@cyq1017

@cyq1017 cyq1017 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

The /api/test-research endpoint in routes/diagnostics_routes.py hardcoded the port 8000 (e.g. http://127.0.0.1:8000/v1/chat/completions). If the Odysseus server runs on a custom port or behind a reverse proxy, this endpoint fails.

This PR replaces the hardcoded endpoint with the dynamic internal_api_base() resolution helper. It also updates the regression tests in tests/test_internal_api_base.py to ensure that no hardcoded :7000 or :8000 are introduced in the future.

Target branch

  • This PR targets dev, not main.

Linked Issue

Fixes #3826

Type of Change

  • Bug fix (non-breaking — fixes a confirmed issue)

Checklist

  • I searched open issues and open PRs — this is not a duplicate.
  • This PR targets dev
  • My changes are limited to the scope described above — no unrelated refactors or whitespace changes mixed in.
  • I actually ran the app and verified the change works end-to-end.

How to Test

  1. Run the Odysseus server on a custom port (e.g., 7000) using APP_PORT=7000 uvicorn app:app --port 7000.
  2. Access the diagnostics test-research endpoint, and confirm it connects to the chat completions API successfully without timing out or resolving to port 8000.
  3. Run the regression unit test:
    python3 -m pytest tests/test_internal_api_base.py

Visual / UI changes — REQUIRED if you touched anything that renders

N/A (Backend routes change only, no UI/visual changes)

@github-actions github-actions Bot added the ready for review Description complete — ready for maintainer review label Jun 10, 2026
@alteixeira20 alteixeira20 added the bug Something isn't working label Jun 12, 2026
@pewdiepie-archdaemon

Copy link
Copy Markdown
Collaborator

GitHub reports this PR is currently conflicting with dev, so I can’t review or approve it cleanly yet. Please rebase/update against current dev and rerun the focused diagnostics check once it is mergeable again.

…ostics-loopback-port-gpt55

# Conflicts:
#	routes/diagnostics_routes.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ready for review Description complete — ready for maintainer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: hardcoded loopback port 8000 in diagnostics endpoint prevents test-research when custom port is used

3 participants