Skip to content

Conversation

@edenreich
Copy link
Contributor

Summary

This PR fixes the issue where logs from the agents manager were going to stdout in container mode, breaking the TUI.

Changes

  1. Container Detection: Added internal/utils/container.go to detect when CLI runs inside a container
  2. Skip Docker-in-Docker: Modified agent and MCP managers to skip local startup in container mode
  3. Redirect Output: All docker command output redirected to io.Discard to prevent TUI pollution
  4. Dockerfile Update: Set INFER_IN_CONTAINER=true for explicit detection
  5. Testing: Added unit tests for container detection

Testing

  • Run CLI in container mode: docker run --rm -it ghcr.io/inference-gateway/cli:latest
  • Verify no JSON logs appear in TUI
  • Verify remote agent discovery still works
  • Run unit tests: task test

Resolves #386


Generated with Claude Code

…n container mode

- Add container detection utility to identify when CLI runs in container
- Skip local agent/MCP server startup when in container mode (no Docker-in-Docker)
- Only discover remote agents from config.a2a.agents when containerized
- Redirect docker command stdout/stderr to prevent TUI pollution
- Set INFER_IN_CONTAINER=true in Dockerfile for explicit detection
- Fixes logs from agents manager breaking TUI in container mode

Resolves #386

Co-authored-by: Eden Reich <edenreich@users.noreply.github.com>
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.

[BUG] Logs from the agents manager going to stdout in container mode - breaking the TUI

2 participants