[DAS-Dashboard#1193] Error in metrics overview - #306
Conversation
WalkthroughContainer manager factories now provide service metadata. Docker containers receive managed and service labels. System container discovery filters by the managed label and returns service names and command labels. The query-agent command adds two aliases. ChangesService metadata discovery
Query-agent aliases
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant Factory as ContainerManagerFactory
participant Manager as ContainerManager
participant Docker
participant Status as SystemContainersManager
Factory->>Manager: provide service metadata options
Manager->>Docker: start container with managed and service labels
Status->>Docker: list containers with das-cli.managed=true
Docker-->>Status: return labels and container stats
Status->>Status: map labels to service status fields
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@das-cli/src/common/container_manager/system_containers_manager.py`:
- Line 23: Add pytest coverage for the managed-container label flow around the
container listing and startup factories: verify name-only “das” containers are
excluded while containers labeled das-cli.managed=true are included, map
agent.name and command.label to service_name and service_command_label, return
None for missing metadata, assert each factory’s display and command labels, and
confirm startup passes all three labels to Docker. Place the tests under
das-cli/tests/agents_integration/ (or use bats under das-cli/tests/integration/)
with concrete cases for each behavior.
- Line 23: Update the container listing logic around the system container
manager’s containers.list call so containers created by earlier CLI versions
remain visible instead of relying exclusively on the das-cli.managed=true label.
Prefer compatibility handling that includes existing containers, or document the
required restart and add an upgrade integration test covering previously started
services.
In `@das-cli/src/common/docker/container_manager.py`:
- Around line 96-101: Ensure every managed container receives service_name and
service_command_label metadata before ContainerManager startup, including
containers created through ContainerManagerFactory and existing ContainerTypes
stubs. Update the relevant constructor/factory initialization so
ContainerManager.labels never raises KeyError, and align
SystemContainersManager’s status filter with the added label metadata.
🪄 Autofix
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: ASSERTIVE
Plan: Pro Plus
Run ID: 26f6b2a7-f8ab-40d9-a775-50caa6ef62a2
📒 Files selected for processing (9)
das-cli/src/common/container_manager/system_containers_manager.pydas-cli/src/common/docker/container_manager.pydas-cli/src/common/factory/atomdb/mongodb_manager_factory.pydas-cli/src/common/factory/atomdb/morkdb_manager_factory.pydas-cli/src/common/factory/atomdb/redis_manager_factory.pydas-cli/src/common/factory/attention_broker_manager_factory.pydas-cli/src/common/factory/busnode_manager_factory.pydas-cli/src/common/factory/jupyter_notebook_manager_factory.pydas-cli/src/common/factory/metta/database_loader_manager_factory.py
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@das-cli/src/commands/query_agent/query_agent_cli.py`:
- Line 232: Add integration coverage for the aliases defined in
query_agent_cli.py, invoking both query-engine and qe. Extend existing CLI tests
if available, otherwise add bats tests under das-cli/tests/integration/ or
pytest tests under das-cli/tests/agents_integration/ covering at least one valid
subcommand and one error path, with behavior matching qa and query.
In `@das-cli/src/common/docker/container_manager.py`:
- Line 75: Update ContainerManager.__init__ to initialize self._options to an
empty dictionary only when the instance does not already have _options,
preserving subclass assignments made before super().__init__(). Keep the
existing dict[str, Any] annotation and ensure base methods such as labels can
access the attribute.
🪄 Autofix
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: ASSERTIVE
Plan: Pro Plus
Run ID: a435d50c-9217-415c-bab6-6fafc095aedb
📒 Files selected for processing (7)
das-cli/src/commands/query_agent/query_agent_cli.pydas-cli/src/common/container_manager/metta/metta_syntax_container_manager.pydas-cli/src/common/container_manager/system_containers_manager.pydas-cli/src/common/docker/container_manager.pydas-cli/src/common/factory/atomdb/morkdb_manager_factory.pydas-cli/src/common/factory/busnode_manager_factory.pydas-cli/src/common/factory/database_adapter/database_adapter_factory.py
💤 Files with no reviewable changes (1)
- das-cli/src/common/factory/busnode_manager_factory.py
Fixed an issue where containers not started by DAS-CLI could still appear in the UI:
Quick showcase:
(The service running outside of das-cli's environment was the command-router, as you can see it doesn't show up anymore on the UI)
Screencast.from.2026-08-04.13-47-07.webm