feat: add Letta Code CLI provider#1900
feat: add Letta Code CLI provider#1900janburzinski wants to merge 3 commits intogeneralaction:mainfrom
Conversation
…a-code-cli # Conflicts: # agents/integrations/providers.md # src/main/core/conversations/impl/agent-command.ts
Greptile SummaryThis PR adds Letta Code as the 25th CLI provider in the emdash multi-agent harness. It wires in the icon, agent metadata, a classifier for output classification, and a new
Confidence Score: 4/5Safe to merge — the new provider follows established conventions and the command-building logic is correct for both new and resuming sessions. The newConversationFlag mechanism is sound and the Letta entry integrates cleanly with the existing settings/defaults pipeline. The only notable concern is the overly broad 'Connected to' alternative in the auth_success regex, which could cause spurious notifications during normal sessions but won't break functionality. src/main/core/agent-hooks/classifiers/letta.ts — the auth_success regex pattern warrants a quick tightening before merge.
|
| Filename | Overview |
|---|---|
| src/shared/agent-provider-registry.ts | Adds letta to AGENT_PROVIDER_IDS and a well-formed provider definition; also introduces the newConversationFlag field to the AgentProviderDefinition type. |
| src/main/core/conversations/impl/agent-command.ts | Adds a third branch to the session-flag logic that emits newConversationFlag from the provider definition when starting a fresh (non-resuming) session; reads correctly from providerDef, not user overrides. |
| src/main/core/agent-hooks/classifiers/letta.ts | New classifier adapted from Kiro's; idle-prompt detection is Letta-specific, but the auth_success regex adds a broad 'Connected to' alternative that risks false positives on ordinary terminal output. |
| src/renderer/utils/agentConfig.ts | Adds Letta entry with isSvg: true and invertInDark: true; consistent with other SVG providers like openai. |
| src/main/core/agent-hooks/classifiers/index.ts | Registers the new Letta classifier factory in the correct alphabetical position alongside other providers. |
| src/renderer/lib/providers/meta.ts | Imports and maps the Letta SVG icon using the ?raw query, consistent with other SVG providers in the map. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[buildAgentCommand called] --> B{isResuming AND providerConfig.resumeFlag?}
B -- Yes --> C[Push resumeFlag args + sessionId if sessionIdFlag]
B -- No --> D{providerConfig.sessionIdFlag?}
D -- Yes --> E[Push sessionIdFlag + sessionId]
D -- No --> F{NOT isResuming AND providerDef.newConversationFlag?}
F -- Yes --> G[Push newConversationFlag e.g. letta --new]
F -- No --> H[No session flag appended e.g. bare letta = auto-resume]
C --> Z[Continue building command]
E --> Z
G --> Z
H --> Z
Z --> I{autoApprove AND providerConfig.autoApproveFlag?}
I -- Yes --> J[Push autoApproveFlag e.g. --yolo]
I -- No --> K[Skip]
J --> L{NOT isResuming AND initialPrompt AND NOT useKeystrokeInjection?}
K --> L
L -- Yes --> M[Push initialPromptFlag + prompt]
L -- No --> N[Skip / deliver via keystroke injection]
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/letta.ts:30-31
The `auth_success` check includes `"Connected to"` as an alternative, which is far broader than the other patterns in the block. Any Letta output that contains the phrase "Connected to" (e.g., "Connected to workspace", "Connected to remote agent", ordinary status lines) will fire an `auth_success` notification even during a normal session. The other patterns — `"Successfully authenticated"` and `"Login successful"` — are specific enough; `"Connected to"` should be made more precise or removed.
```suggestion
// Auth success (e.g. /connect flow)
if (/Successfully authenticated|Successfully connected|Login successful/i.test(text)) {
```
Reviews (1): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile
| // Auth success (e.g. /connect flow) | ||
| if (/Successfully authenticated|Connected to|Login successful/i.test(text)) { |
There was a problem hiding this comment.
The
auth_success check includes "Connected to" as an alternative, which is far broader than the other patterns in the block. Any Letta output that contains the phrase "Connected to" (e.g., "Connected to workspace", "Connected to remote agent", ordinary status lines) will fire an auth_success notification even during a normal session. The other patterns — "Successfully authenticated" and "Login successful" — are specific enough; "Connected to" should be made more precise or removed.
| // Auth success (e.g. /connect flow) | |
| if (/Successfully authenticated|Connected to|Login successful/i.test(text)) { | |
| // Auth success (e.g. /connect flow) | |
| if (/Successfully authenticated|Successfully connected|Login successful/i.test(text)) { |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/main/core/agent-hooks/classifiers/letta.ts
Line: 30-31
Comment:
The `auth_success` check includes `"Connected to"` as an alternative, which is far broader than the other patterns in the block. Any Letta output that contains the phrase "Connected to" (e.g., "Connected to workspace", "Connected to remote agent", ordinary status lines) will fire an `auth_success` notification even during a normal session. The other patterns — `"Successfully authenticated"` and `"Login successful"` — are specific enough; `"Connected to"` should be made more precise or removed.
```suggestion
// Auth success (e.g. /connect flow)
if (/Successfully authenticated|Successfully connected|Login successful/i.test(text)) {
```
How can I resolve this? If you propose a fix, please make it concise.|
closes #1701 |
summary
add letta as a new cli provider