Commit a047060
fix(mcp): add retry logic for Playwright MCP browser sidecar startup
Add retry mechanism to docker-git-playwright-mcp wrapper to handle
browser sidecar startup delays. When Claude Code initializes the
MCP server, the browser container may not be ready yet, causing
the server to fail with connection errors.
- Add configurable retry attempts (MCP_PLAYWRIGHT_RETRY_ATTEMPTS, default: 10)
- Add configurable retry delay (MCP_PLAYWRIGHT_RETRY_DELAY, default: 2s)
- Extract CDP fetch into a function for cleaner retry loop
- Log retry progress to stderr for debugging
- Update usage documentation with new environment variables
- Add tests verifying retry logic in Dockerfile template
Fixes #123
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent ba2753d commit a047060
3 files changed
Lines changed: 43 additions & 1 deletion
File tree
- packages
- app/src/docker-git/cli
- lib
- src/core/templates
- tests/usecases
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
84 | 86 | | |
85 | 87 | | |
86 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
108 | 140 | | |
109 | | - | |
110 | 141 | | |
111 | 142 | | |
112 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
123 | 132 | | |
124 | 133 | | |
125 | 134 | | |
| |||
0 commit comments