The computer's git and gh shims passed a literal "--" into the JSON argv (python -c keeps it in sys.argv), so every brokered clone arrived as "git -- clone" and the broker refused it. Agents then fell back to real git with the broker run token as a password, which GitHub rejects. - Drop the stray "--" from both shim payloads. - Route git through the broker even behind -c/-C/--no-pager options. - Share one broker client that falls back to the default gateway for computers created before host.docker.internal was mapped, and says plainly when the broker is unreachable or refuses a request. - Broker normalizes GitHub SSH remotes and pasted credentials to plain HTTPS and points a rejected stored token at reconnecting GitHub. - Prompt says plain git clone works and the run token is not a GitHub token. Claude-Session: https://claude.ai/code/session_01Tgvrj34NMnaqvtgvruYQZZ Co-authored-by: Claude <noreply@anthropic.com>
13 lines
417 B
Bash
Executable File
13 lines
417 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
REAL_GH=/usr/bin/gh
|
|
if [[ "${RAKAZO_GITHUB_BROKER_URL:-}" == "" || "${RAKAZO_GITHUB_BROKER_RUN_TOKEN:-}" == "" ]]; then
|
|
exec "$REAL_GH" "$@"
|
|
fi
|
|
joined="$*"
|
|
if [[ ! "$joined" =~ (^|[[:space:]])pr([[:space:]]|$) ]]; then
|
|
exec "$REAL_GH" "$@"
|
|
fi
|
|
payload="$(python3 -c 'import json,sys; print(json.dumps({"argv":["gh"]+sys.argv[1:]}))' "$@")"
|
|
exec rakazo-broker v1/gh "$payload"
|