feat(opencode): CAS OAuth connect, list agents, and select - #10
Conversation
Enable OpenCode MCP OAuth for alterspective-agent (no static empty Bearer), resolve tokens from mcp-auth.json, add cas_auth_status / cas_select_agent, /cas slash command, and preferred-agent selection file. Requires CAS OAuth issuer fix deployed for browser login to complete against .com.au.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (12)
📝 WalkthroughWalkthroughThe CAS bridge now supports OAuth or environment-token authentication, reports connection state, persists selected agents, and uses the selection during delegation. Routing and command workflows require authentication and agent selection. Documentation and tests describe and validate the updated flow. ChangesCAS OAuth and agent selection
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related issues
Possibly related PRs
Sequence Diagram(s)sequenceDiagram
participant User
participant CASCommand
participant cas-auth-status
participant cas-select-agent
participant cas-safe-delegate
participant CASMCP
User->>CASCommand: Run /cas with task arguments
CASCommand->>cas-auth-status: Check authentication
cas-auth-status-->>CASCommand: Return OAuth or token status
CASCommand->>CASMCP: List available agents
CASMCP-->>CASCommand: Return agent list
User->>cas-select-agent: Select agent ID
cas-select-agent-->>User: Persist selection and confirm
CASCommand->>cas-safe-delegate: Delegate task with selected agent
cas-safe-delegate->>CASMCP: Submit task
CASMCP-->>cas-safe-delegate: Return delegation result
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Comment |
Issue for this PR
#8 (extends CAS bridge with OAuth connect + list + select)
Type of change
What does this PR do?
Lets OpenCode OAuth to CAS, list specialised agents, and select one for the project.
alterspective-agentuses OAuth (opencode mcp auth alterspective-agent) instead of a static empty Bearer headermcp-auth.json(optionalCAS_MCP_TOKENoverride)cas_auth_status,cas_select_agent(+ existingcas_safe_*)/casfor connect → list → select → delegate.opencode/cas-selection.jsonDepends on CAS deploy: OAuth discovery currently advertises dead
agent.alterspective.io. Companion fix is branchcas-oauth-issueronalterspective-agent(resolveMcpOauthIssuer). Until deployed, set Azure envMCP_OAUTH_ISSUER=https://agent.alterspective.com.auor OAuth browser flow may fail.How did you verify your code works?
bun test test/plugin/cas-bridge/cas-bridge-routing.test.ts: 12 named tests pass (observed)opencode mcp auth alterspective-agentnot completed in this session (blocked on CAS issuer metadata until deploy)Screenshots / recordings
N/A
Checklist
No user-doc impact: developer/fork integration.
Summary by CodeRabbit
New Features
/casworkflow for authentication, browsing available agents, selecting an agent, and optionally delegating tasks.Documentation
Tests