Skip to content

fix(github): keep pasted issue images off Windows gh argv (#15832) - #15877

Closed
bbingz wants to merge 3 commits into
stablyai:mainfrom
bbingz:fix/15832-windows-issue-body-enamtoolong
Closed

bbingz wants to merge 3 commits into
stablyai:mainfrom
bbingz:fix/15832-windows-issue-body-enamtoolong

Conversation

@bbingz

@bbingz bbingz commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Pasted screenshots can make issue or PR bodies larger than Windows can pass on a command line. The issue and project-view body-writing calls covered here now read JSON from a temporary file instead of placing the body on argv.

What Changed

  • Reuse withGhApiJsonInput for issue creation, edits, comments, project-view issue/comment edits, and PR-slug body edits.
  • Keep title-only issue patches and body-free PR title/state patches on their existing raw-field path.
  • Preserve empty-body updates, GHES host options, REST errors, temporary-file cleanup, and the existing oversized-body create-then-PATCH recovery.
  • Rebased onto bba68b1bddf1276c8bd27ad4ca41efcbd4260321 and added PR-slug regression coverage.

Why

The original branch still placed PR-slug bodies on argv and changed title-only transport despite describing it as unchanged. Both paths now match the stated contract. No new dependency or wire change.

Linked Issue

Fixes #15832

Visual Proof

N/A — request serialization and subprocess argv only.

Testing

  • Manually reproduced on Windows
  • Automated regression coverage

RED: 4 regression assertions failed before the follow-up fix. GREEN: 35 tests across issues.test.ts, gh-api-json-input.test.ts, project-view/mutations.test.ts, project-view/issue-comment-mutations.test.ts, and project-view/pull-request-mutation.test.ts; another 10 map-with-concurrency smoke tests passed.

Node, CLI, and Web TypeScript checks passed using the repository's non-composite configuration (tsc --noEmit -p config/tsconfig.{node,cli,web}.json --composite false, run separately). Changed-file oxlint, oxfmt, and diff checks passed. Tool versions match package.json.

Default composite typecheck reports TS2883 in unchanged files. Its Node diagnostic set was also reproduced on pristine base bba68b1bdd; it is not reported as passing. Full suite/build and live Windows/SSH/GHES execution were not run.

Existing assertion change: restored the GHES title-only assertion to --raw-field title=New title; the former branch assertion incorrectly required --input. Body tests read the real temporary file during mocked network execution; the serialization helper and mutation functions are not mocked.

AI Disclosure

Original implementation: Grok. Follow-up: Codex; independent Cursor review passed for tree eda0c0a83aeb6532eaa20e6220e760da48e9e396, committed unchanged as cd31c8c137b6a84644f1e2b59822db6778e42ff9.

Review

GitHub/GHES-specific API paths only. Folder workspaces use the OS temporary directory; existing execution-host and WSL path translation remain in place. Error propagation and temporary cleanup are covered, including empty and 140 KB bodies.

Agent skill upstream boundary

  • Not applicable; no upstream skill-installer material copied.

Checklist

  • Scope and behavioral changes explained
  • Regression tests and changed-file checks passed
  • Cross-platform, SSH/folder, and provider boundaries considered
  • Full lint/typecheck/test/build matrix passed (limitations above)

@coderabbitai

coderabbitai Bot commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 4de6ad42-60d0-42c7-8d37-58c871fdb8a9

📥 Commits

Reviewing files that changed from the base of the PR and between cd31c8c137b6a84644f1e2b59822db6778e42ff9 and 4120c9a.

📒 Files selected for processing (4)
  • src/main/github/issue-create.ts
  • src/main/github/issues.test.ts
  • src/main/github/project-view/issue-comment-mutations.test.ts
  • src/main/github/project-view/mutations.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

Added withGhApiJsonInput to serialize request bodies into temporary JSON files and pass them with --input. Migrated issue creation, issue updates, comments, and project-view mutations to JSON request payloads. Added oversized-body recovery for GitHub validation errors and ENAMETOOLONG. Updated tests to inspect JSON files and verify cleanup, payloads, endpoints, and recovery behavior.

Priority: ➖ Normal

Severity of issue fixed: Medium

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 23.53% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 17 functions across 12 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary fix: keeping pasted issue images off the Windows gh command-line arguments. It is concise and related to the main change.
Description check ✅ Passed The description includes the required sections, linked issue, user-facing change, rationale, testing results and limitations, AI disclosure, cross-platform considerations, and checklist status. It cle…
Linked Issues check ✅ Passed Issue #15832 requires that large issue bodies do not use the gh command line for issue creation, issue updates, comments, and the create-then-PATCH recovery. The PR uses withGhApiJsonInput and `--…
Out of Scope Changes check ✅ Passed The changes stay within the stated scope of issue #15832. The shared JSON-input helper, regression tests, project-view mutations, and pull-request body mutations support the same requirement to keep l…
  • Fix all pre-merge checks with AI

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@bbingz
bbingz force-pushed the fix/15832-windows-issue-body-enamtoolong branch from 18abb20 to e07fa05 Compare September 2, 2026 02:59
@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: e79679ac-f893-4045-bc00-3d5c2fe6b028

📥 Commits

Reviewing files that changed from the base of the PR and between 7f6cf27 and e07fa05d53be131f3dc59c9cde4b522246c74611.

📒 Files selected for processing (10)
  • src/main/github/gh-api-json-input.test.ts
  • src/main/github/gh-api-json-input.ts
  • src/main/github/issue-comment.ts
  • src/main/github/issue-create.ts
  • src/main/github/issue-update.ts
  • src/main/github/issues.test.ts
  • src/main/github/project-view/issue-comment-mutations.test.ts
  • src/main/github/project-view/issue-comment-mutations.ts
  • src/main/github/project-view/mutations.test.ts
  • src/main/github/project-view/mutations.ts
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/main/github/issue-comment.ts
  • src/main/github/gh-api-json-input.test.ts
  • src/main/github/gh-api-json-input.ts
  • src/main/github/issues.test.ts
  • src/main/github/issue-update.ts
  • src/main/github/issue-create.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@bbingz
bbingz force-pushed the fix/15832-windows-issue-body-enamtoolong branch from e07fa05 to cd31c8c Compare September 8, 2026 12:40
@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@bbingz
bbingz force-pushed the fix/15832-windows-issue-body-enamtoolong branch from cd31c8c to 4120c9a Compare September 20, 2026 08:10
@nwparker

nwparker commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Closing as superseded — the linked issue (#15832) has been resolved on main by #25215 (6ad0a42425). Thanks for the contribution!

@nwparker nwparker closed this Nov 5, 2026
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.

[Bug]: Windows — creating a GitHub issue with a pasted image fails with "spawn ENAMETOOLONG"; the #7704 oversized-body fallback never engages

2 participants