Skip to content

feat: ACP migration, streaming display, and OAuth token support#2

Open
damianhodgkiss wants to merge 4 commits intomainfrom
feat/acp-streaming-oauth
Open

feat: ACP migration, streaming display, and OAuth token support#2
damianhodgkiss wants to merge 4 commits intomainfrom
feat/acp-streaming-oauth

Conversation

@damianhodgkiss
Copy link
Member

@damianhodgkiss damianhodgkiss commented Feb 3, 2026

Summary

  • ACP Migration: Replace OpenCode SSE with Claude Agent SDK (ACP) for sandbox communication
  • Streaming Display: Send incremental token chunks for live text streaming in the UI
  • OAuth Token Support: Add CLAUDE_CODE_OAUTH_TOKEN support for subscription billing (much cheaper than API key)
  • Configurable ACP Command: Switch between claude-code-acp, opencode acp, or other ACP-compatible agents

Changes

ACP Migration

  • Replace OpenCode SSE polling with spawn_agent_process for proper JSON-RPC over stdio
  • Auto-approve permissions in sandbox environment (isolated container)
  • Simplify bridge by removing SSE polling and OpenCode ID generation
  • Remove inspect-plugin.js (no longer needed)

Streaming Text Display

  • Bridge sends incremental token chunks (not accumulated)
  • Frontend concatenates chunks for live streaming display
  • Show pulsing indicator while content streams in
  • Preserve partial content when execution is stopped

OAuth Token Support

  • Add CLAUDE_CODE_OAUTH_TOKEN env var support
  • OAuth token takes precedence over API key when both set
  • Add claude_oauth_token terraform variable
  • Make anthropic_api_key optional (default empty)

Configurable ACP Command

  • Add ACP_COMMAND env var to switch between ACP-compatible agents
  • Supports space-separated command + args (e.g., opencode acp)
  • Defaults to claude-code-acp

Usage

OAuth (subscription billing)

# terraform.tfvars
claude_oauth_token = "sk-ant-oat01-..."
anthropic_api_key  = ""

Get token via: claude setup-token

Use OpenCode instead of Claude Code

# terraform.tfvars
acp_command = "opencode acp"

Test plan

  • Deploy with terraform apply
  • Test streaming: send prompt, verify text streams in live
  • Test stop: click stop during streaming, verify partial content preserved
  • Test OAuth: set token, verify sandbox uses subscription billing
  • Test ACP command: set acp_command = "opencode acp", verify it spawns OpenCode

damianhodgkiss and others added 4 commits February 3, 2026 15:45
## ACP Migration
- Replace OpenCode SSE with Claude Agent SDK (ACP) for sandbox communication
- Use spawn_agent_process for proper JSON-RPC over stdio
- Auto-approve permissions in sandbox environment
- Simplify bridge by removing SSE polling and OpenCode ID generation

## Streaming Text Display
- Send incremental token chunks from bridge (not accumulated)
- Frontend concatenates chunks for live streaming display
- Show pulsing indicator while content streams in
- Preserve partial content when execution is stopped

## OAuth Token Support
- Add CLAUDE_CODE_OAUTH_TOKEN support (uses subscription billing)
- OAuth token takes precedence over API key when both set
- Add claude_oauth_token terraform variable
- Make anthropic_api_key optional (default empty)

## Other Changes
- Update sandbox image dependencies for ACP
- Remove inspect-plugin.js (no longer needed)
- Simplify entrypoint.py
Allows switching between different ACP-compatible agents:
- claude-code-acp (default)
- opencode acp
- or any other ACP-compatible command

Supports space-separated command + args (e.g., 'opencode acp').
Set via terraform variable or env var ACP_COMMAND.
- Fix Slack bot to concatenate all incremental token events instead of
  taking only the last one (was showing just last character of responses)
- Increase ACP stdio buffer limit to 10MB (default 64KB too small for
  large responses)
- Bump cache buster to v45

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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