Skip to content

Commit 3155e42

Browse files
Peter MarreckPeter Marreck
authored andcommitted
fix(log_cmd): reap child on read errors in realRunner
realRunner's cleanup only called child.wait() on clean EOF. If read() failed after spawn succeeded, the child would become a zombie. Add an errdefer right after spawn so any subsequent error still reaps the process. Also mark the syslog-logging feature complete in PLAN.md.
1 parent f64b13d commit 3155e42

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

PLAN.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@
114114
### Phase 5: Enhancements
115115
- [ ] `codescan symbols --depth N` — limit nesting depth in output (e.g. struct methods without reading bodies)
116116
- [ ] CamelCase/snake_case normalization in lexical search (so `nameRelevance` matches `name_relevance`)
117+
- [x] Watcher syslog logging + `codescan log` subcommand and MCP tool (completed 2026-04-18 EST) — OS-managed logs so we can diagnose watcher stops after the fact; filterable by project root via `log show` / `journalctl -t codescan`. Spec: `docs/superpowers/specs/2026-04-18-watcher-syslog-logging-design.md`. Plan: `docs/superpowers/plans/2026-04-18-watcher-syslog-logging.md`.
118+
- [ ] Env-var expansion in config file values (`$VAR`, `${VAR}`, `${VAR:-default}`, `${VAR-default}`, nested) with raw-preservation on save for secret fields — inbox note: `inbox/2026-04-18-config-env-var-expansion.md`. Reference impl in docscan `cli/main.c:1344-1509`. Lets users commit a config with `embedding_api_key = ${CODESCAN_EMBEDDING_SERVER_API_KEY}` without leaking the secret.
117119
- [x] Auto-reindex after CLI edits (skip re-embedding, daemon catches up on vectors)
118120
- [x] `codescan rename` applies edits by default (`--dry-run` for preview-only)
119121
- [x] Hashlines in `codescan references` output for stale-edit protection

src/log_cmd.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ fn realRunner(
183183
child.stdout_behavior = .Pipe;
184184
child.stderr_behavior = .Inherit;
185185
try child.spawn();
186+
errdefer _ = child.wait() catch {};
186187

187188
var out = std.ArrayListUnmanaged(u8){};
188189
errdefer out.deinit(allocator);

0 commit comments

Comments
 (0)