Skip to content

Commit b9e1641

Browse files
committed
feat(agents): AI provider setup, auth types, agent management UI
AI Provider (Settings > AI Agents): - Provider selector: Claude Code, OpenCode, Codex - Auth type: Subscription (OAuth token) vs API Key - Dynamic model list from installed CLI - Token save with encryption, smoke test - No host ~/.claude mount, auth via env vars only Agent management: - Enable/disable switch on every agent card - Edit dialog: schedule cron, deliverable, form resets on agent change - Enter key submits form - OpenCode CLI provider Fixes: - Sandbox status resolved against global setting in run detail - Duplicate Root Cause Analysis heading stripped from PR body - Raw stream-json filtered from error event display - CLAUDE.md dependency rules
1 parent 822ecf8 commit b9e1641

File tree

19 files changed

+1508
-115
lines changed

19 files changed

+1508
-115
lines changed

CLAUDE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ Guidance for Claude Code when working with the Temps codebase.
1919
- Create markdown documentation files unless explicitly requested
2020
- Mark Docker tests with `#[ignore]` -- they MUST skip gracefully at runtime instead
2121
- Create error types with generic messages -- ALWAYS include IDs, names, and operation context
22+
- Expose internal dependencies via public accessors (e.g. `service.db()`) -- pass dependencies directly via constructor or AppState
23+
- Use `Option<T>` for dependencies that are required -- use `Arc<T>` and fail at startup if missing
24+
- Use `get_service` for required dependencies in plugins -- use `require_service` which fails fast with a clear error
2225

2326
### ALWAYS
2427
- Run `cargo check --lib` after every modification
@@ -35,6 +38,9 @@ Guidance for Claude Code when working with the Temps codebase.
3538
- Use `permission_guard!` macro for authorization in handlers
3639
- Add audit logging for all write operations (CREATE, UPDATE, DELETE)
3740
- Include contextual information (IDs, resource names, paths) in every error message
41+
- Give each component its own copy of shared dependencies (Arc clones) -- never share via accessor methods
42+
- Use `require_service` in plugins for dependencies the app can't function without
43+
- Let the user configure and control their setup -- show status, give instructions, don't do things silently on their behalf
3844

3945
---
4046

crates/temps-agents/src/ai_cli/claude.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ impl AiCliProvider for ClaudeCliProvider {
9595
)
9696
} else {
9797
(false, None, None, None, Some(
98-
"Run 'claude setup-token' on the server to authenticate, or set ANTHROPIC_API_KEY in autopilot settings.".into(),
98+
"Run 'claude setup-token' on the server to authenticate, or set ANTHROPIC_API_KEY. Configure in Settings > AI Agents.".into(),
9999
))
100100
}
101101
} else {
@@ -105,7 +105,7 @@ impl AiCliProvider for ClaudeCliProvider {
105105
}
106106
}
107107
_ => (false, None, None, None, Some(
108-
"Run 'claude setup-token' on the server to authenticate, or set ANTHROPIC_API_KEY in autopilot settings.".into(),
108+
"Run 'claude setup-token' on the server to authenticate, or set ANTHROPIC_API_KEY. Configure in Settings > AI Agents.".into(),
109109
)),
110110
};
111111

crates/temps-agents/src/ai_cli/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
pub mod claude;
22
pub mod codex;
3+
pub mod opencode;
34

45
use async_trait::async_trait;
56
use std::future::Future;
@@ -65,6 +66,14 @@ pub fn create_provider(name: &str) -> Option<Box<dyn AiCliProvider>> {
6566
match name {
6667
"claude_cli" => Some(Box::new(claude::ClaudeCliProvider)),
6768
"codex_cli" => Some(Box::new(codex::CodexCliProvider)),
69+
"opencode" => Some(Box::new(opencode::OpenCodeCliProvider)),
6870
_ => None,
6971
}
7072
}
73+
74+
/// All supported provider names.
75+
pub const PROVIDER_NAMES: &[(&str, &str)] = &[
76+
("claude_cli", "Claude Code"),
77+
("opencode", "OpenCode"),
78+
("codex_cli", "Codex"),
79+
];

0 commit comments

Comments
 (0)