mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-31 03:23:19 +02:00
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Jeremiah Lowin <jlowin@users.noreply.github.com> Co-authored-by: Marvin Context Protocol <41898282+Marvin Context Protocol@users.noreply.github.com> Co-authored-by: voidborne-d <voidborne-d@users.noreply.github.com> Co-authored-by: marvin-context-protocol[bot] <225465937+marvin-context-protocol[bot]@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: d 🔹 <258577966+voidborne-d@users.noreply.github.com> Co-authored-by: Jeremiah Lowin <153965+jlowin@users.noreply.github.com> Co-authored-by: nightcityblade <nightcityblade@gmail.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Bill Easton <strawgate@users.noreply.github.com> Co-authored-by: Sumanshu Nankana <sumanshunankana@gmail.com> Co-authored-by: Eric Robinson <ericrobinson@indeed.com> Co-authored-by: Martim Santos <martimfasantos@gmail.com> Co-authored-by: d 🔹 <liusway405@gmail.com> Co-authored-by: Matthieu B <66959271+mtthidoteu@users.noreply.github.com> Co-authored-by: Sascha Buehrle <47737812+saschabuehrle@users.noreply.github.com> Co-authored-by: Hakancan <142545736+hkc5@users.noreply.github.com> Co-authored-by: nightcityblade <jackchen@haloailabs.com> Co-authored-by: Matt Hallowell <17804673+mhallo@users.noreply.github.com> Co-authored-by: nate nowack <thrast36@gmail.com> Co-authored-by: Bill Easton <williamseaston@gmail.com> Co-authored-by: Marcus Shu <46469249+shulkx@users.noreply.github.com> Co-authored-by: Rushabh Doshi <radoshi@gmail.com> Co-authored-by: AIKAWA Shigechika <shige@aikawa.jp> Co-authored-by: Jeremy Simon <simonjer805@gmail.com> Co-authored-by: Miguel Miranda Dias <7780875+pandego@users.noreply.github.com> Co-authored-by: Anthony James Padavano <padavano.anthony@gmail.com> Co-authored-by: Mostafa Kamal <hiremostafa@gmail.com> Fix auto-close MRE script posting comment without closing (#3386) Fix WorkOS token scope verification bypass 🤖 Generated with Codex (#3407) Fix initialize McpError fallthrough 🤖 Generated with Codex (#3413) Fix transform arg collisions with passthrough params (#3431) Fix get_* returning None when latest version is disabled (#3439) Fix get_* returning None when latest version is disabled (#3421) Fix server lifespan overlap teardown (#3415) Fix $ref output schema object detection regression (#3420) resolved annotations (#3429) Fix async partial callables rejected by iscoroutinefunction (#3438) Fix async partial callables rejected by iscoroutinefunction (#3423) fix: add version to components (#3458) fix: use intent-based flag for OIDC scope patch in load_access_token (#3465) Fixes #3461 fix: normalize Google scope shorthands and surface valid_scopes (#3477) fix: resolve ty 0.0.23 type-checking errors and bump pin (#3481) fix: shield lifespan teardown from cancellation (#3480) fix: forward custom_route endpoints from mounted servers (#3462) fix updates _get_additional_http_routes() to traverse providers, Fixes #3457 fix: remove hardcoded version from CLI help text (#3456) fix: monty 0.0.8 compatibility, drop external_functions from constructor (#3468) fix: task test teardown hanging 5s per test (#3499) Closes #3498 fix: validate workspace path is a directory before cursor install (#3440) Fixes #3426 fix: handle re.error from malformed URI templates in build_regex (#3501) fix: reject empty/OIDC-only required_scopes in AzureProvider (#3503) fix: restrict $ref resolution to local refs only (SSRF/LFI) (#3502) fix warnings and timeouts (#3504) close upgrade check issue when build passes (#3505) Closes #3484 fix: URL-encode path params to prevent SSRF/path traversal (GHSA-vv7q-7jx5-f767) (#3507) fix: prevent path traversal in skill download (#3493) fix: prefer IdP-granted scopes over client-requested scopes in OAuthProxy (#3492) fix: remove unrelated transform and http.py changes from PR scope fix: remove forced follow_redirects from httpx_client_factory calls (#3496) fix: stop passing follow_redirects to httpx_client_factory fix: restore follow_redirects=True for custom httpx client factories Closes #3509 fix: CSRF double-submit cookie check in consent flow (#3519) fix: validate server names in install commands (#3522) fix: use raw strings for regex in pytest.raises match (#3523) fix: reject refresh tokens used as Bearer access tokens (#3524) fix: route ResourcesAsTools/PromptsAsTools through server middleware (#3495) fix: resolve Pyright "Module is not callable" on @tool, @resource, @prompt decorators (#3540) fix: filter warnings by message in KEY_PREFIX test (#3549) fix: suppress output schema for ToolResult subclass annotations (#3548) fix: increase sleep duration in proxy cache tests (#3567) fix: store absolute token expiry to prevent stale expires_in on reload (#3572) fix: preserve tool properties named 'title' during schema compression (#3582) Fix loopback redirect URI port matching per RFC 8252 §7.3 (#3589) Fix app tool routing: visibility check and middleware propagation (#3591) Fix query parameter serialization to respect OpenAPI explode/style settings (#3595) Fix dev apps form: union types, textarea support, JSON parsing (#3597) fix(google): replace deprecated /oauth2/v1/tokeninfo with /oauth2/v3/userinfo (#3603) fix: resolve EntraOBOToken dependency injection through MultiAuth (#3609) fix(docs): correct misleading stateless_http header (#3622) fix: filesystem provider import machinery (#3626) Closes #3625 (issues 2, 3, 6) fix: recover StdioTransport after subprocess exits (#3630) fix(server): preserve mounted tool task metadata (#3632) fix: scope deprecation warning filter to FastMCPDeprecationWarning (#3649) fix imports, add PrefabAppConfig (#3650) fix: resolve CurrentFastMCP/ctx.fastmcp to child server in mounted background tasks (#3651) Fix blocking docs issues: chart imports, Select API, Rx consistency (#3652) closed by default (#3657) Fix prompt caching middleware missing wrap/unwrap round-trip (#3666) fix: serialize object query params per OpenAPI style/explode rules (#3662) Fixes #2857 fix: HTTP request headers not accessible in background task workers (#3631) fix: restore HTTP headers in worker execution path for background tasks (#3681) fix: strip discriminator after dereferencing schemas (#3682) fix: remove stale ty:ignore directives for ty 0.0.26 (#3684) Fix docs gaps in app provider pages (#3690) fix: dev apps log panel UX improvements (#3698) fix dev server empty string args (#3700)
185 lines
7.7 KiB
YAML
185 lines
7.7 KiB
YAML
name: Marvin Test Failure Analysis
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows: ["Tests", "Run static analysis"]
|
|
types:
|
|
- completed
|
|
|
|
concurrency:
|
|
group: marvin-test-failure-${{ github.event.workflow_run.head_branch }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
martian-test-failure:
|
|
# Only run if the test workflow failed
|
|
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
issues: read
|
|
id-token: write
|
|
actions: read # Required for Claude to read CI results
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Generate Marvin App token
|
|
id: marvin-token
|
|
uses: actions/create-github-app-token@v3
|
|
with:
|
|
app-id: ${{ secrets.MARVIN_APP_ID }}
|
|
private-key: ${{ secrets.MARVIN_APP_PRIVATE_KEY }}
|
|
|
|
- name: Set up Python 3.10
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.10"
|
|
|
|
# Install UV package manager
|
|
- name: Install UV
|
|
uses: astral-sh/setup-uv@v7
|
|
|
|
# Install dependencies
|
|
- name: Install dependencies
|
|
run: uv sync --all-packages --group dev
|
|
|
|
- name: Set analysis prompt
|
|
id: analysis-prompt
|
|
run: |
|
|
cat >> $GITHUB_OUTPUT << 'EOF'
|
|
PROMPT<<PROMPT_END
|
|
You're a test failure analysis assistant for FastMCP, a Python framework for building Model Context Protocol servers and clients.
|
|
|
|
# Your Task
|
|
A GitHub Actions workflow has failed. Your job is to:
|
|
1. Analyze the test failure(s) to understand what went wrong
|
|
2. Identify the root cause of the failure(s)
|
|
3. Suggest a clear, actionable solution to fix the failure(s)
|
|
|
|
# Getting Started
|
|
1. Call the generate_agents_md tool to get a high-level summary of the project
|
|
2. Get the pull request associated with this workflow run from the GitHub repository: ${{ github.repository }}
|
|
- The workflow run ID is: ${{ github.event.workflow_run.id }}
|
|
- The workflow run was triggered by: ${{ github.event.workflow_run.event }}
|
|
- Use GitHub MCP tools to get PR details and workflow run information
|
|
3. Use the GitHub MCP tools to fetch job logs and failure information:
|
|
- Use get_workflow_run to get details about the failed workflow
|
|
- Use list_workflow_jobs to see which jobs failed
|
|
- Use get_job_logs with failed_only=true to get logs for failed jobs
|
|
- Use summarize_run_log_failures to get an AI summary of what failed
|
|
4. Analyze the failures to understand the root cause
|
|
5. Search the codebase for relevant files, tests, and implementations
|
|
|
|
# Your Response
|
|
Post a comment on the pull request with your analysis. Your comment should include:
|
|
|
|
## Test Failure Analysis
|
|
|
|
**Summary**: A brief 1-2 sentence summary of what failed.
|
|
|
|
**Root Cause**: A clear explanation of why the tests failed, based on your analysis of the logs and code.
|
|
|
|
**Suggested Solution**: Specific, actionable steps to fix the failure(s). Include:
|
|
- Which files need to be modified
|
|
- What changes are needed
|
|
- Why these changes will fix the issue
|
|
|
|
<details>
|
|
<summary>Detailed Analysis</summary>
|
|
|
|
Include here:
|
|
- Relevant log excerpts showing the failure
|
|
- Code snippets that are causing the issue
|
|
- Any related issues or PRs that might be relevant
|
|
</details>
|
|
|
|
<details>
|
|
<summary>Related Files</summary>
|
|
|
|
List files that are relevant to the failure with brief explanations of their relevance.
|
|
</details>
|
|
|
|
# Important Guidelines
|
|
- Be concise and actionable - developers want to quickly understand and fix the issue. Provide
|
|
additional context, references, etc in collapsible details blocks to ensure that the comment you're adding
|
|
is short and easy to read but additional information is a click away.
|
|
- Focus on facts from the logs and code, not speculation
|
|
- If you can't determine the root cause, say so clearly
|
|
- If your only suggestion is a bad suggestion (disable the test, change the timeout, etc), indicate that you've run out of ideas and
|
|
that they probably don't want to do that.
|
|
- Provide specific file names, line numbers, and code references when possible
|
|
- You can run make commands (e.g., `make lint`, `make typecheck`, `make sync`) to build, test, or lint the code
|
|
- You can also run git commands (e.g., `git status`, `git log`, `git diff`) to inspect the repository
|
|
- You can use WebSearch and WebFetch to research errors, stack traces, or related issues
|
|
- For bash commands, you are limited to make and git commands only
|
|
|
|
# CRITICAL: ANGRY USERS
|
|
**IMPORTANT**: If the user is angry with you, the triage bot, don't respond. Just exit immediately without further action.
|
|
If at any point in the conversation the user has asked you to stop replying to the thread, just exit immediately.
|
|
|
|
If you are posting the same suggestion as you have previously made, do not post the suggestion again.
|
|
|
|
# IMPORTANT: EDIT YOUR COMMENT
|
|
Do not post a new comment every time you triage a failing workflow. If a previous comment has been posted by you (marvin)
|
|
in a previous triage, edit that comment do not add a new comment for each failure. Be sure to include a note that you've edited
|
|
your comment to reflect the latest analysis. Don't worry about keeping the old content around, there's comment history for
|
|
that.
|
|
|
|
# Problems Encountered
|
|
If you encounter any problems during your analysis (e.g., unable to fetch logs, tools not working), document them clearly so the team knows what limitations you faced.
|
|
PROMPT_END
|
|
EOF
|
|
|
|
- name: Setup GitHub MCP Server
|
|
run: |
|
|
mkdir -p /tmp/mcp-config
|
|
cat > /tmp/mcp-config/mcp-servers.json << 'EOF'
|
|
{
|
|
"mcpServers": {
|
|
"repository-summary": {
|
|
"type": "http",
|
|
"url": "https://agents-md-generator.fastmcp.app/mcp"
|
|
},
|
|
"code-search": {
|
|
"type": "http",
|
|
"url": "https://public-code-search.fastmcp.app/mcp"
|
|
},
|
|
"github-research": {
|
|
"type": "stdio",
|
|
"command": "uvx",
|
|
"args": [
|
|
"github-research-mcp"
|
|
],
|
|
"env": {
|
|
"DISABLE_SUMMARIES": "true",
|
|
"GITHUB_PERSONAL_ACCESS_TOKEN": "${{ secrets.GITHUB_TOKEN }}"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
EOF
|
|
|
|
- name: Clean up stale Claude locks
|
|
run: rm -rf ~/.claude/.locks ~/.local/state/claude/locks || true
|
|
|
|
- name: Run Claude Code
|
|
id: claude
|
|
uses: anthropics/claude-code-action@v1
|
|
with:
|
|
github_token: ${{ steps.marvin-token.outputs.token }}
|
|
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY_FOR_CI }}
|
|
bot_name: "Marvin Context Protocol"
|
|
|
|
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
|
|
additional_permissions: |
|
|
actions: read
|
|
|
|
prompt: ${{ steps.analysis-prompt.outputs.PROMPT }}
|
|
claude_args: |
|
|
--allowed-tools mcp__repository-summary,mcp__code-search,mcp__github-research,WebSearch,WebFetch,Bash(make:*,git:*)
|
|
--mcp-config /tmp/mcp-config/mcp-servers.json
|