Skip to content

fix(dev-cli): handle non-compose infra services in logs command#1301

Merged
evanjacobson merged 1 commit intoKilo-Org:improvement/kiloclaw-dev-clifrom
evan-claw:fix/logs-non-compose-infra-services
Mar 20, 2026
Merged

fix(dev-cli): handle non-compose infra services in logs command#1301
evanjacobson merged 1 commit intoKilo-Org:improvement/kiloclaw-dev-clifrom
evan-claw:fix/logs-non-compose-infra-services

Conversation

@evan-claw
Copy link
Copy Markdown
Contributor

Problem

The logs command assumes all infra services are Docker Compose services and unconditionally runs docker compose -f dev/docker-compose.yml logs -f <name> for them.

However, migrations is registered as an infra service with devCommand: "pnpm drizzle migrate" — it is not a Docker Compose service. The docker-compose.yml only defines postgres and redis.

Running pnpm kilo logs migrations executes docker compose ... logs -f migrations, which fails immediately because no such compose service exists.

Proof the issue is real

  1. Registry: migrations has type: "infra" and devCommand: "pnpm drizzle migrate" (registry.ts)
  2. docker-compose.yml: Only defines postgres and redis — no migrations service (docker-compose.yml)
  3. logs.ts (before fix): Line 21 checks svc.type === "infra" and runs docker compose logs -f with the service name — this sends migrations to docker compose, which fails

Proof this is not a band-aid

The root issue is in logs.ts itself: it incorrectly equates "infra service" with "Docker Compose service". The migrations service is correctly categorized as infra (it is infrastructure — DB migrations must run before app services). The registry is correct. The fix belongs in the logs command.

Changes

dev/cli/src/commands/logs.ts:

  • Added a check: only run docker compose logs for infra services whose devCommand starts with "docker compose"
  • Non-compose infra services (like migrations) now show a helpful warning explaining that the service is not a Docker Compose service and does not produce persistent logs

dev/cli/test/logs.test.ts (new):

  • 4 tests validating the invariants the logs command relies on:
    • migrations is infra with a non-compose devCommand
    • postgres/redis are infra with compose devCommands
    • At least one non-compose infra service exists (regression guard)
    • Compose infra service names match their docker-compose service names

All 19 tests pass (15 existing + 4 new).

Fixes review comment: #1142 (comment)

The logs command assumed all 'infra' services are Docker Compose services,
but 'migrations' is an infra service that runs 'pnpm drizzle migrate' —
not a docker compose service. Running 'pnpm kilo logs migrations' would
execute 'docker compose logs -f migrations' which fails immediately since
no such compose service exists.

Now the logs command checks whether an infra service's devCommand starts
with 'docker compose' before attempting to tail compose logs. Non-compose
infra services get a helpful warning message instead of a silent failure.

Adds test/logs.test.ts with 4 tests validating these invariants.
@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented Mar 19, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • dev/cli/src/commands/logs.ts
  • dev/cli/test/logs.test.ts

Reviewed by gpt-5.4-20260305 · 162,752 tokens

@evanjacobson evanjacobson merged commit 79ad70f into Kilo-Org:improvement/kiloclaw-dev-cli Mar 20, 2026
1 check passed
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.

2 participants