Skip to content

fix(github): recover oversized issue creation - #8217

Merged
AmethystLiang merged 2 commits into
stablyai:mainfrom
rodboev:pr/github-oversized-issue-create
Jul 11, 2026
Merged

AmethystLiang merged 2 commits into
stablyai:mainfrom
rodboev:pr/github-oversized-issue-create

Conversation

@rodboev

@rodboev rodboev commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Recover GitHub issue creation when GitHub rejects an oversized pasted-image body by creating the issue first and then saving the original body through the update endpoint.
  • Limit the fallback to GitHub's body-too-long validation response. Other validation, authentication, and network failures retain their existing behavior.
  • Report partial success clearly if GitHub creates the issue but rejects the follow-up body update.

Closes #7704.

Screenshots

No visual change

Testing

  • pnpm lint
  • pnpm typecheck
  • pnpm test
  • pnpm build
  • Added or updated high-quality tests that would catch regressions, or explained why tests were not needed

Focused validation run in this session:

  • pnpm exec vitest run --config config/vitest.config.ts src/main/github/issues.test.ts - passed; 14 tests passed, including oversized-body recovery, placeholder-create failure, unrelated-validation negative space, field preservation, and partial-success reporting.
  • pnpm run typecheck:node - passed.
  • pnpm exec oxlint src/main/github/issues.ts src/main/github/issues.test.ts - passed.
  • pnpm exec oxfmt --check src/main/github/issues.ts src/main/github/issues.test.ts - passed.

AI Review Report

The fallback is confined to GitHub's body is too long (maximum is 65536 characters) validation response. Tests cover the reporter-shaped data:image body, placeholder-create failure, ordinary creation, metadata preservation, unrelated failures, and partial-success reporting. Repository routing and WSL execution options remain unchanged.

Security Audit

Argument-array execution through ghExecFileAsync is preserved, with no shell interpolation or new credentials, dependencies, IPC permissions, or filesystem paths. Unrelated errors do not create placeholder issues, and a failed patch reports the created issue identity without claiming the body was saved.

Notes

The change is confined to GitHub issue creation and focused backend tests. Existing issue editing, GitLab, Jira, Linear, renderer draft reconciliation, release metadata, and localization remain unchanged.

@AmethystLiang
AmethystLiang self-requested a review July 11, 2026 05:16
@coderabbitai

coderabbitai Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 82838d71-32dc-4d8f-9423-f3d3481156c1

📥 Commits

Reviewing files that changed from the base of the PR and between fc93030 and 6db20f5.

📒 Files selected for processing (7)
  • src/main/github/issues.test.ts
  • src/main/github/issues.ts
  • src/preload/api-types.ts
  • src/preload/index.ts
  • src/renderer/src/components/TaskPage.tsx
  • src/renderer/src/components/task-page-github-issue-creation.test.ts
  • src/shared/types.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/main/github/issues.ts
  • src/main/github/issues.test.ts

📝 Walkthrough

Walkthrough

createIssue now centralizes GitHub issue creation arguments and handles oversized body errors by creating an empty-body issue, then patching the original body. It returns distinct errors for unrelated failures, invalid follow-up responses, and patch failures. Shared result typing is propagated through preload APIs, while the renderer uses a longer timeout and preserves the draft when body saving returns a warning. Tests cover recovery, failure paths, preserved fields, execution options, and partial success.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. 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 is concise and accurately summarizes the main change: recovering oversized GitHub issue creation.
Description check ✅ Passed All required sections are present and substantive, though the AI Review Report is a bit light on explicit cross-platform verification.
Linked Issues check ✅ Passed The changes implement the exact recovery flow in #7704, including placeholder create, body retry, limited fallback, and partial-success reporting.
Out of Scope Changes check ✅ Passed The renderer, preload, and shared-type updates support the same issue-creation recovery flow and do not introduce unrelated functionality.

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.

@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: Pro

Run ID: f42e0d8a-3871-4bb2-b7e1-586c4a6ba52d

📥 Commits

Reviewing files that changed from the base of the PR and between 4df9457 and 508398f1db050fbaabcf6e2387d69ba28f4e3f61.

📒 Files selected for processing (2)
  • src/main/github/issues.test.ts
  • src/main/github/issues.ts

Comment thread src/main/github/issues.ts Resolved
@rodboev
rodboev force-pushed the pr/github-oversized-issue-create branch from 508398f to fc93030 Compare July 11, 2026 05:24
@AmethystLiang

Copy link
Copy Markdown
Contributor

Thanks @rodboev — I pushed a maintainer follow-up that:

  • reads structured gh stderr so oversized-body recovery triggers reliably;
  • treats create-success/body-save-failure as partial success and preserves the issue identity;
  • extends the remote RPC timeout for the bounded recovery path;
  • shows an actionable warning while retaining the unsaved body and preventing an accidental duplicate create;
  • adds regression coverage for the backend and renderer behavior.

Verification: 17 focused tests, full typecheck, targeted lint/format, and the max-lines ratchet pass. Full repo lint reaches localization verification and is blocked by four unrelated missing keys in ai-vault-session-log-open.ts already present on main.

Electron disclosure: an isolation attempt unexpectedly routed mutation calls through the long-lived runtime and created blank issues #8232 and #8233; both were immediately closed as not planned. Per explicit owner direction, I stopped further Electron attempts and proceeded with automated coverage and CI despite that golden-path validation gap.

@AmethystLiang AmethystLiang 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.

Approved after the maintainer follow-up. The structured-error recovery, partial-success UX, timeout, draft preservation, and regression coverage are in place; the Electron validation exception is documented in the PR comment.

@AmethystLiang
AmethystLiang merged commit b677b2a into stablyai:main Jul 11, 2026
3 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* fix(github): recover oversized issue creation (stablyai#7704)

* fix(github): preserve partial issue creation

---------

Co-authored-by: Jinjing <6427696+AmethystLiang@users.noreply.github.com>
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]: GitHub issue creation fails when pasted images make the body exceed create API limits

2 participants