Skip to content

Extend MCP logs timeout for engine-filtered queries - #52063

Merged
pelikhan merged 6 commits into
mainfrom
copilot/cli-tools-test-logs-engine-filter-timeout-fix
Aug 11, 2026
Merged

Extend MCP logs timeout for engine-filtered queries#52063
pelikhan merged 6 commits into
mainfrom
copilot/cli-tools-test-logs-engine-filter-timeout-fix

Conversation

Copilot AI commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Engine-filtered logs requests can scan workflow artifacts across runs and exceed the default one-minute budget, even for small result counts. The compile tool also did not show that workflows accepts an array.

  • Logs timeout
    • Apply the existing five-minute implicit timeout floor when engine is specified.
    • Preserve explicit timeout values and count-based scaling.
if workflowName == "" || engine != "" {
    return max(defaultMCPLogsMinTimeoutMinutesAllWorkflows, base)
}
  • Regression coverage

    • Cover engine-filtered requests with a named workflow.
  • Compile tool schema

    • Document array input syntax: ["workflow.md"].

Run: https://github.com/github/gh-aw/actions/runs/31508439729> Generated by 👨‍🍳 PR Sous Chef · gpt54 · 35.1 AIC · ⌖ 6.14 AIC · ⊞ 8.5K ·

Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · gpt54 · 12.5 AIC · ⌖ 3.4 AIC · ⊞ 8.5K ·
Comment /souschef to run again

Copilot AI and others added 2 commits August 11, 2026 13:34
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 engine filter timeout in logs tool Extend MCP logs timeout for engine-filtered queries Aug 11, 2026
Copilot AI requested a review from pelikhan August 11, 2026 13:37
@pelikhan
pelikhan marked this pull request as ready for review August 11, 2026 13:43
Copilot AI balanced review requested due to automatic review settings August 11, 2026 13:43

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.

Pull request overview

Extends MCP log-query timeouts for engine-filtered requests and clarifies compile workflow input syntax.

Changes:

  • Applies the five-minute timeout floor to engine filters.
  • Adds timeout and schema regression coverage.
  • Documents array syntax for compile inputs.
Show a summary per file
File Description
pkg/cli/mcp_tools_readonly.go Clarifies compile workflow array syntax.
pkg/cli/mcp_tools_privileged.go Extends engine-filtered log timeouts.
pkg/cli/mcp_tools_privileged_test.go Updates timeout helper invocation.
pkg/cli/mcp_server_defaults_test.go Tests compile schema documentation.
pkg/cli/logs_timeout_test.go Tests engine-filtered timeout behavior.

Review details

Tip

Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment on lines +137 to 141
if workflowName == "" || engine != "" {
// Without a workflow filter, or when filtering by engine, the CLI scans runs
// across workflows and reads their artifacts. Apply a higher minimum so the
// tool is less likely to exhaust the MCP gateway's per-tool timeout.
return max(defaultMCPLogsMinTimeoutMinutesAllWorkflows, base)

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 the latest commit — getToolCallTimeoutMs now applies the 5-minute floor whenever engine is present, even if workflow_name is also set. Added bridge regression tests for both cases.

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Ponytail Reviewer completed successfully!

Lean already. Ship.

Generated by Ponytail Reviewer for #52063

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR #52063 does not have the implementation label and has only 35 new lines of code in business logic directories (threshold: 100).

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

Warning

Threat Detection Engine Failure — The analysis engine could not complete. This is a tooling failure, not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs for details.

Warning

Firewall blocked 1 domain

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

  • api.individual.githubcopilot.com

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

network:
  allowed:
    - defaults
    - "api.individual.githubcopilot.com"

See Network Configuration for more information.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Aug 11, 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 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.

The changes look correct and well-tested. The engine parameter addition to effectiveMCPLogsToolTimeoutMinutes is sound — engine-filtered queries scan across workflows just like no-workflow-name queries, so applying the higher timeout floor is the right behavior. All call sites and tests are updated consistently.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 13.9 AIC · ⌖ 6.13 AIC · ⊞ 5.4K

@github-actions

Copy link
Copy Markdown
Contributor

🧪 Test Quality Sentinel Report

Test Quality Score: 100/100 — Excellent

Analyzed 3 test change(s): 3 design, 0 implementation, 0 violation(s).

📊 Metrics (3 tests)
Metric Value
Analyzed 3 (Go: 3, JS: 0)
✅ Design 3 (100%)
⚠️ Implementation 0 (0%)
Edge/error coverage 3 (100%)
Duplicate clusters 0
Inflation No
🚨 Violations 0
Test File Classification Issues
TestEffectiveMCPLogsToolTimeoutMinutes (engine rows + cap rows) logs_timeout_test.go design_test / high_value None
TestMCPToolElicitationDefaults (new subtest: no timeout schema default) mcp_server_defaults_test.go design_test / high_value None
TestLogsToolUsesEffectiveCountForTimeoutScaling (subtest update) mcp_tools_privileged_test.go design_test / high_value None

Analysis

This PR extends effectiveMCPLogsToolTimeoutMinutes to apply an all-workflow minimum timeout floor when an engine filter is supplied (in addition to when workflow_name is absent). The test additions are well-matched to the behavioral contracts:

  • Engine-filter rows (engine: "claude", count=2, named workflow) verify that a non-empty engine triggers the all-workflow floor — covering the new code path directly. Boundary rows (explicit timeout preserved, count-based scaling, max cap) ensure regression protection for adjacent paths.
  • No static timeout schema default subtest (mcp_server_defaults_test.go) is a crisp design invariant: it asserts absence of a value rather than presence, protecting against future accidental re-introduction of a static default that would bypass the runtime computation.
  • Effective count / timeout scaling integration subtest (mcp_tools_privileged_test.go) validates the end-to-end wire-up: the subprocess actually receives the computed --timeout value.

All test files carry (go/redacted):build !integration build tags ✅. No Go mock libraries (gomock, testify/mock) used. No inflation (net test additions ≤ net production additions). No duplicate clusters.

Verdict

Passed. 0% implementation tests (threshold: 30%). No violations.

🧪 Test quality analysis by Test Quality Sentinel · sonnet46 · 36.9 AIC · ⌖ 6.82 AIC · ⊞ 7.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.

✅ Test Quality Sentinel: 100/100. 0% implementation tests (threshold: 30%).

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

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 27.7 AIC · ⌖ 6.5 AIC · ⊞ 7.1K
Comment /matt to run again

Comment thread pkg/cli/logs_timeout_test.go Outdated
},
// All-workflow cases: minimum 5 minutes when no workflow_name is given
{
name: "engine filtering uses all-workflow minimum for a named workflow",

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.

[/tdd] The new test case sits under the // All-workflow cases comment but tests a named workflow with engine filtering — a mismatch that could mislead future editors. There is also no test for the workflowName="" + engine!="" combination, leaving one branch of the || uncovered.

💡 Suggested additions

Move the case to a new section and add a companion:

// Engine-filtering cases
{
    name:             "engine filtering with named workflow uses all-workflow minimum",
    requestedTimeout: 0,
    count:            2,
    workflowName:     "my-workflow",
    engine:           "claude",
    want:             defaultMCPLogsMinTimeoutMinutesAllWorkflows,
},
{
    name:             "engine filtering without workflow name also uses all-workflow minimum",
    requestedTimeout: 0,
    count:            2,
    workflowName:     "",
    engine:           "claude",
    want:             defaultMCPLogsMinTimeoutMinutesAllWorkflows,
},

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

Moved the engine-filtering case into its own "Engine-filtering cases" section and added the missing workflowName="" + engine!="" companion test.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Please refresh this branch, verify checks, and use the pr-finisher skill before handing back.

No failed checks were reported in the compact candidate set for this run.
Branch update was requested by sous-chef in run https://github.com/github/gh-aw/actions/runs/31508439729.

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 35.1 AIC · ⌖ 6.14 AIC · ⊞ 8.5K ·
Comment /souschef to run again

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

PR Triage: #52063

  • Category: bug
  • Risk: low
  • Priority score: 53/100 (impact 20/50, urgency 18/30, quality 15/20) → medium
  • Recommended action: fast_track

Automated triage — see labels for machine-readable classification.

Generated by 🔧 PR Triage Agent · auto · 45 AIC · ⌖ 2.09 AIC · ⊞ 7.8K ·

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Please refresh this branch, verify checks, and use the pr-finisher skill before handing back.

No failed checks were reported in the compact candidate set for this run.
Branch update was requested by sous-chef in run https://github.com/github/gh-aw/actions/runs/31523880210.

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 12.5 AIC · ⌖ 3.4 AIC · ⊞ 8.5K ·
Comment /souschef to run again

@pelikhan
pelikhan merged commit 7700358 into main Aug 11, 2026
1 check passed
@pelikhan
pelikhan deleted the copilot/cli-tools-test-logs-engine-filter-timeout-fix branch August 11, 2026 22:34
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.

[cli-tools-test] logs tool: engine filter query exceeds default timeout (context deadline exceeded)

4 participants