feat: add Jules CLI provider support#1916
feat: add Jules CLI provider support#1916janburzinski wants to merge 1 commit intogeneralaction:mainfrom
Conversation
Greptile SummaryThis PR adds Jules (Google's async CLI coding agent) as a new provider, following the standard pattern used by other CLI providers in the codebase. All registration points are correctly wired: provider registry, classifier factory, renderer config, and icon assets.
Confidence Score: 4/5Safe to merge with a minor classifier fix — the provider wiring is correct, but the idle-prompt regex needs tightening before the classifier behaves reliably in production. The provider registration, icon, and UI config are all correct and follow established patterns. The one concrete defect is in the Jules classifier: the bare src/main/core/agent-hooks/classifiers/jules.ts — the idle_prompt regex pattern needs a more specific anchor to avoid false notifications.
|
| Filename | Overview |
|---|---|
| src/main/core/agent-hooks/classifiers/jules.ts | New Jules classifier closely mirrors the Goose classifier but adds an overly-broad bare Jules word match in the idle_prompt regex, which will produce false notifications during normal agent output. |
| src/shared/agent-provider-registry.ts | Jules provider definition added with correct npm package name, verified jules version subcommand, and correct doc URL. Pattern is consistent with other keystroke-injection providers like codebuff. |
| src/renderer/utils/agentConfig.ts | Jules entry added to agentConfig with SVG logo and isSvg flag set correctly, consistent with other SVG providers like Cursor and Droid. |
| src/renderer/lib/providers/meta.ts | Jules SVG icon imported and registered in the ICONS map, consistent with how other SVG providers are handled. |
| src/main/core/agent-hooks/classifiers/index.ts | Jules classifier correctly imported and registered in the classifier factory map in alphabetical order. |
| src/assets/images/jules.svg | Valid SVG icon added for Jules with proper viewBox and fill color. |
Sequence Diagram
sequenceDiagram
participant U as User
participant R as Renderer (agentConfig / meta)
participant Reg as agent-provider-registry
participant PTY as PTY Session
participant C as JulesClassifier
U->>R: Select Jules provider
R->>Reg: Look up AgentProviderDefinition (id: 'jules')
Reg-->>R: "{ cli: 'jules', useKeystrokeInjection: true, ... }"
R->>PTY: Spawn `jules` process
PTY->>PTY: Inject initial prompt via keystrokes
loop Output chunks
PTY->>C: classify(chunk)
C->>C: Append to buffer, strip ANSI
C-->>PTY: "ClassificationResult (notification | error | undefined)"
end
PTY-->>U: idle_prompt / permission_prompt / error notification
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
src/main/core/agent-hooks/classifiers/jules.ts:14-19
The bare `Jules` word in the `idle_prompt` regex will fire a false idle notification any time Jules prints its own name — for example during normal progress output like "Jules is analyzing your codebase…" or "Jules created a new remote session". All other classifiers in this repo use a specific terminal-prompt anchor (e.g., `goose\s*>`) rather than the tool's own name. This will cause spurious idle notifications during normal Jules operation.
```suggestion
if (/Ready|Awaiting|Press Enter|jules\s*[>$]/i.test(tail)) {
return {
type: 'notification',
notificationType: 'idle_prompt',
};
}
```
Reviews (1): Last reviewed commit: "feat: add Jules CLI provider support" | Re-trigger Greptile
| if (/Ready|Awaiting|Press Enter|Jules/i.test(tail)) { | ||
| return { | ||
| type: 'notification', | ||
| notificationType: 'idle_prompt', | ||
| }; | ||
| } |
There was a problem hiding this comment.
The bare
Jules word in the idle_prompt regex will fire a false idle notification any time Jules prints its own name — for example during normal progress output like "Jules is analyzing your codebase…" or "Jules created a new remote session". All other classifiers in this repo use a specific terminal-prompt anchor (e.g., goose\s*>) rather than the tool's own name. This will cause spurious idle notifications during normal Jules operation.
| if (/Ready|Awaiting|Press Enter|Jules/i.test(tail)) { | |
| return { | |
| type: 'notification', | |
| notificationType: 'idle_prompt', | |
| }; | |
| } | |
| if (/Ready|Awaiting|Press Enter|jules\s*[>$]/i.test(tail)) { | |
| return { | |
| type: 'notification', | |
| notificationType: 'idle_prompt', | |
| }; | |
| } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/main/core/agent-hooks/classifiers/jules.ts
Line: 14-19
Comment:
The bare `Jules` word in the `idle_prompt` regex will fire a false idle notification any time Jules prints its own name — for example during normal progress output like "Jules is analyzing your codebase…" or "Jules created a new remote session". All other classifiers in this repo use a specific terminal-prompt anchor (e.g., `goose\s*>`) rather than the tool's own name. This will cause spurious idle notifications during normal Jules operation.
```suggestion
if (/Ready|Awaiting|Press Enter|jules\s*[>$]/i.test(tail)) {
return {
type: 'notification',
notificationType: 'idle_prompt',
};
}
```
How can I resolve this? If you propose a fix, please make it concise.
summary
add jules as a cli provider