Skip to content

Conversation

@activadee
Copy link
Owner

Summary

  • Removed standalone OpenCode auth workflow – Integrated auth setup directly into plugin installation prompt instead of separate workflow step
  • Simplified caching across workflows – Removed redundant cache steps from doc-sync, issue-label, and pr-review workflows
  • Updated CLI installer flow – Enhanced user prompt to handle OpenCode auth configuration during plugin selection
  • Updated documentation – Added setup instructions for new auth handling approach
  • Added installer tests – New test coverage for updated installation flow (33 new test lines)

closes #10

## Analysis Complete

### Key Discovery: Cache Step Is Already Redundant

The composite actions (pr-review, issue-label, doc-sync) **already handle OPENCODE_AUTH directly**:

The cache restore step in workflow templates is **unnecessary duplication**. The composite actions handle auth from the environment variable directly.

---

### Current Architecture (Problematic)

### New Architecture (Simplified)

---

### Impact Assessment

| File | Change Type | Impact |
|------|-------------|--------|
| src/cli/templates/shared.ts | Remove CACHE_RESTORE_STEP | Minor - unused export |
| src/cli/templates/pr-review.ts | Remove cache step import/usage | Minor |
| src/cli/templates/issue-label.ts | Remove cache step import/usage | Minor |
| src/cli/templates/doc-sync.ts | Remove cache step import/usage | Minor |
| src/cli/templates/opencode-auth.ts | Keep for backward compat, add deprecation | Minor |
| src/cli/templates/index.ts | No change needed | None |
| src/cli/index.ts | Major changes - new prompt flow | Major |
| src/cli/installer.ts | Minor - keep backward compat | Minor |
| test/installer.test.js | Add tests for new behavior | Medium |
| README.md | Update auth section | Medium |

--

Attempt: att-773e5866-d6b2-46f4-968c-57d58978d4f7
Profile: apg-70541e2b-d01c-4d50-a814-7025ac222ebe
All tasks completed successfully. Here's the summary:

### Files Modified

| File | Change |
|------|--------|
| src/cli/templates/shared.ts | Removed CACHE_RESTORE_STEP export |
| src/cli/templates/pr-review.ts | Removed cache import/usage |
| src/cli/templates/issue-label.ts | Removed cache import/usage |
| src/cli/templates/doc-sync.ts | Removed cache import/usage |
| src/cli/templates/index.ts | Removed opencode-auth from exports and type |
| src/cli/installer.ts | Removed opencode-auth from generators |
| src/cli/index.ts | Added plugin prompt, updated help text and next steps |
| test/installer.test.js | Added 3 new tests for cache-free OAuth workflows |
| README.md | Updated auth section to promote plugin |

### Files Deleted

- src/cli/templates/opencode-auth.ts
- .github/workflows/opencode-auth.yml

### New CLI Flow (OAuth path)

### Verification

Attempt: att-773e5866-d6b2-46f4-968c-57d58978d4f7
Profile: apg-70541e2b-d01c-4d50-a814-7025ac222ebe
1. CLI runs bunx @activade/opencode-auth-sync directly (interactive setup)
2. After plugin setup completes, shows simplified next step: "Commit and push the workflow files"

Attempt: att-773e5866-d6b2-46f4-968c-57d58978d4f7
Profile: apg-70541e2b-d01c-4d50-a814-7025ac222ebe
@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2026

AI Review Summary

Verdict: REQUEST CHANGES
Commit: 86188b2

Findings

  • [HIGH] src/cli/index.ts:175 – Unused errors array - failures won't be reported
    • The errors array is declared and populated but never checked. The code checks hasErrors instead, which is already computed on line 141. This means the error reporting block on lines 170-175 is dead code and will never execute, even when errors occur.
    • Suggested fix: Remove lines 170-175 (the unused errors check). The error reporting is already handled correctly earlier in the code via the hasErrors variable and the spinner stop message.

Overall Assessment

This PR successfully consolidates OpenCode auth by removing redundant cache steps and promoting the plugin-based workflow. However, there's a critical bug in the error handling logic that will cause the CLI to report success even when errors occur.

@activadee activadee merged commit 446c9d1 into main Jan 4, 2026
@activadee activadee deleted the OW/OW-5-refactor-opencode-auth-usage branch January 4, 2026 13:22
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.

[OW-5] Refactor OpenCode Auth to Use opencode-auth-sync Plugin

2 participants