fix(dev-cli): handle non-compose infra services in logs command#1301
Merged
evanjacobson merged 1 commit intoKilo-Org:improvement/kiloclaw-dev-clifrom Mar 20, 2026
Conversation
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.
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Reviewed by gpt-5.4-20260305 · 162,752 tokens |
79ad70f
into
Kilo-Org:improvement/kiloclaw-dev-cli
1 check passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
logscommand assumes allinfraservices are Docker Compose services and unconditionally runsdocker compose -f dev/docker-compose.yml logs -f <name>for them.However,
migrationsis registered as aninfraservice withdevCommand: "pnpm drizzle migrate"— it is not a Docker Compose service. Thedocker-compose.ymlonly definespostgresandredis.Running
pnpm kilo logs migrationsexecutesdocker compose ... logs -f migrations, which fails immediately because no such compose service exists.Proof the issue is real
migrationshastype: "infra"anddevCommand: "pnpm drizzle migrate"(registry.ts)postgresandredis— nomigrationsservice (docker-compose.yml)svc.type === "infra"and runsdocker compose logs -fwith the service name — this sendsmigrationsto docker compose, which failsProof this is not a band-aid
The root issue is in
logs.tsitself: it incorrectly equates "infra service" with "Docker Compose service". Themigrationsservice is correctly categorized asinfra(it is infrastructure — DB migrations must run before app services). The registry is correct. The fix belongs in thelogscommand.Changes
dev/cli/src/commands/logs.ts:docker compose logsfor infra services whosedevCommandstarts with"docker compose"migrations) now show a helpful warning explaining that the service is not a Docker Compose service and does not produce persistent logsdev/cli/test/logs.test.ts(new):migrationsis infra with a non-compose devCommandpostgres/redisare infra with compose devCommandsAll 19 tests pass (15 existing + 4 new).
Fixes review comment: #1142 (comment)