Skip to content

Agent service turns pretty logging on when LOG_PRETTY is false #9660

Todo

Description

@anishshiva7

What happened?

The agent service turns pretty logging on when LOG_PRETTY is set to false or 0.

Root cause: agent-service/src/config/env.ts parses it with z.coerce.boolean(). That coercion is plain Boolean(value), so any non-empty string is true:

LOG_PRETTY=false  ->  true   (pino-pretty transport attached)
LOG_PRETTY=0      ->  true
LOG_PRETTY=       ->  false
unset             ->  false

logger.spec.ts doesn't catch this, because it mocks env with a real boolean and never goes through the parser. A deployment that writes LOG_PRETTY=false to turn pretty output off gets pino-pretty instead of the plain JSON lines a log collector expects.

Expected: true/1 turn it on, false/0/empty/unset leave it off, and any other value fails at startup like the other invalid settings in that schema.

How to reproduce?

From agent-service/:

import { z } from "zod";
z.coerce.boolean().default(false).parse("false"); // true
z.coerce.boolean().default(false).parse("0");     // true

Or start the service with LOG_PRETTY=false bun run src/server.ts: the output is pretty-printed, not JSON.

Activity

  1. github-actions commented on Nov 24, 2026

    @github-actions
    Contributor

    👋 Thanks for opening this issue, @anishshiva7!

    It looks like the issue description doesn't quite follow our template yet:

    • This issue doesn't appear to use one of our templates (Bug, Feature, or Task). Please open it using a template so the required details are captured.

    Filling out the template helps reviewers understand and triage your contribution faster. Please edit the description to complete it. This message will disappear automatically once the template is followed.

    You can find the template prompts by editing the description, or see CONTRIBUTING.md for the full contribution flow.

  2. anishshiva7 commented on Nov 24, 2026

    @anishshiva7
    ContributorAuthor

    /take

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions