Title: Add retry logic with jitter for sub_issue_write to handle parallel calls · Issue #1842 · github/github-mcp-server · GitHub
Open Graph Title: Add retry logic with jitter for sub_issue_write to handle parallel calls · Issue #1842 · github/github-mcp-server
X Title: Add retry logic with jitter for sub_issue_write to handle parallel calls · Issue #1842 · github/github-mcp-server
Description: Problem When sub_issue_write tool is called in parallel (common with AI agents), multiple calls can fail with: 422 An error occurred while adding the sub-issue to the parent issue. Priority has already been taken This happens because Git...
Open Graph Description: Problem When sub_issue_write tool is called in parallel (common with AI agents), multiple calls can fail with: 422 An error occurred while adding the sub-issue to the parent issue. Priority has alr...
X Description: Problem When sub_issue_write tool is called in parallel (common with AI agents), multiple calls can fail with: 422 An error occurred while adding the sub-issue to the parent issue. Priority has alr...
Opengraph URL: https://github.com/github/github-mcp-server/issues/1842
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add retry logic with jitter for sub_issue_write to handle parallel calls","articleBody":"## Problem\n\nWhen `sub_issue_write` tool is called in parallel (common with AI agents), multiple calls can fail with:\n\n```\n422 An error occurred while adding the sub-issue to the parent issue. Priority has already been taken\n```\n\nThis happens because GitHub's sub-issues API assigns priority sequentially, and parallel calls conflict when they try to claim the same priority slot.\n\n## Proposed Solution\n\nAdd retry logic with random jitter to `sub_issue_write` operations:\n\n1. **Retry up to 3 times** on 422 errors related to priority conflicts\n2. **Add random jitter** (e.g., 50-200ms) before each retry to desynchronize parallel calls\n3. Only retry on specific \"Priority has already been taken\" errors, not all 422s\n\n## Example Implementation\n\n```go\nfunc (s *SubIssueService) Add(ctx context.Context, owner, repo string, issueNum int, subIssueID int64) (*github.Issue, error) {\n const maxRetries = 3\n \n for attempt := 0; attempt \u003c maxRetries; attempt++ {\n if attempt \u003e 0 {\n // Random jitter: 50-200ms to desynchronize parallel retries\n jitter := time.Duration(50+rand.Intn(150)) * time.Millisecond\n time.Sleep(jitter)\n }\n \n issue, resp, err := s.client.Issues.AddSubIssue(ctx, owner, repo, issueNum, subIssueID)\n if err == nil {\n return issue, nil\n }\n \n // Only retry on priority conflict errors\n if resp != nil \u0026\u0026 resp.StatusCode == 422 \u0026\u0026 strings.Contains(err.Error(), \"Priority has already been taken\") {\n continue\n }\n \n return nil, err\n }\n \n return nil, fmt.Errorf(\"failed after %d retries: priority conflict\", maxRetries)\n}\n```\n\n## Why This Matters\n\nParallel tool calling is very popular with AI agents. When an agent needs to add multiple sub-issues to an epic, it naturally calls them in parallel for efficiency. Without retry logic, a significant portion of these calls fail, degrading the user experience.\n\n## Acceptance Criteria\n\n- [ ] `sub_issue_write` with `add` method retries up to 3 times on priority conflicts\n- [ ] Random jitter (50-200ms) is added between retries\n- [ ] Other 422 errors are not retried\n- [ ] Unit tests cover retry behavior\n- [ ] Existing functionality is preserved","author":{"url":"https://github.com/SamMorrowDrums","@type":"Person","name":"SamMorrowDrums"},"datePublished":"2026-01-19T21:16:06.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1842/github-mcp-server/issues/1842"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:aac260c1-bafa-637f-fd08-f77fac7192eb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9168:1D4720:78FA37:ADAB42:6A637C06 |
| html-safe-nonce | a92b4d31d78d5f749919cb1fd91440eee53030be1f2eb5579ed3e8e157918efc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MTY4OjFENDcyMDo3OEZBMzc6QURBQjQyOjZBNjM3QzA2IiwidmlzaXRvcl9pZCI6IjI1MDEyOTU2NDI1MTU4MzE4MTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 85a1befa204102c81755c6b33b13494c409bb9ab93bd0fd6ed1c6ee8095f3056 |
| hovercard-subject-tag | issue:3831226448 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/github/github-mcp-server/1842/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5c4d0596147775666ec07e9e0b6bb575ff4e7f1aeecdd2ba8171db43b9da9110/github/github-mcp-server/issues/1842 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5c4d0596147775666ec07e9e0b6bb575ff4e7f1aeecdd2ba8171db43b9da9110/github/github-mcp-server/issues/1842 |
| og:image:alt | Problem When sub_issue_write tool is called in parallel (common with AI agents), multiple calls can fail with: 422 An error occurred while adding the sub-issue to the parent issue. Priority has alr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | SamMorrowDrums |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4c1de337de00c7969335f8866af41463301071379a3a15fba12e9b85aa6378d6 |
| turbo-cache-control | no-preview |
| go-import | github.com/github/github-mcp-server git https://github.com/github/github-mcp-server.git |
| octolytics-dimension-user_id | 9919 |
| octolytics-dimension-user_login | github |
| octolytics-dimension-repository_id | 942771284 |
| octolytics-dimension-repository_nwo | github/github-mcp-server |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 942771284 |
| octolytics-dimension-repository_network_root_nwo | github/github-mcp-server |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a4df32552e4c631011bdcd4c81cc3d7408664a8b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width