Skip to content

Retry transient work-queue dispatch tag reads - #74934

Merged
pelikhan merged 4 commits into
mainfrom
copilot/work-queue-regression-fix
Nov 5, 2026
Merged

pelikhan merged 4 commits into
mainfrom
copilot/work-queue-regression-fix

Conversation

Copilot AI commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Transient failures during worker snapshot tag verification abort dispatch with work_queue_dispatch_tag_preparation_failed, leaving queued work unprocessed. Unlike other native metadata reads, these reads bypassed bounded retries and fetch-compatible deadlines.

  • Recovery: Route both tag lookup and post-creation read-back through readNativeMetadata, allowing up to three attempts with fresh 15-second AbortSignal deadlines and sanitized retry diagnostics.
  • Safety: Preserve exact ref/type/SHA verification and single-attempt tag creation and workflow dispatch.
  • Regression coverage: Cover socket-failure recovery on both read paths, retry exhaustion, and swallowed response-body timeouts.

Copilot AI changed the title [WIP] Fix work-queue regression preventing worker launch Retry transient work-queue dispatch tag reads Nov 4, 2026
Copilot AI requested a review from pelikhan November 4, 2026 19:16
@pelikhan
pelikhan marked this pull request as ready for review November 4, 2026 19:17
Copilot AI adaptive review requested due to automatic review settings November 4, 2026 19:17
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Ponytail Reviewer · routed: gpt56 max · ~3 AIC · ⌖ ~1 AIC · ⊞ 118 · ◷

Generated by Ponytail Reviewer for #74934

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

Design Decision Gate 🏗️

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Design Decision Gate 🏗️ · routed: gpt56 max · ~1 AIC · ⌖ ~2 AIC · ⊞ 7.7K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Test Quality Sentinel · routed: gpt56 max · ~1 AIC · ⌖ ~1 AIC · ⊞ 6.3K · ◷

🧪 Test quality analysis by Test Quality Sentinel

Copilot AI 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.

🟢 Approval recommended

No active review issues are recorded for the metadata-read retry change.

No open issues 🎉

What changed in this PR

This PR addresses #74601 by applying bounded metadata-read retries to worker snapshot tag verification, preventing transient read failures from prematurely aborting work-queue dispatch.

Changes:

  • Route both tag lookup and post-creation read-back through readNativeMetadata for retries and fresh 15-second deadlines.
  • Preserve exact tag verification and single-attempt tag creation and workflow dispatch.
  • Add regression coverage for transient recovery, retry exhaustion, and response-body timeouts.
File Description
actions/​setup/​js/​work_queue_native.test.cjs Remove retryable 502 errors from no-retry expectations.
actions/​setup/​js/​work_queue_native.cjs Use the metadata retry helper for both dispatch tag reads.
actions/​setup/​js/​work_queue_native_transport.test.cjs Add transport-level tests for recovery, retry limits, deadlines, and write call counts.

Review effort: Balanced (auto)

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-11-04T19:20:31Z
review_event: COMMENT
top_themes: [unbounded sequential retry latency]
files_reviewed: [actions/setup/js/work_queue_native.cjs, actions/setup/js/work_queue_native.test.cjs, actions/setup/js/work_queue_native_transport.test.cjs]
comment_count: 1

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.6K · ◷
Comment /review to run again

@github-actions github-actions 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.

Review completed with one performance concern.

Highlights
  • Tag reads now retry appropriately, but the create path can consume roughly 90 seconds because both sequential reads receive independent retry budgets without a combined deadline.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again

Comment thread actions/setup/js/work_queue_native.cjs Outdated
const sha = immutableRef(destination.ref);
const ref = `refs/tags/gh-aw/work-queue/${sha}`;
const parameters = { owner, repo, ref: ref.slice("refs/".length), headers: { "X-GitHub-Api-Version": API_VERSION }, request: { retries: 0, retryCount: 0, timeout: 15000 } };
const readTag = () => readNativeMetadata(request => githubClient.rest.git.getRef({ ...parameters, request }), "dispatch.tag.read");

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.

A transient failure can now hold tag preparation for roughly 90 seconds before dispatch fails, because each of the two sequential readTag calls may spend three 15-second attempts plus backoff and there is no overall deadline for dispatchTag.

💡 Bound the combined tag-preparation latency

The create path performs an initial read and then a read-back, and each independently gets the full retry budget. Under repeated timeouts or 5xx responses this can significantly delay queue dispatch and consume the caller's execution window. Share a deadline/retry budget across both reads (or otherwise cap dispatchTag's total duration), and add coverage for the create path's total budget.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 41f6697: the lookup and read-back now share a three-attempt budget. The create-path regression test verifies the combined read cap and fresh 15-second request deadlines.

@github-actions github-actions 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.

Skills-Based Review 🧠

Applied /diagnosing-bugs (error-path instrumentation) and /tdd (regression coverage). The retry logic and safety invariants look correct. One observability regression is worth fixing before merge.

📋 Key Themes & Highlights

Key Themes

  • Noisy error on the happy path: the expected first-read 404 on a new-tag launch now emits an always-on dispatch.tag.read.failed line.
  • Retry behaviour (3 attempts, fresh 15s signal per attempt, no retry on 404/403/429) matches the new tests.

Positive Highlights

  • ✅ Exact ref/type/SHA verification and single-attempt create and dispatch are preserved.
  • ✅ Tag-read tests cover socket recovery, exhaustion, and swallowed body timeouts with distinct abort signals.

Verification Gap

Vitest could not run in this environment because the npm registry failed TLS verification. I checked the logging behaviour with a direct Node probe instead of the test suite.

@copilot please address the review comment above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~6 AIC · ⌖ ~1 AIC · ⊞ 5.4K
Comment /matt to run again

Comment thread actions/setup/js/work_queue_native.cjs Outdated
const sha = immutableRef(destination.ref);
const ref = `refs/tags/gh-aw/work-queue/${sha}`;
const parameters = { owner, repo, ref: ref.slice("refs/".length), headers: { "X-GitHub-Api-Version": API_VERSION }, request: { retries: 0, retryCount: 0, timeout: 15000 } };
const readTag = () => readNativeMetadata(request => githubClient.rest.git.getRef({ ...parameters, request }), "dispatch.tag.read");

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.

[/diagnosing-bugs] On a normal first launch (tag missing, then created), the expected 404 on this first read now goes through readQueueMetadata, which logs dispatch.tag.read.failed at always-on level with the remediation text "Check the approved repository, worker revision, workflow path". Before this change the 404 was handled silently, so every new-tag launch now emits an error-level line that reads like a failure.

💡 Suggested fix

Only emit the failure-level log when the read will be retried or has exhausted its budget. A non-transient 404 should go to log.debug, or readNativeMetadata should accept an option that marks 404 as expected for this call site. Either way, add an assertion on log output for the missing-tag create path so this regression is caught.

@copilot please address this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 41f6697: the first-read 404 is logged at debug level as expected absence, and the create-path test asserts no dispatch.tag.read.failed line is emitted.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (actions/setup/js/work_queue_native.cjs:152): A transient failure can now hold tag preparation for roughly 90 seconds. Share a deadline/retry budget across both reads (or otherwise cap dispatchTag's total duration), and add coverage for the create path's total budget. - Retry transient work-queue dispatch tag reads #74934 (comment)
  3. Review (actions/setup/js/work_queue_native.cjs:152): [/diagnosing-bugs] Every new-tag launch now emits an error-level line that reads like a failure. Only emit the failure-level log when the read will be retried or has exhausted its budget, and add an assertion on log output for the missing-tag create path. - Retry transient work-queue dispatch tag reads #74934 (comment)

Once you start work, post this work summary as a PR comment, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI.

Sous-chef requested-head: e5e7cf6
Sous-chef requested-work: 016a0108c7396f16c450972e6ad065e2d1475b9ec0e524f149e5fece73da9624 2a94427cf5c7bd2db0bcb5e962104046a84f0193de598434db854f077b404384
Sous-chef requested-state: e4591016e97c62c714b668a0419010ea73f9e4c97d2745bca70ceb5fe02f1a20

Generated by 👨🍳 PR Sous Chef · pi · haiku45 · ~13 AIC · ⌖ ~21 AIC · ⊞ 1.2K · ◷
Comment /souschef to run again

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (actions/setup/js/work_queue_native.cjs:152): A transient failure can now hold tag preparation for roughly 90 seconds before dispatch fails, because each of the two sequential readTag calls may spend three 15-second attempts plus backoff and there is no overall deadline for dispatchTag. - Retry transient work-queue dispatch tag reads #74934 (comment)
  3. Review (actions/setup/js/work_queue_native.cjs:152): [/diagnosing-bugs] On a normal first launch (tag missing, then created), the expected 404 on this first read now goes through readQueueMetadata, which logs dispatch.tag.read.failed at always-on level with the remediation text "Check the approved repository, worker revision, workflow path". Before this change the 404 was handled silently, so every new-tag launch now emits an error-level line that reads like a failure. - Retry transient work-queue dispatch tag reads #74934 (comment)

Once you start work, post this work summary as a PR comment, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI.

Sous-chef requested-head: e5e7cf6
Sous-chef requested-work: 016a0108c7396f16c450972e6ad065e2d1475b9ec0e524f149e5fece73da9624 2a94427cf5c7bd2db0bcb5e962104046a84f0193de598434db854f077b404384
Sous-chef requested-state: e4591016e97c62c714b668a0419010ea73f9e4c97d2745bca70ceb5fe02f1a20

Generated by 👨🍳 PR Sous Chef · pi · haiku45 · ~10 AIC · ⌖ ~14 AIC · ⊞ 1.2K · ◷
Comment /souschef to run again

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (actions/setup/js/work_queue_native.cjs:152): A transient failure can now hold tag preparation for roughly 90 seconds before dispatch fails, because each of the two sequential readTag calls may spend three 15-second attempts plus backoff and there is no overall deadline for dispatchTag. - Retry transient work-queue dispatch tag reads #74934 (comment)
  3. Review (actions/setup/js/work_queue_native.cjs:152): [/diagnosing-bugs] On a normal first launch (tag missing, then created), the expected 404 on this first read now goes through readQueueMetadata, which logs dispatch.tag.read.failed at always-on level with the remediation text "Check the approved repository, worker revision, workflow path". Before this change the 404 was handled silently, so every new-tag launch now emits an error-level line that reads like a failure. - Retry transient work-queue dispatch tag reads #74934 (comment)

Once you start work, post this work summary as a PR comment, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI.

Sous-chef requested-head: e5e7cf6
Sous-chef requested-work: 016a0108c7396f16c450972e6ad065e2d1475b9ec0e524f149e5fece73da9624 2a94427cf5c7bd2db0bcb5e962104046a84f0193de598434db854f077b404384
Sous-chef requested-state: e4591016e97c62c714b668a0419010ea73f9e4c97d2745bca70ceb5fe02f1a20

Generated by 👨🍳 PR Sous Chef · pi · haiku45 · ~9 AIC · ⌖ ~8 AIC · ⊞ 1.2K · ◷
Comment /souschef to run again

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (actions/setup/js/work_queue_native.cjs:152): A transient failure can now hold tag preparation for roughly 90 seconds before dispatch fails, because each of the two sequential readTag calls may spend three 15-second attempts plus backoff and there is no overall deadline for dispatchTag. - Retry transient work-queue dispatch tag reads #74934 (comment)
  3. Review (actions/setup/js/work_queue_native.cjs:152): [/diagnosing-bugs] On a normal first launch (tag missing, then created), the expected 404 on this first read now goes through readQueueMetadata, which logs dispatch.tag.read.failed at always-on level with the remediation text "Check the approved repository, worker revision, workflow path". Before this change the 404 was handled silently, so every new-tag launch now emits an error-level line that reads like a failure. - Retry transient work-queue dispatch tag reads #74934 (comment)

Once you start work, post this work summary as a PR comment, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI.

Sous-chef requested-head: e5e7cf6
Sous-chef requested-work: 016a0108c7396f16c450972e6ad065e2d1475b9ec0e524f149e5fece73da9624 2a94427cf5c7bd2db0bcb5e962104046a84f0193de598434db854f077b404384
Sous-chef requested-state: e4591016e97c62c714b668a0419010ea73f9e4c97d2745bca70ceb5fe02f1a20

Generated by 👨🍳 PR Sous Chef · pi · haiku45 · ~16 AIC · ⌖ ~13 AIC · ⊞ 1.2K · ◷
Comment /souschef to run again

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (actions/setup/js/work_queue_native.cjs:152): A transient failure can now hold tag preparation for roughly 90 seconds before dispatch fails, because each of the two sequential readTag calls may spend three 15-second attempts plus backoff and there is no overall deadline for dispatchTag. - Retry transient work-queue dispatch tag reads #74934 (comment)
  3. Review (actions/setup/js/work_queue_native.cjs:152): [/diagnosing-bugs] On a normal first launch (tag missing, then created), the expected 404 on this first read now goes through readQueueMetadata, which logs dispatch.tag.read.failed at always-on level with the remediation text "Check the approved repository, worker revision, workflow path". Before this change the 404 was handled silently, so every new-tag launch now emits an error-level line that reads like a failure. - Retry transient work-queue dispatch tag reads #74934 (comment)

Once you start work, post this work summary as a PR comment, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI.

Sous-chef requested-head: e5e7cf6
Sous-chef requested-work: 016a0108c7396f16c450972e6ad065e2d1475b9ec0e524f149e5fece73da9624 2a94427cf5c7bd2db0bcb5e962104046a84f0193de598434db854f077b404384
Sous-chef requested-state: e4591016e97c62c714b668a0419010ea73f9e4c97d2745bca70ceb5fe02f1a20

Generated by 👨🍳 PR Sous Chef · pi · haiku45 · ~12 AIC · ⌖ ~16 AIC · ⊞ 1.2K · ◷
Comment /souschef to run again

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (actions/setup/js/work_queue_native.cjs:152): A transient failure can now hold tag preparation for roughly 90 seconds before dispatch fails, because each of the two sequential readTag calls may spend three 15-second attempts plus backoff and there is no overall deadline for dispatchTag. - Retry transient work-queue dispatch tag reads #74934 (comment)
  3. Review (actions/setup/js/work_queue_native.cjs:152): [/diagnosing-bugs] On a normal first launch (tag missing, then created), the expected 404 on this first read now goes through readQueueMetadata, which logs dispatch.tag.read.failed at always-on level with the remediation text "Check the approved repository, worker revision, workflow path". Before this change the 404 was handled silently, so every new-tag launch now emits an error-level line that reads like a failure. - Retry transient work-queue dispatch tag reads #74934 (comment)

Once you start work, post this work summary as a PR comment, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI.

Sous-chef requested-head: e5e7cf6
Sous-chef requested-work: 016a0108c7396f16c450972e6ad065e2d1475b9ec0e524f149e5fece73da9624 2a94427cf5c7bd2db0bcb5e962104046a84f0193de598434db854f077b404384
Sous-chef requested-state: e4591016e97c62c714b668a0419010ea73f9e4c97d2745bca70ceb5fe02f1a20

Generated by 👨🍳 PR Sous Chef · pi · haiku45 · ~19 AIC · ⌖ ~14 AIC · ⊞ 1.2K · ◷
Comment /souschef to run again

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (actions/setup/js/work_queue_native.cjs:152): A transient failure can now hold tag preparation for roughly 90 seconds before dispatch fails, because each of the two sequential readTag calls may spend three 15-second attempts plus backoff and there is no overall deadline for dispatchTag. - Retry transient work-queue dispatch tag reads #74934 (comment)
  3. Review (actions/setup/js/work_queue_native.cjs:152): [/diagnosing-bugs] On a normal first launch (tag missing, then created), the expected 404 on this first read now goes through readQueueMetadata, which logs dispatch.tag.read.failed at always-on level with the remediation text "Check the approved repository, worker revision, workflow path". Before this change the 404 was handled silently, so every new-tag launch now emits an error-level line that reads like a failure. - Retry transient work-queue dispatch tag reads #74934 (comment)

Once you start work, post this work summary as a PR comment, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI.

Sous-chef requested-head: e5e7cf6
Sous-chef requested-work: 016a0108c7396f16c450972e6ad065e2d1475b9ec0e524f149e5fece73da9624 2a94427cf5c7bd2db0bcb5e962104046a84f0193de598434db854f077b404384
Sous-chef requested-state: e4591016e97c62c714b668a0419010ea73f9e4c97d2745bca70ceb5fe02f1a20

Generated by 👨🍳 PR Sous Chef · pi · haiku45 · ~14 AIC · ⌖ ~8 AIC · ⊞ 1.2K · ◷
Comment /souschef to run again

@pelikhan

pelikhan commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

@copilot run pr-finisher skill

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants