@prover-coder-ai/docker-git 1.0.35 → 1.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4129,8 +4129,39 @@ if [[ -z "$CDP_ENDPOINT" ]]; then
|
|
|
4129
4129
|
CDP_ENDPOINT="http://__SERVICE_NAME__-browser:9223"
|
|
4130
4130
|
fi
|
|
4131
4131
|
|
|
4132
|
+
# CHANGE: add retry logic for browser sidecar startup wait
|
|
4133
|
+
# WHY: the browser container may take time to initialize, causing MCP server to fail on first attempt
|
|
4134
|
+
# QUOTE(issue-123): "Почему MCP сервер лежит с ошибкой?"
|
|
4135
|
+
# REF: issue-123
|
|
4136
|
+
# SOURCE: n/a
|
|
4137
|
+
# FORMAT THEOREM: forall t in [1..max_attempts]: retry(t) -> eventually(cdp_ready) OR timeout_error
|
|
4138
|
+
# PURITY: SHELL
|
|
4139
|
+
# INVARIANT: script exits only after cdp_ready OR all retries exhausted
|
|
4140
|
+
# COMPLEXITY: O(max_attempts * timeout_per_attempt)
|
|
4141
|
+
MCP_PLAYWRIGHT_RETRY_ATTEMPTS="\${MCP_PLAYWRIGHT_RETRY_ATTEMPTS:-10}"
|
|
4142
|
+
MCP_PLAYWRIGHT_RETRY_DELAY="\${MCP_PLAYWRIGHT_RETRY_DELAY:-2}"
|
|
4143
|
+
|
|
4144
|
+
fetch_cdp_version() {
|
|
4145
|
+
curl -sSf --connect-timeout 3 --max-time 10 -H 'Host: 127.0.0.1:9222' "\${CDP_ENDPOINT%/}/json/version" 2>/dev/null
|
|
4146
|
+
}
|
|
4147
|
+
|
|
4148
|
+
JSON=""
|
|
4149
|
+
for attempt in $(seq 1 "$MCP_PLAYWRIGHT_RETRY_ATTEMPTS"); do
|
|
4150
|
+
if JSON="$(fetch_cdp_version)"; then
|
|
4151
|
+
break
|
|
4152
|
+
fi
|
|
4153
|
+
if [[ "$attempt" -lt "$MCP_PLAYWRIGHT_RETRY_ATTEMPTS" ]]; then
|
|
4154
|
+
echo "docker-git-playwright-mcp: waiting for browser sidecar (attempt $attempt/$MCP_PLAYWRIGHT_RETRY_ATTEMPTS)..." >&2
|
|
4155
|
+
sleep "$MCP_PLAYWRIGHT_RETRY_DELAY"
|
|
4156
|
+
fi
|
|
4157
|
+
done
|
|
4158
|
+
|
|
4159
|
+
if [[ -z "$JSON" ]]; then
|
|
4160
|
+
echo "docker-git-playwright-mcp: failed to connect to CDP endpoint $CDP_ENDPOINT after $MCP_PLAYWRIGHT_RETRY_ATTEMPTS attempts" >&2
|
|
4161
|
+
exit 1
|
|
4162
|
+
fi
|
|
4163
|
+
|
|
4132
4164
|
# kechangdev/browser-vnc binds Chromium CDP on 127.0.0.1:9222; it also host-checks HTTP requests.
|
|
4133
|
-
JSON="$(curl -sSf --connect-timeout 3 --max-time 10 -H 'Host: 127.0.0.1:9222' "\${CDP_ENDPOINT%/}/json/version")"
|
|
4134
4165
|
WS_URL="$(printf "%s" "$JSON" | node -e 'const fs=require("fs"); const j=JSON.parse(fs.readFileSync(0,"utf8")); process.stdout.write(j.webSocketDebuggerUrl || "")')"
|
|
4135
4166
|
if [[ -z "$WS_URL" ]]; then
|
|
4136
4167
|
echo "docker-git-playwright-mcp: webSocketDebuggerUrl missing" >&2
|
|
@@ -8465,6 +8496,8 @@ Container runtime env (set via .orch/env/project.env):
|
|
|
8465
8496
|
DOCKER_GIT_ZSH_AUTOSUGGEST_STRATEGY=... Suggestion sources (default: history completion)
|
|
8466
8497
|
MCP_PLAYWRIGHT_ISOLATED=1|0 Isolated browser contexts (recommended for many Codex; default: 1)
|
|
8467
8498
|
MCP_PLAYWRIGHT_CDP_ENDPOINT=http://... Override CDP endpoint (default: http://dg-<repo>-browser:9223)
|
|
8499
|
+
MCP_PLAYWRIGHT_RETRY_ATTEMPTS=<n> Retry attempts for browser sidecar startup wait (default: 10)
|
|
8500
|
+
MCP_PLAYWRIGHT_RETRY_DELAY=<seconds> Delay between retry attempts (default: 2)
|
|
8468
8501
|
|
|
8469
8502
|
Auth providers:
|
|
8470
8503
|
github, gh GitHub CLI auth (tokens saved to env file)
|