Skip to content

fix(workflow-executor): accept LOG_LEVEL case-insensitively#1684

Merged
PMerlet merged 2 commits into
mainfrom
fix/workflow-executor-log-level-case-insensitive
Jun 19, 2026
Merged

fix(workflow-executor): accept LOG_LEVEL case-insensitively#1684
PMerlet merged 2 commits into
mainfrom
fix/workflow-executor-log-level-case-insensitive

Conversation

@PMerlet

@PMerlet PMerlet commented Jun 19, 2026

Copy link
Copy Markdown
Member

Problem

When the executor runs alongside other services sharing an environment/secret, LOG_LEVEL is often set in lowercase (e.g. info). The CLI validated it against a strict Debug | Info | Warn | Error enum, so info threw ConfigurationError at startup → the process exits → the container never serves (deploy goes unhealthy, 100% 5xx).

Hit in real life deploying the executor as a Beanstalk service: the shared staging/env-vars secret sets LOG_LEVEL=info, crashing the executor on boot.

Fix

parseLoggerLevelEnv now normalizes the raw value to canonical case (raw[0].toUpperCase() + rest.toLowerCase()) before validating. So info, INFO, debug, WARN, … are accepted and mapped to Info/Debug/Warn; genuinely unknown levels (trace, verbose, …) still throw the same ConfigurationError.

Tests

  • New: info/INFO/debug/WARN/error parse to the canonical level.
  • Updated: the "throws on invalid" cases no longer include debug/info (now valid); trace/fatal/verbose/xxx still throw.
  • Full cli.test.ts green (68 tests).

🤖 Generated with Claude Code

Note

Accept LOG_LEVEL env var case-insensitively in workflow-executor

Normalizes the LOG_LEVEL value in parseLoggerLevelEnv by capitalizing the first character and lowercasing the rest before validating against the schema, so values like info, INFO, or Warn are all accepted. Tests are updated to cover the new case-insensitive behavior and remove previously invalid cases that are now valid.

Macroscope summarized 9c9c5c6.

PMerlet and others added 2 commits June 19, 2026 10:48
When the executor shares an environment/secret with other services, LOG_LEVEL
often comes in lowercase (e.g. "info"). The strict Debug/Info/Warn/Error enum
rejected it, throwing ConfigurationError at startup and crashing the process.

Normalize the value to the canonical case before validating, so "info", "INFO",
"debug", etc. are accepted; genuinely unknown levels (trace, verbose, …) still
throw.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@qltysh

qltysh Bot commented Jun 19, 2026

Copy link
Copy Markdown

Qlty


Coverage Impact

This PR will not change total coverage.

Modified Files with Diff Coverage (1)

RatingFile% DiffUncovered Line #s
Coverage rating: A Coverage rating: A
packages/workflow-executor/src/cli-core.ts100.0%
Total100.0%
🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@PMerlet PMerlet merged commit dcb8769 into main Jun 19, 2026
31 checks passed
@PMerlet PMerlet deleted the fix/workflow-executor-log-level-case-insensitive branch June 19, 2026 11:32
forest-bot added a commit that referenced this pull request Jun 19, 2026
## @forestadmin/workflow-executor [1.5.1](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/workflow-executor@1.5.0...@forestadmin/workflow-executor@1.5.1) (2026-06-19)

### Bug Fixes

* **workflow-executor:** accept LOG_LEVEL case-insensitively ([#1684](#1684)) ([dcb8769](dcb8769))
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.

1 participant