Skip to content

Silent exit (code 1, empty stdout/stderr) makes debugging impossible in automation contexts #1139

@18511267811wxd-afk

Description

@18511267811wxd-afk

Problem

When lark-cli fails in certain conditions, it exits with code 1 but produces
absolutely no output — stdout and stderr are both empty. This makes it impossible
to diagnose the root cause in automated/scripted contexts.

Reproduction

The following scenarios trigger silent failure (observed on macOS, using
spawnSync from Node.js with detached: true):

  1. Large --data payloadapi POST ... --data <json> fails silently when
    the JSON body exceeds ~100KB (works at ~24KB / 100 records, fails at ~132KB /
    500 records for a bitable/v1/.../records/batch_create call).

  2. Keychain session conflict — when lark-cli is spawned as a child of a
    Node.js process that has already opened a macOS Keychain session (e.g. via
    keytar), lark-cli cannot decrypt its stored token and fails silently.

In both cases: exit code = 1, stdout = "", stderr = "".

Impact

Because there is zero diagnostic output, the only way to find the root cause is
binary search (e.g. bisecting record count, isolating fields one by one). What
should be a 5-minute debug took several hours.

Expected behavior

Any non-zero exit should write a human-readable error to stderr. Examples:

  • Error: request body too large (132KB), consider splitting into smaller batches
  • Error: failed to decrypt token — Keychain session may be locked or inherited
  • Error: API returned 400 — {"code":1254015,"msg":"field type mismatch"}

Environment

  • macOS Sonoma
  • lark-cli / @larksuite/cli (latest)
  • Called via Node.js spawnSync with stdio: ['ignore','pipe','pipe']

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdomain/authAuthentication subsystem

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions