Skip to content

fix(config): detect OpenCode API key completion#934

Merged
khaliqgant merged 1 commit into
mainfrom
codex/fix-opencode-auth-done
May 21, 2026
Merged

fix(config): detect OpenCode API key completion#934
khaliqgant merged 1 commit into
mainfrom
codex/fix-opencode-auth-done

Conversation

@khaliqgant

Copy link
Copy Markdown
Member

Summary

  • Treat OpenCode's terminal Done line as a successful provider-auth signal
  • Add config coverage for the OpenCode API-key completion transcript

Verification

  • npm --prefix packages/config test -- --run
  • npm --prefix packages/config run build
  • npm --prefix packages/config test -- --run src/cli-auth-config.test.ts

Notes

This is the canonical package-side fix. The published agent-relay cloud connect opencode path imports CLI_AUTH_CONFIG from @agent-relay/config/cli-auth-config. The remaining duplicate config copy lives in the cloud repo, so removing that duplication needs a cloud-side follow-up that imports this package instead of maintaining a local copy.

@khaliqgant khaliqgant requested a review from willwashburn as a code owner May 21, 2026 08:18
@coderabbitai

coderabbitai Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3a5340db-df3c-4e93-a779-ceb2133fb11f

📥 Commits

Reviewing files that changed from the base of the PR and between db037b0 and e13931f.

📒 Files selected for processing (2)
  • packages/config/src/cli-auth-config.test.ts
  • packages/config/src/cli-auth-config.ts

📝 Walkthrough

Walkthrough

Added tests for CLI auth config validation and extended OpenCode provider's success pattern matching to detect done-state responses. Reformatted prompt patterns across multiple providers (Anthropic, Google, Cursor, Copilot) into consistent multi-line regex expressions and adjusted function signature layouts for consistency.

Changes

CLI Auth Configuration Updates

Layer / File(s) Summary
OpenCode success pattern detection enhancement
packages/config/src/cli-auth-config.test.ts, packages/config/src/cli-auth-config.ts
New test cases validate validateAllProviderConfigs() succeeds and OpenCode successPatterns detect API-key completion transcripts. Implementation extends successPatterns array with additional regexes for credential-listing and done-state detection.
Provider pattern and function signature formatting
packages/config/src/cli-auth-config.ts
Anthropic, Google, and Cursor prompt patterns rewrapped into multi-line pattern: expressions. Copilot successPatterns array and login-success pattern converted to multi-line layout. stripAnsiCodes and exported function signatures (findMatchingError, validateProviderConfig) adjusted for consistent formatting.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • willwashburn

Poem

🐰 New patterns bloom in OpenCode's sight,
Done-state detection shines so bright,
Multi-line formatting, clean and tight,
Auth configs sparkle, left and right! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: detecting OpenCode API key completion, which aligns with the core functionality added to the CLI_AUTH_CONFIG.
Description check ✅ Passed The description covers the main summary and verification steps, but does not explicitly follow the template structure with a dedicated 'Test Plan' section with checkboxes and 'Screenshots' section.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-opencode-auth-done

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.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@khaliqgant khaliqgant merged commit 80fcaa3 into main May 21, 2026
42 checks passed
@khaliqgant khaliqgant deleted the codex/fix-opencode-auth-done branch May 21, 2026 08:28
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