fix(automations): reliably deliver prompts to unattended agents - #2986
Open
BTM-cmd wants to merge 1 commit into
Open
fix(automations): reliably deliver prompts to unattended agents#2986BTM-cmd wants to merge 1 commit into
BTM-cmd wants to merge 1 commit into
Conversation
Contributor
Greptile SummaryThe PR routes unattended automations through ACP when a provider supports ACP but can deliver PTY prompts only through synthetic keystrokes, ensuring the initial prompt is sent as a structured protocol turn.
Confidence Score: 5/5The PR appears safe to merge with no actionable correctness or security issues identified. The new capability check currently targets Kimi as intended, preserves explicit ACP and normal argv-based PTY paths, and supplies the prompt through the existing ACP initial-queue startup contract.
|
| Filename | Overview |
|---|---|
| apps/emdash-desktop/src/main/core/automations/actions/taskCreate.ts | Adds capability-based transport resolution so unattended keystroke-only providers with ACP support receive prompts through an eagerly started ACP session. |
| apps/emdash-desktop/src/main/core/automations/actions/taskCreate.test.ts | Adds focused coverage verifying Kimi PTY automation configuration is routed through ACP with the complete structured initial prompt. |
Sequence Diagram
sequenceDiagram
participant A as Automation Runner
participant R as Provider Registry
participant C as Conversation Store
participant ACP as ACP Runtime
A->>R: Read prompt and ACP capabilities
alt Keystroke prompt and ACP supported
R-->>A: Select ACP
A->>C: Create ACP conversation with initialQueue
A->>ACP: startSession(initialQueue)
else Explicit ACP
R-->>A: Preserve ACP
A->>C: Create ACP conversation with initialQueue
A->>ACP: startSession(initialQueue)
else Normal PTY provider
R-->>A: Select PTY
A->>C: Create PTY conversation with initialPrompt
end
Reviews (1): Last reviewed commit: "fix(automations): hand off keystroke pro..." | Re-trigger Greptile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
initialQueueturn and thatstartSessionis calledRoot cause
Automation persisted the full prompt, provisioned the task, and marked the run launched. Kimi PTY, however, starts without a prompt argument and depends on delayed synthetic paste/Enter into its TUI. A background card cannot recover if that injection is missed, leaving a running
kimi-codeprocess with no work. ACP sends the prompt as a protocol turn and acknowledges session startup.Checks
pnpm run buildpnpm --filter @emdash/emdash-desktop run typecheckpnpm --filter @emdash/emdash-desktop run lintpnpm --filter @emdash/emdash-desktop exec vitest run src/main/core/automations/actions/taskCreate.test.ts --project node(16 passed)git diff --checkRisk
This changes transport selection for background automations configured as PTY only when the provider advertises both keystroke-only prompt delivery and ACP support. Interactive/manual task behavior is unchanged.