Files
multica/server/migrations/040_agent_custom_env.up.sql
Jiang Bohan 4165401d16 feat(agent): support custom environment variables for router/proxy mode
Add per-agent custom_env configuration that gets injected into the agent
subprocess at launch time. This enables users to configure custom API
endpoints (ANTHROPIC_BASE_URL), API keys (ANTHROPIC_API_KEY), and cloud
provider modes (CLAUDE_CODE_USE_BEDROCK, CLAUDE_CODE_USE_VERTEX) without
requiring code changes.

Changes:
- Migration 040: add custom_env JSONB column to agent table
- Backend: custom_env in agent CRUD API + claim endpoint
- Daemon: merge custom_env into subprocess environment variables
- Frontend: env var editor in agent settings (key-value pairs with
  visibility toggle for sensitive values)

Closes #816
Related: #807, #809
2026-04-13 16:47:56 +08:00

6 lines
353 B
SQL

-- Add custom_env column to agent table for user-configurable environment
-- variables that get injected into the agent subprocess at launch time.
-- Supports router/proxy (ANTHROPIC_API_KEY, ANTHROPIC_BASE_URL),
-- Bedrock (CLAUDE_CODE_USE_BEDROCK + AWS creds), and Vertex AI modes.
ALTER TABLE agent ADD COLUMN custom_env JSONB NOT NULL DEFAULT '{}';