Skip to content

Conversation

@henryxwong
Copy link

Enhance debug log, to show the command line being executed and their output.

@vercel
Copy link

vercel bot commented Feb 11, 2026

@henryxwong is attempting to deploy a commit to the Goshen Labs Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot
Copy link

dosubot bot commented Feb 11, 2026

Related Documentation

Checked 30 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 11, 2026

Greptile Overview

Greptile Summary

This PR enhances CLI debug logging in cli/src/engines/base.ts by:

  • Printing the command being executed (with basic quoting for display).
  • Emitting truncated stdout/stderr (up to 50 lines) after command completion in execCommand, and for remaining buffers at the end of execCommandStreaming.

This fits into the engine layer where all AI backends shell out to provider CLIs; adding debug logs here makes verbose mode more informative across the whole CLI.

Key issues to address before merge:

  • The new logs can leak secrets because they print full command args and stdout/stderr verbatim in verbose mode.
  • execCommandStreaming logs output at the end for Node, but the Bun streaming path does not log output, leading to inconsistent behavior across runtimes.

Confidence Score: 3/5

  • This PR is mergeable after addressing debug-log data exposure and runtime inconsistency.
  • Changes are localized and straightforward, but the new verbose logs currently print raw command lines and outputs, which can leak credentials in real usage, and streaming output logging differs between Bun and Node paths.
  • cli/src/engines/base.ts

Important Files Changed

Filename Overview
cli/src/engines/base.ts Adds verbose debug logging of executed commands plus truncated stdout/stderr for execCommand and remaining buffers for execCommandStreaming; introduces formatCommand/logCommandOutput helpers but currently logs raw command args and stdout/stderr without redaction and misses logging in Bun streaming path.

Sequence Diagram

sequenceDiagram
    participant Caller
    participant Base as base.ts
    participant Log as logger.ts
    participant Proc as ChildProcess/Bun.spawn

    Caller->>Base: execCommand(cmd,args,workDir,env,stdin?)
    Base->>Log: logDebug("$ <formatted command>")
    Base->>Proc: spawn/spawnArgs
    Base->>Proc: collect stdout/stderr
    Proc-->>Base: stdout, stderr, exitCode
    Base->>Log: logDebug("[stdout] ...")
    Base->>Log: logDebug("[stderr] ...")
    Base-->>Caller: {stdout, stderr, exitCode}

    Caller->>Base: execCommandStreaming(cmd,args,...,onLine)
    Base->>Log: logDebug("$ <formatted command>")
    Base->>Proc: spawn
    Proc-->>Base: data events
    Base->>Caller: onLine(line)
    Proc-->>Base: close(exitCode)
    Base->>Log: logDebug("[stdout]/[stderr] (remaining buffers)")
    Base-->>Caller: {exitCode}
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +56 to +58
// Log the command being executed
logDebug(`$ ${formatCommand(command, args)}`);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sensitive data leakage

execCommand/execCommandStreaming now unconditionally logDebug the full command line (and later stdout/stderr). If args/stdout include secrets (API keys, tokens, auth headers, model provider keys, etc.), those will be printed in verbose mode and can end up in CI logs/bug reports. Consider redacting common secret patterns (or only logging the binary name + arg count) before emitting debug logs.

Prompt To Fix With AI
This is a comment left during a code review.
Path: cli/src/engines/base.ts
Line: 56:58

Comment:
**Sensitive data leakage**

`execCommand`/`execCommandStreaming` now unconditionally `logDebug` the full command line (and later stdout/stderr). If args/stdout include secrets (API keys, tokens, auth headers, model provider keys, etc.), those will be printed in verbose mode and can end up in CI logs/bug reports. Consider redacting common secret patterns (or only logging the binary name + arg count) before emitting debug logs.


How can I resolve this? If you propose a fix, please make it concise.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 11, 2026

Additional Comments (1)

cli/src/engines/base.ts
Inconsistent streaming logging

In execCommandStreaming, the Bun path returns { exitCode } without ever calling logCommandOutput, so verbose users get command/output logs on Node but not on Bun. If the intent is “show the command line being executed and their output” across runtimes, this needs a Bun-side equivalent (e.g., buffer the output while still streaming lines) or document that Bun streaming won’t log output.

Prompt To Fix With AI
This is a comment left during a code review.
Path: cli/src/engines/base.ts
Line: 320:345

Comment:
**Inconsistent streaming logging**

In `execCommandStreaming`, the Bun path returns `{ exitCode }` without ever calling `logCommandOutput`, so verbose users get command/output logs on Node but not on Bun. If the intent is “show the command line being executed and their output” across runtimes, this needs a Bun-side equivalent (e.g., buffer the output while still streaming lines) or document that Bun streaming won’t log output.


How can I resolve this? If you propose a fix, please make it concise.

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