Skip to content

Commit 85419bf

Browse files
committed
Add prompt files for migration agent to implement gemma subagent in a fresh fork of the gemini cli
1 parent 264d925 commit 85419bf

2 files changed

Lines changed: 110 additions & 0 deletions

File tree

gemma_files_links.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Gemma & Subagent UI Migration Links
2+
3+
The following are links to the exact file states from the stale branch (commit
4+
`264d92574434c36853372453480f6bfab662371b`). You can use `web_fetch` on these
5+
URLs to read the required code.
6+
7+
## New Files (To be created)
8+
9+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/core/src/agents/gemma.ts
10+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/core/src/core/ollamaClient.ts
11+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/core/src/core/ollamaChat.ts
12+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/core/src/core/localGeminiClient.ts
13+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/core/src/services/toolCallService.ts
14+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/core/src/services/summarizer.ts
15+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/core/src/utils/toolCallParser.ts
16+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/cli/src/ui/components/SubagentInterruptDialog.tsx
17+
18+
## Modified Files (To be surgically updated)
19+
20+
### Core/Agents & Execution Logic
21+
22+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/core/src/agents/types.ts
23+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/core/src/agents/executor.ts
24+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/core/src/agents/invocation.ts
25+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/core/src/agents/registry.ts
26+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/core/src/agents/build-test-agent.ts
27+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/core/src/common/abort-signal-manager.ts
28+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/core/src/services/shellExecutionService.ts
29+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/core/src/tools/shell.ts
30+
31+
### CLI UI Components (Subagent Streaming & Display)
32+
33+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/cli/src/ui/AppContainer.tsx
34+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/cli/src/ui/components/Composer.tsx
35+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/cli/src/ui/components/messages/SubagentHistoryDisplay.tsx
36+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/cli/src/ui/components/messages/SubagentToolCallDisplay.tsx
37+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/cli/src/ui/contexts/UIStateContext.tsx
38+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/cli/src/ui/hooks/useGeminiStream.ts
39+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/cli/src/ui/hooks/useReactToolScheduler.ts
40+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/cli/src/ui/types.ts
41+
42+
### Routing & Services
43+
44+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/core/src/routing/strategies/classifierStrategy.ts
45+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/core/src/routing/strategies/classifierStrategy.test.ts
46+
47+
### Utilities
48+
49+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/core/src/utils/environmentContext.ts
50+
51+
### Configuration (Core & CLI)
52+
53+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/core/src/config/config.ts
54+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/cli/src/config/config.ts
55+
- https://github.com/sidwan02/gemini-cli-gemma/blob/264d92574434c36853372453480f6bfab662371b/packages/cli/src/config/settingsSchema.ts

gemma_migration_prompt.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Gemma Subagent Migration Instructions
2+
3+
You are tasked with porting the `gemma_agent` and Ollama integration code into
4+
this fresh codebase from a stale branch.
5+
6+
## Step 1: Gather Context
7+
8+
Read the file `gemma_files_links.md` in this directory. It contains a list of
9+
GitHub URLs pointing to the exact state of the files in the stale branch. Use
10+
your `web_fetch` tool to read the contents of these files to understand the
11+
implementation details.
12+
13+
## Step 2: Create New Files
14+
15+
The feature introduces a few entirely new files. Create them directly based on
16+
the fetched content:
17+
18+
- `packages/core/src/agents/gemma.ts`
19+
- `packages/core/src/core/ollamaClient.ts`
20+
- `packages/core/src/core/ollamaChat.ts`
21+
22+
## Step 3: Surgically Update Existing Files
23+
24+
The rest of the links in `gemma_files_links.md` point to files that already
25+
exist in this repository but need to be updated. **Do not completely overwrite
26+
local files with the stale branch versions.** The local files may have other
27+
recent updates. Instead, use `grep_search` and `read_file` to understand the
28+
local structure, and use `replace` to surgically insert the Gemma/Ollama logic.
29+
30+
Key areas to integrate:
31+
32+
1. **Configuration (`settingsSchema.ts`, `config.ts`):** Add `useGemmaRouting`
33+
and `gemmaSubagentSettings` types and default configurations.
34+
2. **Types (`agents/types.ts`):** Add `OllamaModelConfig` and any related
35+
interfaces.
36+
3. **Registry (`registry.ts`):** Import and register the `GemmaAgent`.
37+
4. **Executor (`executor.ts`):** Add the logic to format tool code for Gemma
38+
(`_prepareGemmaToolCode`) and handle Gemma-specific execution paths.
39+
5. **Routing & Services (`classifierStrategy.ts`, `toolCallService.ts`,
40+
`summarizer.ts`):** Integrate the `OllamaClient` and `OllamaChat` for local
41+
routing and summarization.
42+
6. **Utilities (`toolCallParser.ts`):** Ensure the Ollama tool call parsing
43+
logic is added.
44+
45+
## Step 4: Verification
46+
47+
After applying the changes, run the project's verification commands to ensure no
48+
TypeScript or linting errors were introduced:
49+
50+
```bash
51+
npm run typecheck
52+
npm run lint
53+
```
54+
55+
Fix any errors that arise during verification.

0 commit comments

Comments
 (0)