Skip to content

fix: resolve setup onboarding errors (macOS head -z, model selection, agent routing)#346

Merged
marcusquinn merged 1 commit intomainfrom
bugfix/fix-setup-onboarding-errors
Feb 5, 2026
Merged

fix: resolve setup onboarding errors (macOS head -z, model selection, agent routing)#346
marcusquinn merged 1 commit intomainfrom
bugfix/fix-setup-onboarding-errors

Conversation

@marcusquinn
Copy link
Owner

Summary

Fixes three issues encountered during the setup/onboarding process:

  • macOS head -z error: deploy-templates.sh used GNU-only head -z flag for null-delimited input, which fails on macOS with head: invalid option -- z. Replaced with macOS-compatible while read -r loop, matching the pattern already used in setup.sh.

  • Wrong model for onboarding: When setup.sh launches OpenCode with the Onboarding agent, it used whatever model OpenCode defaults to (e.g., gpt-5.2-chat-latest for OpenAI). If the user doesn't have OpenAI credits, this causes insufficient_quota errors. Now auto-detects the user's authenticated providers from auth.json and selects an appropriate model (Anthropic Claude > Google Gemini > fallback).

  • Wrong agent routing: The /onboarding command was configured with agent: Build+ but there's a dedicated Onboarding primary agent. Updated to route to the correct agent.

Changes

File Change
templates/deploy-templates.sh Replace head -z with macOS-compatible while read loop
setup.sh Auto-detect auth provider and pass --model flag when launching onboarding
.agent/scripts/generate-opencode-commands.sh Change /onboarding command agent from Build+ to Onboarding

… agent routing)

- Replace GNU-only 'head -z' with macOS-compatible 'while read' in deploy-templates.sh
- Route /onboarding command to Onboarding agent instead of Build+
- Auto-detect authenticated provider when launching onboarding to avoid insufficient_quota errors
  (prefers Anthropic > Google > fallback to OpenCode default)
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 5, 2026

Warning

Rate limit exceeded

@marcusquinn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 48 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bugfix/fix-setup-onboarding-errors

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link

Summary of Changes

Hello @marcusquinn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the initial user experience by addressing critical issues encountered during the setup and onboarding process. It improves cross-platform compatibility, intelligently selects AI models based on user authentication, and ensures correct agent routing, leading to a smoother and more reliable first interaction with the system.

Highlights

  • macOS Compatibility Fix: Resolved an issue in deploy-templates.sh where the GNU-specific head -z command caused errors on macOS. The script now uses a macOS-compatible while read -r loop for processing file lists.
  • Intelligent Model Selection for Onboarding: The setup.sh script now intelligently detects authenticated AI providers from auth.json and selects an appropriate model for the onboarding process, prioritizing Anthropic Claude and Google Gemini to prevent insufficient_quota errors for users without OpenAI credits.
  • Correct Onboarding Agent Routing: The /onboarding command's agent routing has been corrected from Build+ to the dedicated Onboarding agent, ensuring users are directed to the proper interactive onboarding wizard.
Changelog
  • .agent/scripts/generate-opencode-commands.sh
    • Updated the /onboarding command configuration to route to the Onboarding agent instead of Build+.
  • setup.sh
    • Implemented logic to detect available authentication providers (Anthropic, Google) from auth.json.
    • Dynamically sets the --model flag for opencode during onboarding based on detected providers, preferring Anthropic Claude and Google Gemini.
  • templates/deploy-templates.sh
    • Replaced the GNU head -z command with a POSIX-compliant while read -r loop for deleting old backups, improving macOS compatibility.
Activity
  • The author, marcusquinn, created this pull request to fix several identified issues with the setup and onboarding process.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

github-actions bot commented Feb 5, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 2 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Thu Feb 5 20:50:19 UTC 2026: Code review monitoring started
Thu Feb 5 20:50:19 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 2
Thu Feb 5 20:50:19 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Thu Feb 5 20:50:21 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 2
  • VULNERABILITIES: 0

Generated on: Thu Feb 5 20:50:24 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 5, 2026

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively resolves three distinct onboarding issues, enhancing portability and user experience. The fix for the macOS head -z error by using a while read loop is a good portability improvement. The logic to auto-detect an appropriate model in setup.sh is a thoughtful addition that prevents errors for users without OpenAI credits. The agent routing correction is a straightforward and necessary fix. The changes are clear and well-implemented. I have one suggestion to refactor a small part of setup.sh to improve maintainability by reducing code duplication.

Comment on lines +3731 to +3735
if [[ -n "$onboarding_model" ]]; then
opencode --agent Onboarding --prompt "/onboarding" --model "$onboarding_model"
else
opencode --agent Onboarding --prompt "/onboarding"
fi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve maintainability and avoid code duplication, you can refactor this block to build the opencode command arguments dynamically. This avoids repeating the base command opencode --agent Onboarding --prompt "/onboarding".

Suggested change
if [[ -n "$onboarding_model" ]]; then
opencode --agent Onboarding --prompt "/onboarding" --model "$onboarding_model"
else
opencode --agent Onboarding --prompt "/onboarding"
fi
local opencode_args=("--agent" "Onboarding" "--prompt" "/onboarding")
if [[ -n "$onboarding_model" ]]; then
opencode_args+=("--model" "$onboarding_model")
fi
opencode "${opencode_args[@]}"

@marcusquinn marcusquinn merged commit d63bd31 into main Feb 5, 2026
15 checks passed
marcusquinn added a commit that referenced this pull request Feb 5, 2026
Address Gemini code review suggestion from PR #346 to reduce
duplication by building opencode args dynamically.
marcusquinn added a commit that referenced this pull request Feb 5, 2026
Address Gemini code review suggestion from PR #346 to reduce
duplication by building opencode args dynamically.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments