Live e2e surfaced a race unit tests couldn't (mocks are instant): gitea's /generate returns and serves reads before the branch ref is writable, so the first content writes 404 "branch does not exist" for a beat — aborting the whole substitution pass. Add waitForBranch (poll BranchExists after generate) + upsertRetry (retry writes on the transient not-found). Test fake now serves the branch readiness probe. Refs #42. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>