ci(agentry): prime claude-code onboarding to fix headless auth#122
Conversation
Setting CLAUDE_CODE_OAUTH_TOKEN is not enough on a fresh runner: claude also checks ~/.claude.json for hasCompletedOnboarding and, when it's missing, tries to render the theme picker TUI. That aborts immediately with "Raw mode is not supported on the current process.stdin", which agentry surfaces as "agent execution failed: Exit code 1". See anthropics/claude-code#8938. Writing the flag before agentry runs lets -p mode skip onboarding entirely.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a step to four GitHub Actions workflows that primes Claude Code onboarding by creating Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/agentry-triage.yaml (1)
23-28: Consider centralizing this onboarding priming step.The same block is repeated across four workflows; moving it to a composite action or reusable workflow step would reduce drift risk and simplify future changes.
As per coding guidelines, ".github/workflows/**: Check workflow syntax, appropriate use of self-hosted vs ubuntu-latest runners, secret references, and concurrency settings."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/agentry-triage.yaml around lines 23 - 28, Extract the repeated "Prime Claude Code onboarding" step (the run block that creates ~/.claude and writes '{"hasCompletedOnboarding": true}' to ~/.claude.json) into a single reusable unit (either a composite action under .github/actions or a reusable workflow) and replace the duplicated run blocks in each workflow with a call to that unit; ensure the new composite/reusable step exposes no secrets, documents that it is safe to run on ubuntu-latest, and updates each workflow to reference the centralized action name (e.g., uses: ./.github/actions/prime-claude-onboarding or uses: owner/repo/.github/workflows/prime-claude-onboarding.yml) so future changes are made in one place.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/agentry-triage.yaml:
- Around line 23-28: Extract the repeated "Prime Claude Code onboarding" step
(the run block that creates ~/.claude and writes '{"hasCompletedOnboarding":
true}' to ~/.claude.json) into a single reusable unit (either a composite action
under .github/actions or a reusable workflow) and replace the duplicated run
blocks in each workflow with a call to that unit; ensure the new
composite/reusable step exposes no secrets, documents that it is safe to run on
ubuntu-latest, and updates each workflow to reference the centralized action
name (e.g., uses: ./.github/actions/prime-claude-onboarding or uses:
owner/repo/.github/workflows/prime-claude-onboarding.yml) so future changes are
made in one place.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8fd88c89-cc1c-4150-a6da-83f15fbcbede
📒 Files selected for processing (4)
.github/workflows/agentry-bug-fix.yaml.github/workflows/agentry-code-review.yaml.github/workflows/agentry-feature-implement.yaml.github/workflows/agentry-triage.yaml
Agentry Code ReviewNo structured output was returned by the agent. Tokens: 11,574 in / 1,314 out |
The agentry code-review workflow has been failing on every run with
agent execution failed: Exit code 1, and the triage/planning-pipeline runs have been quietly reporting every node as failed while the job still shows green (composition pipelines don't propagate node failures to the shell exit code).Root cause is anthropics/claude-code#8938:
CLAUDE_CODE_OAUTH_TOKENon its own is not enough on a fresh runner. Claude Code also checks~/.claude.jsonforhasCompletedOnboarding, and when that's missing it tries to render the theme-picker TUI. On a headless runner that aborts immediately withRaw mode is not supported on the current process.stdin, the claude subprocess exits 1, and agentry surfaces it as a generic "agent execution failed".This adds a one-line prime step to each of the four agentry workflows that writes
{"hasCompletedOnboarding": true}to~/.claude.jsonbefore invoking agentry, soclaude -pcan skip onboarding entirely and go straight to the work.The
Agentry: Code Reviewjob on this PR is the canary — if it lands green and actually emits structured findings, A is the full fix.Summary by CodeRabbit