Skip to content

fix(gh): devops gh api breaks a binary response #5015

Closed as not planned
Closed as not planned

Description

@dan-petty

Current Behavior

uv run devops gh api repos/<owner>/<repo>/actions/artifacts/<id>/zip > shard.zip writes a file that is not a valid zip. Each byte that is not valid UTF-8 becomes the replacement character U+FFFD (bytes 357 277 275 in od -c). The artifact coverage-shard-1 of run 43191263934 has 2,420,029 bytes on GitHub, and the written file has 4,456,457 bytes. devops gh has no other command that downloads a run artifact (devops gh run has only list and view), and AGENTS.md rule 7 forbids bare gh. So an agent cannot read a CI artifact.

Expected Behavior

devops gh can write a binary response or a run artifact to a file with no change to its bytes, for example with an --output <file> option of devops gh api, or with devops gh run download <run> --name <artifact> like gh run download.

Steps to Reproduce

  1. uv run devops gh api repos/dan-petty/devops-cli/actions/artifacts/13930239167/zip > shard.zip
  2. head -c 64 shard.zip | od -c shows 357 277 275 after the PK header, and a zip reader refuses the file.

Evidence

Found while building #4673 on 2026-11-12. #4673 makes each test shard upload a JUnit XML report in its artifact coverage-shard-<n>, and the split by measured time (#4250) reads these reports. Thus #4250 needs an artifact download through devops gh.

Activity

  1. added
    source/agent
    type/bug
    scope/gh
    status/new
    value/medium
    effort/medium
    on Nov 12, 2026
  2. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Nov 12, 2026
  4. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor

    This issue is closed as not planned, because #5223 supersedes it.

    The owner asked on 2026-11-12 that devops commands that run a CLI tool take the names of the tool and pass its arguments through. #5223 does two things that cover this issue:

    • It adds devops gh run download as a pass-through to gh run download. gh writes the artifact files, and devops never reads their bytes.
    • It reads the output of each pass-through command with the surrogateescape handler and masks it. So devops gh api <route> > file keeps each byte.

    The acceptance criteria of #5223 hold the reproduction of this issue: artifact coverage-shard-1 of run 43191263934, 2,420,029 bytes.

  5. removed
    status/new
    on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/ghsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions