Skip to content

[Feature]: Expose changedFileCount in openclaw code run --json output #70

@zhyongrui

Description

@zhyongrui

Summary
Add one stable top-level numeric field to openclaw code run --json named changedFileCount.

Problem to solve
Downstream tooling can already read changedFiles, but simple consumers should not need the full array just to branch on how many files changed.

Proposed solution
Update src/commands/openclawcode.ts so the JSON output includes changedFileCount: number | null.

  • Use run.buildResult?.changedFiles.length ?? null
  • Keep existing changedFiles unchanged
    Add or adjust unit tests in src/commands/openclawcode.test.ts to cover both populated and missing-build-result cases.

Impact
Affected users/systems/channels
Tools and scripts that read openclaw code run --json.

Severity
Low.

Frequency
Whenever downstream tooling wants a compact file-count signal.

Consequence
Without the derived count, simple consumers keep deriving it themselves.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions