Skip to content

Commit 7d7221d

Browse files
Gkrumbach07claude
andauthored
feat: add Gemini CLI runner with polymorphic bridge and extensible registry (#788)
## Summary - **Gemini CLI runner**: Full polymorphic bridge implementation that wraps Google's Gemini CLI (`@google/gemini-cli`) as an AG-UI compatible runner, alongside the existing Claude Agent SDK runner - **Extensible agent registry**: Data-driven `AgentRuntimeSpec` ConfigMap that replaces hardcoded runner configuration across operator, backend, and frontend. Operator reads container image, resources, port, state dir, and sandbox config from the registry - **Unified `USE_VERTEX`**: Single environment variable replaces `CLAUDE_CODE_USE_VERTEX` and `GEMINI_USE_VERTEX` with backward-compatible deprecation warnings - **Production hardening**: Subprocess timeouts, graceful SIGTERM/SIGKILL shutdown, stderr streaming via deque ring buffer, TTL-based worker eviction, MCP support for Gemini via `.gemini/settings.json` - **Frontend**: Runner type selection in create dialog, admin runtimes page, loading/error states, Shadcn RadioGroup for settings, ARIA accessibility - **Feature flag auto-sync**: `runner.gemini-cli.enabled` in `flags.json` for automatic Unleash provisioning ### Key architectural decisions - All runners use sandbox mode (pod-per-session) with conditional init/sidecar based on `sandbox.seed` and `sandbox.persistence` from registry - Capabilities come from the runner's `/capabilities` endpoint at runtime, NOT from the registry - Env var blocklist (not allowlist) for subprocess — user-defined vars pass through automatically - Session ID persisted to `.gemini/gemini_session_ids.json` for `--resume` across pod restarts - `GOOGLE_GENAI_USE_VERTEXAI=true` set in subprocess env for Vertex AI mode ## Test plan - [x] 165+ new Python tests (adapter, bridge, session, auth, registry) - [x] Go backend tests (registry cache, routing, feature gates) - [x] Go operator tests (conditional pod components, registry fallback) - [x] Manual E2E: Gemini CLI sessions with API key auth on OpenShift cluster - [ ] Manual E2E: Vertex AI auth mode - [ ] Manual E2E: MCP servers (Jira, GitHub) with Gemini CLI Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9f67a0a commit 7d7221d

493 files changed

Lines changed: 13131 additions & 3679 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/commands/jira.log.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ Steps:
199199
Expected: Session disappears from list
200200
Actual: Session remains until page refresh
201201
202-
Repo: vTeam
202+
Repo: vTeam
203203
Files: components/frontend/src/components/session-list/
204204
Browser: Chrome 120, Firefox 121
205205
@@ -215,7 +215,7 @@ Current queries use deprecated `onSuccess` callbacks.
215215
Need to migrate to the new `select` and mutation patterns.
216216
217217
Repo: vTeam
218-
Files:
218+
Files:
219219
- components/frontend/src/services/queries/sessions.ts
220220
- components/frontend/src/hooks/
221221
@@ -259,7 +259,7 @@ For a Jira to be immediately actionable by an agent, ensure:
259259
260260
**✅ Good (agent can start immediately):**
261261
> "Fix login redirect loop on Safari"
262-
>
262+
>
263263
> **Steps**: 1. Open Safari 2. Click Login 3. Observe infinite redirect
264264
> **Expected**: Redirect to dashboard
265265
> **Actual**: Loops back to login

.claude/commands/speckit.implement.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ You **MUST** consider the user input before proceeding (if not empty).
104104
105105
6. Execute implementation following the task plan:
106106
- **Phase-by-phase execution**: Complete each phase before moving to the next
107-
- **Respect dependencies**: Run sequential tasks in order, parallel tasks [P] can run together
107+
- **Respect dependencies**: Run sequential tasks in order, parallel tasks [P] can run together
108108
- **Follow TDD approach**: Execute test tasks before their corresponding implementation tasks
109109
- **File-based coordination**: Tasks affecting the same files must run sequentially
110110
- **Validation checkpoints**: Verify each phase completion before proceeding

.claude/commands/speckit.specify.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,27 @@ Given that feature description, do this:
2929
- "Fix payment processing timeout bug" → "fix-payment-timeout"
3030

3131
2. **Check for existing branches before creating new one**:
32-
32+
3333
a. First, fetch all remote branches to ensure we have the latest information:
3434
```bash
3535
git fetch --all --prune
3636
```
37-
37+
3838
b. Find the highest feature number across all sources for the short-name:
3939
- Remote branches: `git ls-remote --heads origin | grep -E 'refs/heads/[0-9]+-<short-name>$'`
4040
- Local branches: `git branch | grep -E '^[* ]*[0-9]+-<short-name>$'`
4141
- Specs directories: Check for directories matching `specs/[0-9]+-<short-name>`
42-
42+
4343
c. Determine the next available number:
4444
- Extract all numbers from all three sources
4545
- Find the highest number N
4646
- Use N+1 for the new branch number
47-
47+
4848
d. Run the script `.specify/scripts/bash/create-new-feature.sh --json "$ARGUMENTS"` with the calculated number and short-name:
4949
- Pass `--number N+1` and `--short-name "your-short-name"` along with the feature description
5050
- Bash example: `.specify/scripts/bash/create-new-feature.sh --json "$ARGUMENTS" --json --number 5 --short-name "user-auth" "Add user authentication"`
5151
- PowerShell example: `.specify/scripts/bash/create-new-feature.sh --json "$ARGUMENTS" -Json -Number 5 -ShortName "user-auth" "Add user authentication"`
52-
52+
5353
**IMPORTANT**:
5454
- Check all three sources (remote branches, local branches, specs directories) to find the highest number
5555
- Only match branches/directories with the exact short-name pattern
@@ -95,20 +95,20 @@ Given that feature description, do this:
9595
9696
```markdown
9797
# Specification Quality Checklist: [FEATURE NAME]
98-
98+
9999
**Purpose**: Validate specification completeness and quality before proceeding to planning
100100
**Created**: [DATE]
101101
**Feature**: [Link to spec.md]
102-
102+
103103
## Content Quality
104-
104+
105105
- [ ] No implementation details (languages, frameworks, APIs)
106106
- [ ] Focused on user value and business needs
107107
- [ ] Written for non-technical stakeholders
108108
- [ ] All mandatory sections completed
109-
109+
110110
## Requirement Completeness
111-
111+
112112
- [ ] No [NEEDS CLARIFICATION] markers remain
113113
- [ ] Requirements are testable and unambiguous
114114
- [ ] Success criteria are measurable
@@ -117,16 +117,16 @@ Given that feature description, do this:
117117
- [ ] Edge cases are identified
118118
- [ ] Scope is clearly bounded
119119
- [ ] Dependencies and assumptions identified
120-
120+
121121
## Feature Readiness
122-
122+
123123
- [ ] All functional requirements have clear acceptance criteria
124124
- [ ] User scenarios cover primary flows
125125
- [ ] Feature meets measurable outcomes defined in Success Criteria
126126
- [ ] No implementation details leak into specification
127-
127+
128128
## Notes
129-
129+
130130
- Items marked incomplete require spec updates before `/speckit.clarify` or `/speckit.plan`
131131
```
132132
@@ -151,20 +151,20 @@ Given that feature description, do this:
151151
152152
```markdown
153153
## Question [N]: [Topic]
154-
154+
155155
**Context**: [Quote relevant spec section]
156-
156+
157157
**What we need to know**: [Specific question from NEEDS CLARIFICATION marker]
158-
158+
159159
**Suggested Answers**:
160-
160+
161161
| Option | Answer | Implications |
162162
|--------|--------|--------------|
163163
| A | [First suggested answer] | [What this means for the feature] |
164164
| B | [Second suggested answer] | [What this means for the feature] |
165165
| C | [Third suggested answer] | [What this means for the feature] |
166166
| Custom | Provide your own answer | [Explain how to provide custom input] |
167-
167+
168168
**Your choice**: _[Wait for user response]_
169169
```
170170

.claude/commands/speckit.tasks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Every task MUST strictly follow this format:
7777
4. **[Story] label**: REQUIRED for user story phase tasks only
7878
- Format: [US1], [US2], [US3], etc. (maps to user stories from spec.md)
7979
- Setup phase: NO story label
80-
- Foundational phase: NO story label
80+
- Foundational phase: NO story label
8181
- User Story phases: MUST have story label
8282
- Polish phase: NO story label
8383
5. **Description**: Clear action with exact file path

.claude/skills/dev-cluster/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ The skill understands all platform components:
110110
| Backend | `components/backend` | `vteam_backend:latest` | API server |
111111
| Frontend | `components/frontend` | `vteam_frontend:latest` | Web UI |
112112
| Operator | `components/operator` | `vteam_operator:latest` | K8s operator |
113-
| Runner | `components/runners/claude-code-runner` | `vteam_claude_runner:latest` | Claude Code runner |
113+
| Runner | `components/runners/ambient-runner` | `vteam_claude_runner:latest` | Claude Code runner |
114114
| State Sync | `components/runners/state-sync` | `vteam_state_sync:latest` | S3 persistence |
115115
| Public API | `components/public-api` | `vteam_public_api:latest` | External API |
116116

.claude/skills/dev-cluster/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The Ambient Code Platform consists of these containerized components:
2424
| **Backend** | `components/backend` | `vteam_backend:latest` | Go API for K8s CRD management |
2525
| **Frontend** | `components/frontend` | `vteam_frontend:latest` | NextJS web interface |
2626
| **Operator** | `components/operator` | `vteam_operator:latest` | Kubernetes operator (Go) |
27-
| **Runner** | `components/runners/claude-code-runner` | `vteam_claude_runner:latest` | Python Claude Code runner |
27+
| **Runner** | `components/runners/ambient-runner` | `vteam_claude_runner:latest` | Python Claude Code runner |
2828
| **State Sync** | `components/runners/state-sync` | `vteam_state_sync:latest` | S3 persistence service |
2929
| **Public API** | `components/public-api` | `vteam_public_api:latest` | External API gateway |
3030

@@ -146,7 +146,7 @@ Determine which components are affected:
146146
- Changes in `components/backend/` → backend
147147
- Changes in `components/frontend/` → frontend
148148
- Changes in `components/operator/` → operator
149-
- Changes in `components/runners/claude-code-runner/` → runner
149+
- Changes in `components/runners/ambient-runner/` → runner
150150
- Changes in `components/runners/state-sync/` → state-sync
151151
- Changes in `components/public-api/` → public-api
152152

@@ -655,4 +655,4 @@ This skill knows all the relevant Makefile targets in /workspace/repos/platform:
655655
- `make local-status` - Check pod status
656656
- `make local-logs-backend` - Follow backend logs
657657
- `make local-logs-frontend` - Follow frontend logs
658-
- `make local-logs-operator` - Follow operator logs
658+
- `make local-logs-operator` - Follow operator logs

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ If applicable, add screenshots to help explain your problem.
6868
<!-- Maintainers will add appropriate labels -->
6969
- **Priority:** [low/medium/high/critical]
7070
- **Complexity:** [trivial/easy/medium/hard]
71-
- **Component:** [frontend/backend/operator/tools/docs]
71+
- **Component:** [frontend/backend/operator/tools/docs]

.github/ISSUE_TEMPLATE/documentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,4 @@ assignees: []
9393
- **Priority:** [low/medium/high]
9494
- **Effort:** [S/M/L]
9595
- **Type:** [new-docs/update-docs/fix-docs]
96-
- **Audience:** [user/developer/operator]
96+
- **Audience:** [user/developer/operator]

.github/ISSUE_TEMPLATE/epic.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ This epic will be implemented through the following stories:
6464

6565
## 📝 Notes
6666

67-
[Technical notes, architectural decisions, or implementation details]
67+
[Technical notes, architectural decisions, or implementation details]

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ assignees: []
88

99
## 🚀 Feature Description
1010

11-
**Is your feature request related to a problem?**
11+
**Is your feature request related to a problem?**
1212
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
1313

1414
**Describe the solution you'd like**
@@ -79,4 +79,4 @@ How will we measure the success of this feature?
7979
- **Priority:** [low/medium/high]
8080
- **Effort:** [S/M/L/XL]
8181
- **Component:** [frontend/backend/operator/tools/docs]
82-
- **Type:** [new-feature/enhancement/improvement]
82+
- **Type:** [new-feature/enhancement/improvement]

0 commit comments

Comments
 (0)