Skip to content

Retry MCP gateway startup and identify pre-agent checkout failures - #72970

Merged
pelikhan merged 5 commits into
mainfrom
copilot/harden-mcp-gateway-checkout
Oct 30, 2026
Merged

pelikhan merged 5 commits into
mainfrom
copilot/harden-mcp-gateway-checkout

Conversation

Copilot AI commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Gateway and checkout failures before agent execution can surface as generic agent failures. This change adds one gateway startup retry and step-specific diagnostics, including pull-request merge refs.

  • Gateway recovery: Retry launch/readiness failures once after process cleanup; keep configuration errors fail-fast.
  • Failure attribution: Use Actions metadata to identify pre-agent setup failures without misclassifying post-agent failures or overriding redaction-failure priority.
  • Merge-ref diagnostics: Include the requested ref for confirmed trigger-ref checkouts and guidance to check availability and mergeability—without falling back to the head branch.

<!-- START COPILOT CODING AGENT SUFFIX -->


Changeset

  • Type: patch
  • Description: Retry MCP gateway startup failures once and improve diagnostics for pre-agent checkout failures.

Generated by 📋 Changeset Generator for #72970 · codex · gpt56 · ~17 AIC · ⌖ ~28 AIC · ⊞ 15.3K · ◷



✨ PR Review Safe Output Test - Run 41084447691

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • update.googleapis.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "update.googleapis.com"

See Network Configuration for more information.

💥 [THE END] — Illustrated by Smoke Claude · claude · sonnet46 · ~78 AIC · ⌖ ~8 AIC · ⊞ 926 · ◷
Comment /smoke-claude to run again

Copilot AI and others added 2 commits October 29, 2026 12:33
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add preflight retries and diagnostics for gateway and checkout Retry MCP gateway startup and identify pre-agent checkout failures Oct 29, 2026
Copilot AI requested a review from pelikhan October 29, 2026 12:39
@pelikhan
pelikhan marked this pull request as ready for review October 29, 2026 14:17
Copilot AI auto review requested due to automatic review settings October 29, 2026 14:17
@github-actions

github-actions Bot commented Oct 29, 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 · haiku45 · ~7 AIC · ⌖ ~12 AIC · ◇ ~8 AIC · ⊞ 8.9K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Oct 29, 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 🏗️ · opus55 · ~12 AIC · ⌖ ~38 AIC · ◇ ~3 AIC · ⊞ 1.9K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Oct 29, 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 Oct 29, 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 Oct 29, 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 · gpt56 · ~12 AIC · ⌖ ~6 AIC · ⊞ 14.8K · ◷

Generated by Ponytail Reviewer for #72970

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-10-29T14:20:22Z
review_event: REQUEST_CHANGES
top_themes: deterministic configuration errors retried; retry budget reset across attempts; fragile generic Execute-step boundary
files_reviewed:
  - actions/setup/js/handle_agent_failure.cjs
  - actions/setup/js/handle_agent_failure.test.cjs
  - actions/setup/js/start_mcp_gateway.cjs
  - actions/setup/js/start_mcp_gateway.test.cjs
  - schemas/audit.schema.json
  - schemas/logs-jsonl.schema.json
comment_count: 3

Quiet branches sway
Small green checks bloom in the dusk
Code rests with the moon

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

🔮 The oracle has spoken through Smoke Codex · codex · ~14 AIC · ⌖ ~1 AIC · ⊞ 21.3K · ◷
Comment /smoke-codex 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.

Request changes

The retry and diagnostics changes contain correctness issues that can misreport failures and substantially extend startup time.

Details
  • ERR_SAFE_OUTPUTS_GATEWAY_CONFIG is retried despite being deterministic configuration failure.
  • Each retry gets a fresh full health/readiness timeout, potentially doubling startup duration.
  • Generic Execute step matching can misattribute pre-agent failures when user-defined steps share that prefix.

The specialist pass completed; its advisory findings were adjudicated before publication.

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

Comment thread actions/setup/js/start_mcp_gateway.cjs Outdated
activeGatewayPid = null;
clearGatewayStartupMarker(getGatewayStartupMarkerPath());
const message = redactGatewayDiagnostics(getErrorMessage(err));
if (message.startsWith(`${ERR_CONFIG}:`)) throw err;

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.

This retries deterministic safe-outputs gateway configuration failures, contradicting the fail-fast behavior and producing a misleading startup-retry error.

💡 Why this matters

waitForSafeOutputsReadiness throws ERR_SAFE_OUTPUTS_GATEWAY_CONFIG, but this guard only exempts ERR_CONFIG:. The closure is therefore relaunched and the final diagnostic says the gateway failed after two startup attempts even though configuration cannot recover by restarting. Treat this configuration error code as non-retryable and add a regression test.

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.

ERR_SAFE_OUTPUTS_GATEWAY_CONFIG now fails fast through the outer retry wrapper, with regression coverage preserving its original code. Commit 0858968.

Comment thread actions/setup/js/start_mcp_gateway.cjs Outdated
}
child.stdin.write(JSON.stringify(configObj));
child.stdin.end();
const { gatewayPid, stderrPath } = await startGatewayWithRetry(async () => {

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.

The retry gives each full startup attempt a fresh health/readiness budget, so a broken gateway can consume roughly twice the configured startup timeout before the job fails.

💡 Why this matters

startupDeadline is derived from the new gatewayStartTime inside the retried closure. A health failure can already consume the complete backend startup budget, then the second launch receives another complete budget and its own 5-second initialization wait. On workflows near their job timeout this turns a bounded startup failure into a substantially longer timeout. Share one overall deadline across attempts or limit the retry to the launch/liveness phase, and test the bound.

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.

Health and readiness now share one startup deadline across outer retries, and initialization/retry waits are capped by the remaining budget. Regression tests cover the shared deadline. Commit 0858968.

}
const steps = agentJob.steps?.slice();
const steps = agentJob.steps?.slice() || [];
const setupBoundary = steps.findIndex(step => step.name === "Start MCP Gateway" || (typeof step.name === "string" && step.name.startsWith("Execute ")));

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.

Using any step beginning with Execute as the setup boundary can misattribute failures when a workflow contains an unrelated user step with that name.

💡 Why this matters

The classifier stops its pre-agent search at the first matching display name, so a custom Execute migrations step before the generated checkout can prevent a real checkout failure from being recognized, or mark the wrong step as pre-agent. Match the generated engine step names (or a stable identifier) rather than the generic prefix, and add a regression case for an unrelated Execute ... step.

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.

Failure attribution now recognizes generated Execute … CLI steps rather than every Execute … label; a regression test covers an unrelated Execute migrations step preceding checkout. Commit 0858968.

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.

🟡 Changes recommended

The outer retry restarts the container on permanent configuration and authentication/protocol failures, obscuring configuration error codes and repeating non-retryable handshakes.

1 open issue
What changed in this PR

This PR hardens gh-aw’s pre-agent setup for #72887 by adding gateway startup recovery and more specific failure diagnostics.

Changes:

  • Retries gateway startup once after cleanup.
  • Identifies pre-agent gateway and checkout failures using Actions metadata, with merge-ref guidance for confirmed trigger-ref checkouts.
  • Adds regression tests and model-catalog fields to audit and log schemas.
File Description
schemas/​logs-jsonl.schema.json Adds model-catalog metadata to log records.
schemas/​audit.schema.json Adds model-catalog metadata to audit output.
actions/​setup/​js/​start_mcp_gateway.test.cjs Tests retry limits, recovery, and configuration fail-fast behavior.
actions/​setup/​js/​start_mcp_gateway.cjs Adds startup retry, cleanup, and failure context.
actions/​setup/​js/​handle_agent_failure.test.cjs Tests pre-agent attribution and merge-ref diagnostics.
actions/​setup/​js/​handle_agent_failure.cjs Classifies setup failures and renders targeted guidance.

Review effort: Balanced (auto)

Comment thread actions/setup/js/start_mcp_gateway.cjs Outdated
activeGatewayPid = null;
clearGatewayStartupMarker(getGatewayStartupMarkerPath());
const message = redactGatewayDiagnostics(getErrorMessage(err));
if (message.startsWith(`${ERR_CONFIG}:`)) throw err;

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.

The readiness helper now propagates an explicit non-retryable signal for authentication/protocol failures, and the outer wrapper preserves the original error without repeating the handshake. Tests cover both cases. Commit 0858968.

@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 and /codebase-design — the fix itself is correct and well covered by tests (merge-ref checkout, post-agent checkout exclusion, config-error fail-fast, single-retry success/exhaustion). Two non-blocking maintainability suggestions below.

📋 Key Themes & Highlights

Key Themes

  • Readability debt: the setupFailure boundary-detection expression in handle_agent_failure.cjs packs several boolean conditions and string predicates into one unnamed ternary, making it hard to verify by inspection.
  • Duplicated literal: the "Start MCP Gateway" step-name string is repeated across start_mcp_gateway.cjs and handle_agent_failure.cjs with no shared constant, so a future step rename could silently break pre-agent attribution.

Positive Highlights

  • ✅ startGatewayWithRetry cleanly separates config errors (fail-fast) from transient errors (retry once), and resource cleanup (stopGatewayProcess, marker clearing, fd closing) is handled consistently across both failure paths.
  • ✅ New handle_agent_failure.test.cjs cases cover the tricky edge cases that matter most for correctness: merge-ref checkout failures, non-default checkout/gateway failures without assuming a ref, and (critically) not misclassifying a post-agent checkout as pre-agent.
  • ✅ Redaction-failure priority is preserved — preAgentFailure does not override it since setupFailure is only consulted after the !startupFailure && redactionStep check.

@copilot please address the review comments above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · ~103 AIC · ⌖ ~16 AIC · ⊞ 10.2K
Comment /matt to run again

const steps = agentJob.steps?.slice();
const steps = agentJob.steps?.slice() || [];
const setupBoundary = steps.findIndex(step => step.name === "Start MCP Gateway" || (typeof step.name === "string" && step.name.startsWith("Execute ")));
const setupFailure =

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.

[/codebase-design] The setupFailure ternary (lines 2017-2025) packs five conditions and three string-matching predicates (startsWith("Execute "), startsWith("Checkout "), literal "Start MCP Gateway") into a single unnamed expression. This is hard to verify by inspection and easy to subtly break on the next step rename.

💡 Suggested refactor

Extract named predicates/constants so the logic reads as a spec:

const isExecuteStep = step => typeof step.name === "string" && step.name.startsWith("Execute ");
const isCheckoutStep = step => typeof step.name === "string" && step.name.startsWith("Checkout ");
const isSetupStep = step => step.name === "Start MCP Gateway" || isCheckoutStep(step);

const setupBoundary = steps.findIndex(step => step.name === "Start MCP Gateway" || isExecuteStep(step));
const agentNeverRan = setupBoundary >= 0 && !steps.some(step => isExecuteStep(step) && step.conclusion !== "skipped");
const boundaryFailed = setupBoundary >= 0 && ["skipped", "failure", "timed_out"].includes(steps[setupBoundary].conclusion);
const anyExecuteSkipped = steps.some(step => isExecuteStep(step) && step.conclusion === "skipped");

const setupFailure =
  boundaryFailed && agentNeverRan && (startupFailure || steps[setupBoundary].conclusion === "skipped" || anyExecuteSkipped)
    ? steps.slice(0, setupBoundary + (steps[setupBoundary].name === "Start MCP Gateway" ? 1 : 0)).find(step => ["failure", "timed_out"].includes(step.conclusion) && isSetupStep(step))
    : undefined;

This reduces the amount of boolean algebra a reviewer must hold in their head at once and makes the step-name matching reusable with the literal already duplicated at start_mcp_gateway.cjs:746 and handle_agent_failure.cjs:4150.

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

I extracted named step predicates and split the setup-boundary logic into explicit conditions while preserving redaction-failure priority. Commit 0858968.

Comment thread actions/setup/js/start_mcp_gateway.cjs Outdated
const message = redactGatewayDiagnostics(getErrorMessage(err));
if (message.startsWith(`${ERR_CONFIG}:`)) throw err;
if (attempt === 2) {
throw codedError(`Pre-agent failure in step "Start MCP Gateway" after 2 startup attempts: ${message}`, ERR_SYSTEM, { cause: err });

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] The string "Start MCP Gateway" is duplicated here and in handle_agent_failure.cjs line 2016/2023 (step-name matching) with no shared constant. If this Action step is ever renamed, pre-agent failure attribution silently stops matching while this error message keeps saying the same thing, producing a misleading-but-plausible diagnostic instead of a loud failure.

💡 Suggested fix

Extract a shared constant (e.g. in constants.cjs or a small module both files import) such as STEP_NAME_START_MCP_GATEWAY = "Start MCP Gateway", and use it in both files. Add a cheap regression test that fails if the literal drifts between the two files (e.g. assert the generated YAML step name from checkout_step_generator.go/mcp_setup_generator.go matches the literal used here).

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

Both startup diagnostics and failure attribution now use the shared STEP_NAME_START_MCP_GATEWAY constant from constants.cjs. Commit 0858968.

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot run pr-finisher skill

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Copilot Auto completed successfully!

Generated by Smoke Copilot Auto for #72970

@github-actions

Copy link
Copy Markdown
Contributor

✨ Gemini awakens... Smoke Gemini begins its journey on this pull request...

@github-actions

Copy link
Copy Markdown
Contributor

🔧 Starting tool validation... Agent Container Smoke Test is checking the agent container tools...

@github-actions github-actions Bot removed the smoke label Oct 30, 2026
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

🔮 The oracle has spoken through Smoke Codex

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Smoke Pi MISSION COMPLETE! Pi delivered. 🥧

🥧 Smoke Pi — Powered by Pi

@github-actions

Copy link
Copy Markdown
Contributor

🌅 Haiku

Gateway stumbles once,
retries rise from clean ashes —
the merge ref speaks truth.

Inspired by PR #72970: retrying MCP gateway startup and clearer pre-agent checkout failures.

Generated by 🌸 Smoke Copilot Auto for #72970 · copilot · auto · ~10 AIC · ⌖ ~7 AIC · ⊞ 6.7K · ◷
Add label smoke to run again

@github-actions

Copy link
Copy Markdown
Contributor
  1. GitHub CLI: ✅
  2. Web Fetch: ❌
  3. File Writing: ✅
  4. Bash Tool: ❌
  5. Build gh-aw: ✅
  6. Codemode: ❌

Overall Status: FAIL

🥧 Smoke Pi — Powered by Pi · pi · auto · ~1 AIC · ⌖ ~6 AIC · ⊞ 10.6K · ◷
Comment /smoke-pi to run again

@github-actions

Copy link
Copy Markdown
Contributor

Commit pushed: 26726ec

Generated by Changeset Generator · codex · gpt56 · ~17 AIC · ⌖ ~28 AIC · ⊞ 15.3K

@github-actions

Copy link
Copy Markdown
Contributor

Codex smoke test: FAIL

✅ GitHub MCP · ✅ Serena (3 symbols) · ❌ Playwright (policy blocked) · ❌ native web fetch (HTTP 400)
✅ File writing · ✅ Bash verification · ✅ Build · ✅ Comment memory
❌ Cache memory (access prohibited) · Set Issue Field skipped (discovery unavailable)
❌ Preview title validation (host URL conflicts with loopback policy)
PR titles: [blog] Agent of the Day – 2026-10-30; Add reusable Harbor ATIF session exports.
6 passed, 3 failed/blocked, 1 skipped; smoke-test issue queued.
Timestamp: 2026-10-30T15:57:24Z; issue timestamp was entered 36 seconds ahead.
§41084447751

🔮 The oracle has spoken through Smoke Codex · codex · ~14 AIC · ⌖ ~1 AIC · ⊞ 21.3K · ◷
Comment /smoke-codex to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Copilot: partial. ✅ PRs, mcpscripts, curl, file, build, artifact, memory, sub-agent, check run; ❌ Serena CLI, Playwright, discussions, dispatch, review, LSP not run. Overall: FAIL. cc @pelikhan @Copilot (author: copilot-swe-agent)

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • host.docker.internal
  • update.googleapis.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "host.docker.internal"
    - "update.googleapis.com"

See Network Configuration for more information.

📰 BREAKING: Report filed by Smoke Copilot · copilot · auto · ~46 AIC · ⌖ ~1 AIC · ⊞ 7.6K · ◷
Comment /smoke-copilot to run again
Add label smoke to run again

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (smoke)
Tests run quietly
Green checks bloom at dawn
Smoke clears, build sings

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

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • host.docker.internal
  • update.googleapis.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "host.docker.internal"
    - "update.googleapis.com"

See Network Configuration for more information.

📰 BREAKING: Report filed by Smoke Copilot · copilot · auto · ~46 AIC · ⌖ ~1 AIC · ⊞ 7.6K · ◷
Comment /smoke-copilot to run again
Add label smoke to run again

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

💥 Smoke Test Run 41084447691

Core Tests: ✅✅✅✅✅✅✅✅✅✅✅✅

  1. GitHub MCP ✅ 2. GH CLI ✅ 3. Make Build ✅ 4. Playwright ✅ 5. Tavily ✅ 6. File Write ✅ 7. Bash ✅ 8. Discussion ✅ 9. AW MCP ✅ 10. Slack ✅ 11. Code Scanning ✅ 12. Check Run ✅

PR Review Tests (#72970):

  1. Update PR ✅ 14. Review Comments ✅ 15. Submit Review ✅ 16. Resolve Thread ⚠️ (GraphQL unavailable) 17. Add Reviewer ✅ 18. Push Branch ✅ 19. Close PR ⚠️ (skipped)

Overall: PARTIAL (2 skipped, all others passed)

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • update.googleapis.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "update.googleapis.com"

See Network Configuration for more information.

💥 [THE END] — Illustrated by Smoke Claude · claude · sonnet46 · ~78 AIC · ⌖ ~8 AIC · ⊞ 926 · ◷
Comment /smoke-claude 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.

💥 Automated smoke test review - all systems nominal!

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • update.googleapis.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "update.googleapis.com"

See Network Configuration for more information.

💥 [THE END] — Illustrated by Smoke Claude · claude · sonnet46 · ~78 AIC · ⌖ ~8 AIC · ⊞ 926
Comment /smoke-claude to run again

* @param {number} [startupDeadline]
* @returns {Promise<T>}
*/
async function startGatewayWithRetry(start, startupDeadline = Infinity) {

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.

👍 Nice addition of startGatewayWithRetry — the single retry approach strikes a good balance between resilience and avoiding infinite loops. Consider documenting the rationale for exactly one retry in the JSDoc to help future maintainers.

const ALLOWED_AGENT_CONCLUSIONS = new Set(["success", "failure", "cancelled", "skipped", "neutral", "timed_out", "action_required", "stale"]);
const EXECUTE_AGENT_STEP_NAME_RE = /^Execute .+ CLI$/;

function isExecuteAgentStep(step) {

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.

Good decomposition into small, focused predicate functions (isExecuteAgentStep, isGatewayStartupStep, isCheckoutStep). This makes the failure attribution logic much easier to follow and test in isolation. ✅

@pelikhan
pelikhan merged commit 627fa58 into main Oct 30, 2026
3 checks passed
@pelikhan
pelikhan deleted the copilot/harden-mcp-gateway-checkout branch October 30, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[AW Top 10] 08 Harden MCP gateway and checkout before agent start

3 participants