anthropics / anthropics/claude-code-action

MCP servers not terminated after Claude completes - workflow hangs indefinitely

Offen
#865 4 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug mcp p2 performance
Vorherrschende Sprache
TypeScript
Sterne
8.9k
Forks
2.1k
Ø Merge
3 T. 9 Std.
Gemergte PRs (30 T.)
10

Beschreibung

## Description

The Claude Code GitHub Action workflow hangs indefinitely after Claude completes its task. The action successfully posts the review/response but never terminates.

## Observed Behavior

1. Claude Code action triggers on PR comment
2. Claude successfully reads files, analyzes code, and posts review comment
3. Workflow never exits - runs until manually cancelled or hits timeout

## Root Cause Analysis

Investigation of the workflow logs revealed orphan `bun` processes at cleanup time:

```
Cleaning up orphan processes
Terminate orphan process: pid (2169) (bun)
Terminate orphan process: pid (2178) (bun)
Terminate orphan process: pid (2210) (npm exec @model)
Terminate orphan process: pid (2211) (bun)
Terminate orphan process: pid (2212) (bun)
Terminate orphan process: pid (2242) (sh)
```

These `bun` processes appear to be the MCP servers (`github_comment` and `github_ci`) that are spawned but not properly terminated when Claude completes its work.

## Timeline from logs

- `12:38:06` - Placeholder comment created
- `12:38:26` - Claude Code initialized
- `12:52:37` - Manually cancelled (14 minute gap with NO logged activity)

## Reproduction

1. Set up claude-code-action with default configuration
2. Comment `@claude can you review this PR please` on a PR
3. Claude successfully posts review but workflow never terminates

## Workaround

Adding `timeout-minutes: 15` to the job prevents indefinite hangs, but this is just a safeguard - the MCP servers should terminate properly.

## Environment

- `anthropics/claude-code-action@v1`
- Triggered via `issue_comment` event
- Ubuntu latest runner

## Failed run

https://github.com/sbushell92/the-pe-dept/actions/runs/21397472773

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.