From e0b76b04f4eeedde04deed073f97b289603cb78e Mon Sep 17 00:00:00 2001 From: rabbitblood Date: Mon, 13 Apr 2026 19:19:21 -0700 Subject: [PATCH] chore(template): authenticated git clone in initial_prompt when GITHUB_TOKEN is set Fixes the template-layer half of #13. Previously initial_prompt cloned `https://github.com/${GITHUB_REPO}.git` with no authentication, which fails for private repos in non-TTY docker exec with: fatal: could not read Username for 'https://github.com': terminal prompts disabled Now the prompt uses `https://x-access-token:${GITHUB_TOKEN}@github.com/...` when GITHUB_TOKEN is present in env (global secret, set per CEO on 2026-04-13), falls back to anonymous clone when it isn't. This is a belt-and-suspenders template default. The platform-level fix (#13) is still needed so the provisioner rewrites clone URLs consistently, but the template should work out of the box too. --- org-templates/molecule-dev/org.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/org-templates/molecule-dev/org.yaml b/org-templates/molecule-dev/org.yaml index 9e938ef3..040d48c4 100644 --- a/org-templates/molecule-dev/org.yaml +++ b/org-templates/molecule-dev/org.yaml @@ -16,7 +16,12 @@ defaults: # be ready yet. Keep it local: clone, read, memorize. Wait for tasks. initial_prompt: | You just started. Set up your environment silently — do NOT contact other agents yet. - 1. Clone the repo: git clone https://github.com/${GITHUB_REPO}.git /workspace/repo 2>/dev/null || (cd /workspace/repo && git pull) + 1. Clone the repo (authenticated when GITHUB_TOKEN is available, anonymous otherwise): + if [ -n "$GITHUB_TOKEN" ]; then + git clone "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPO}.git" /workspace/repo 2>/dev/null || (cd /workspace/repo && git pull) + else + git clone "https://github.com/${GITHUB_REPO}.git" /workspace/repo 2>/dev/null || (cd /workspace/repo && git pull) + fi 2. Set up git hooks: cd /workspace/repo && git config core.hooksPath .githooks 3. Read /workspace/repo/CLAUDE.md to understand the project 4. Read your system prompt at /configs/system-prompt.md to understand your role