Skip to content

Prevent MCP compile bulk mode from hanging on large workflow sets#35935

Closed
Copilot wants to merge 3 commits into
mainfrom
copilot/cli-tools-test-fix-bug-compile-tool-timeout
Closed

Prevent MCP compile bulk mode from hanging on large workflow sets#35935
Copilot wants to merge 3 commits into
mainfrom
copilot/cli-tools-test-fix-bug-compile-tool-timeout

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 30, 2026

Bulk agenticworkflows compile . could run indefinitely when invoked without workflows on repositories with many workflow markdown files. Targeted compiles were fast, so the failure mode was specific to unbounded bulk execution in the MCP compile path.

  • Bulk compile timeout guard (MCP tool path)

    • Added a timeout for compile tool invocations when workflows is omitted (bulk mode).
    • Timeout is scoped to MCP subprocess execution; targeted workflows calls keep existing behavior.
  • Structured failure output instead of protocol error

    • On timeout, the tool now returns normal compile JSON with a config_error entry and actionable guidance to compile in smaller batches via workflows.
    • Preserves MCP contract: callers still receive parseable compile results, not transport/protocol failure.
  • Focused regression coverage

    • Added a unit test that forces bulk timeout and asserts structured JSON output, error type, and guidance text.
if len(args.Workflows) == 0 {
    execCtx, cancel = context.WithTimeout(ctx, mcpCompileBulkTimeout)
    defer cancel()
}

stdout, err := execCmd(execCtx, cmdArgs...).Output()

if len(args.Workflows) == 0 && errors.Is(execCtx.Err(), context.DeadlineExceeded) {
    // return JSON validation result with config_error + batching guidance
}

Copilot AI and others added 2 commits May 30, 2026 14:57
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] Fix compile tool timeout issue in bulk mode for large repositories Prevent MCP compile bulk mode from hanging on large workflow sets May 30, 2026
Copilot AI requested a review from pelikhan May 30, 2026 15:02
@pelikhan pelikhan closed this May 30, 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.

[cli-tools-test] bug: compile tool (bulk mode) times out / hangs with large workflow repositories

2 participants