Skip to content

fix: fixed tui service status to now properly show container status instead of missing#2139

Merged
Vchen7629 merged 6 commits into
mainfrom
tui-service-status-fix
Jul 22, 2026
Merged

fix: fixed tui service status to now properly show container status instead of missing#2139
Vchen7629 merged 6 commits into
mainfrom
tui-service-status-fix

Conversation

@Vchen7629

@Vchen7629 Vchen7629 commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #2134 The TUI status screen was showing all container services as "Missing" on Podman because the container name resolution relied on reconstructing a {project_name}-{service} prefix, but Compose derives the project name from the compose file's directory (~/.openrag/tui/), producing tui-* containers instead of the assumed openrag-*. The fix introduces a _resolve_service_name helper that keys off the stable com.docker.compose.service label (Podman) and the Service field (Docker) before falling back to the existing name map, matching the pattern already used in welcome.py. This makes status resolution robust regardless of what project name Compose derives at runtime.

Changes

  • src/tui/managers/container_manager.py: add _resolve_service_name helper and wire it into both Docker and Podman status paths to resolve containers by compose label before falling back to the name map
  • tests/unit/test_container_manager_status.py: add regression and fallback tests for the new resolution logic

Summary by CodeRabbit

  • Bug Fixes
    • Improved container status detection for Docker and Podman environments.
    • Service names are now resolved reliably from compose metadata, even when container naming conventions differ.
    • Preserved fallback support for legacy container-name mappings.

ethanchoe-2 and others added 3 commits July 21, 2026 13:12
* fix: add ppc64le build support for frontend

Signed-off-by: Ethan Choe <ethanchoe@ibm.com>

* fix: add ppc64le webpack fallback for make frontend dev server

Signed-off-by: Ethan Choe <ethanchoe3@gmail.com>

* fix: use path.resolve for ENV_FILE to support absolute paths

Signed-off-by: Ethan Choe <ethanchoe3@gmail.com>

* fix: escape $(hostname) as $$(hostname) in Makefile frontend target

---------

Signed-off-by: Ethan Choe <ethanchoe@ibm.com>
Signed-off-by: Ethan Choe <ethanchoe3@gmail.com>
@Vchen7629
Vchen7629 requested a review from lucaseduoli July 21, 2026 23:14
@github-actions github-actions Bot added frontend 🟨 Issues related to the UI/UX backend 🔷 Issues related to backend services (OpenSearch, Langflow, APIs) tests bug 🔴 Something isn't working. labels Jul 21, 2026
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: cf1e1831-cbc8-4ae4-8cb6-4bcac5b9bfc4

📥 Commits

Reviewing files that changed from the base of the PR and between 547c868 and 2e7f0a3.

📒 Files selected for processing (1)
  • tests/unit/test_container_manager_status.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/unit/test_container_manager_status.py

Walkthrough

Container status resolution now prefers compose service metadata for Docker and Podman containers, falling back to legacy container-name mappings. Tests cover prefix-independent resolution and unmatched-container behavior.

Changes

Container status resolution

Layer / File(s) Summary
Canonical service-name resolution and validation
src/tui/managers/container_manager.py, tests/unit/test_container_manager_status.py
ContainerManager resolves services from compose fields or labels before using container_name_map; tests cover Docker JSON, Podman status refreshes, legacy fallback, and unrelated container names.

Estimated code review effort: 3 (Moderate) | ~15–30 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is specific and matches the main change: fixing TUI service status resolution.
Linked Issues check ✅ Passed The PR updates TUI container status resolution to use compose labels and fallback mapping, matching #2134.
Out of Scope Changes check ✅ Passed The changes stay focused on TUI service-name resolution and matching tests, with no unrelated behavior changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tui-service-status-fix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Jul 21, 2026
@Vchen7629
Vchen7629 changed the base branch from main to release-0.6.0 July 21, 2026 23:18
@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Jul 21, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
tests/unit/test_container_manager_status.py (1)

28-51: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a regression test for Docker Service-field resolution.

The production change covers both Podman labels and Docker’s Service field, but these tests only exercise the Podman path and direct fallback. Add a focused _process_service_json test so regressions in the Docker branch are detected.

Suggested test
+def test_process_service_json_resolves_by_compose_service():
+    manager = _make_manager()
+    services = {}
+
+    manager._process_service_json(
+        {
+            "Name": "tui-opensearch",
+            "Service": "opensearch",
+            "State": "running",
+        },
+        services,
+    )
+
+    assert services["opensearch"].status == ServiceStatus.RUNNING
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unit/test_container_manager_status.py` around lines 28 - 51, Add a
focused test for _process_service_json that supplies a container record with
Docker’s Service field and verifies it resolves to the expected service and
status. Keep the test independent of label-based resolution and assert the
Docker branch’s resulting service mapping so regressions are detected.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Makefile`:
- Around line 735-743: Extend the Power architecture fallback beyond the
Makefile frontend target so every frontend dev entrypoint uses Webpack on
ppc64le and ppc64. Update the frontend package-level dev command or the
Playwright startup configuration, using the existing architecture detection and
preserving plain next dev for other architectures; ensure both npm run dev and
Playwright startup select the fallback consistently.
- Around line 739-743: Update both Next.js dev command branches in the Makefile
to pass the configured bind-host variable instead of invoking the machine’s
hostname. Preserve the existing default and use the same host setting for both
the branch containing the preceding command and the npx next dev fallback.

---

Nitpick comments:
In `@tests/unit/test_container_manager_status.py`:
- Around line 28-51: Add a focused test for _process_service_json that supplies
a container record with Docker’s Service field and verifies it resolves to the
expected service and status. Keep the test independent of label-based resolution
and assert the Docker branch’s resulting service mapping so regressions are
detected.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e35f6e4a-ca04-4e13-b953-326edc4d2e5a

📥 Commits

Reviewing files that changed from the base of the PR and between a64af53 and 547c868.

📒 Files selected for processing (6)
  • Makefile
  • frontend/build.js
  • frontend/next.config.ts
  • frontend/package.json
  • src/tui/managers/container_manager.py
  • tests/unit/test_container_manager_status.py

coderabbitai[bot]

This comment was marked as outdated.

@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Jul 22, 2026

@lucaseduoli lucaseduoli left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but please merge to main instead of release-0.6.0. I will cherry pick the commit later

@github-actions github-actions Bot added the lgtm label Jul 22, 2026
@Vchen7629
Vchen7629 changed the base branch from release-0.6.0 to main July 22, 2026 19:43
@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Jul 22, 2026
@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Jul 22, 2026
@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Jul 22, 2026
@Vchen7629
Vchen7629 merged commit 04e8a1f into main Jul 22, 2026
36 checks passed
@github-actions
github-actions Bot deleted the tui-service-status-fix branch July 22, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend 🔷 Issues related to backend services (OpenSearch, Langflow, APIs) bug 🔴 Something isn't working. frontend 🟨 Issues related to the UI/UX lgtm tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] TUI is not reflecting state of the containers

3 participants