Skip to content

fix(cli): honor OS_LOG_LEVEL / --log-level instead of hardcoding silent (#1533) - #1539

Merged
os-zhuang merged 2 commits into
mainfrom
claude/keen-euler-BywzR
Jun 2, 2026
Merged

os-zhuang merged 2 commits into
mainfrom
claude/keen-euler-BywzR

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Summary

Fixes #1533.

os serve / os start constructed the runtime kernel with a hardcoded { level: 'silent' } logger and no override, suppressing every plugin logger.warn / logger.error. A record-change flow whose condition or node faulted (logged via logger.warn in plugin-trigger-record-change) produced zero operator-visible output — the flow simply had no effect — directly undercutting ADR-0032's "fail loudly" promise when running via the CLI. (ADR-0032's own incident write-up calls out "the CLI forces the kernel logger to level:'silent'" as why the reporter "could not see any logs".)

What changed

The kernel logger level is now resolved (precedence order):

  1. --verbose → debug
  2. --log-level <level> → explicit level
  3. $OS_LOG_LEVEL / $LOG_LEVEL
  4. default → warn

Defaulting to warn (instead of silent) surfaces flow/hook execution-failure warnings and automation-engine errors out of the box, while the existing boot-quiet window still suppresses the noisier info-level startup chatter. Pass --log-level silent (or OS_LOG_LEVEL=silent) to restore the old fully-quiet behavior.

Details

  • New pure helper packages/cli/src/utils/log-level.ts (LOG_LEVELS, resolveLogLevel, readLogLevelEnv, DEFAULT_LOG_LEVEL) — unit-testable without importing the whole runtime.
  • serve gains --log-level and --verbose flags; replaces the hardcoded silent.
  • start and dev gain a matching --log-level flag and forward it (plus the existing --verbose) to the spawned serve.
  • Incidentally fixes a latent bug: both start and dev already passed --verbose to serve, a flag serve never declared (oclif strict parsing would reject it).

Tests

packages/cli/test/serve-log-level.test.ts — covers the warn default (the #1533 regression guard), env honoring, flag-over-env precedence, --verbose → debug, case-insensitivity/trimming, unknown-level fallback, and round-trips every documented level. All 8 pass locally.

Compatibility

  • Behavior change: the runtime no longer defaults to fully silent. Operators who relied on silence can set --log-level silent / OS_LOG_LEVEL=silent.
  • No API/schema changes.

https://claude.ai/code/session_01Sn5oqHMikzQMbzfzVbfVNi


Generated by Claude Code

…#1533)

`os serve` / `os start` constructed the runtime kernel with a hardcoded
`{ level: 'silent' }` logger, suppressing every plugin `logger.warn` /
`logger.error`. As a result a record-change flow whose condition or node
faulted produced zero operator-visible output — the flow simply had no
effect — directly undercutting ADR-0032's "fail loudly" promise when
running via the CLI (the silent logger is even called out by name in
ADR-0032's incident write-up).

Resolve the kernel logger level from, in precedence order:
  1. `--verbose`            → debug
  2. `--log-level <level>`  → explicit level
  3. `$OS_LOG_LEVEL` / `$LOG_LEVEL`
  4. default                → `warn`

Defaulting to `warn` (rather than `silent`) surfaces flow/hook
execution-failure warnings and automation-engine errors out of the box,
while the existing boot-quiet window still suppresses the noisier
info-level startup chatter. `--log-level silent` restores the old
fully-quiet behavior.

The resolution lives in a small pure helper (`utils/log-level.ts`) so it
is unit-testable without importing the whole runtime. `start` and `dev`
gain a matching `--log-level` flag and forward it (plus the existing
`--verbose`) to the spawned `serve` — which also fixes a latent bug where
both already passed `--verbose` to `serve`, a flag it never declared.
@vercel

vercel Bot commented Jun 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 2, 2026 10:25am

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation tooling labels Jun 2, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review June 2, 2026 10:31
@os-zhuang
os-zhuang merged commit 1e0b6d7 into main Jun 2, 2026
12 checks passed
xuyushun441-sys pushed a commit that referenced this pull request Jun 6, 2026
feat(detail): derive related lists from relationships (read-side mirror of inlineEdit) (#1539)

objectui@c657e9b180a8c7aa56938d22d7baaee5dc8fc765
@github-actions
github-actions Bot deleted the claude/keen-euler-BywzR branch September 7, 2026 04:49

This branch was successfully deployed

1 active deployment
Preview — 0d1a7fec Deployed Jun 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cli: serve/start hardcodes logger level "silent" — flow & hook execution failures are invisible (defeats ADR-0032 "fail loudly")

2 participants