Add CLI command to send task input#423
Conversation
|
Usage examples: # Send a follow-up prompt and submit it to the running task session
kanban task send \
--project-path /path/to/workspace \
--task-id <task-id> \
--text "Please continue from the previous result"
# Type text into a terminal-backed session without pressing Enter
kanban task send \
--project-path /path/to/workspace \
--task-id <task-id> \
--text "npm test" \
--no-submit
# Read the follow-up text from stdin
printf 'What is 1+10?' | kanban task send \
--project-path /path/to/workspace \
--task-id <task-id> |
Greptile SummaryThis PR adds a Confidence Score: 5/5Safe to merge — no blocking issues found; previously raised concerns have been addressed. All code paths are guarded correctly (empty text, TTY stdin, trailing newline), agent-specific submit semantics are well-tested, and the two previously flagged issues (stdin double-submit and silent empty-text fall-through) are fixed. No files require special attention.
|
| Filename | Overview |
|---|---|
| src/commands/task.ts | Adds readStdinText, resolveSendTaskText, sendTaskInput, and the send subcommand registration; logic is sound with proper guards for empty text, TTY stdin, and Cline vs terminal-agent submission semantics. |
| test/runtime/task-command.test.ts | New test file covering the happy path, --no-submit, Cline skip-CR path, stdin trimming, and empty --text rejection — good coverage of the introduced code. |
Sequence Diagram
sequenceDiagram
participant CLI as CLI (task send)
participant RST as resolveSendTaskText
participant Stdin as process.stdin
participant RT as runtimeClient
CLI->>RST: resolve text (--text or stdin)
alt --text provided and non-empty
RST-->>CLI: text value
else --text "" (empty)
RST-->>CLI: throw Error
else stdin (non-TTY)
RST->>Stdin: read chunks
Stdin-->>RST: raw bytes
RST-->>CLI: text (trailing \n trimmed)
else TTY, no --text
RST-->>CLI: throw Error
end
CLI->>RT: sendTaskSessionInput(text, appendNewline=false)
RT-->>CLI: {ok, summary: {agentId, ...}}
alt submit=false OR agentId=cline
CLI-->>User: {ok, submitted: input.submit}
else terminal agent, submit=true
CLI->>RT: sendTaskSessionInput("\r", appendNewline=false)
RT-->>CLI: {ok, summary}
CLI-->>User: {ok, submitted: true}
end
Reviews (4): Last reviewed commit: "Merge branch 'main' into feat/task-send-..." | Re-trigger Greptile
|
@greptile-apps please re-review |
Summary
kanban task sendfor sending follow-up input to running task sessions--text, stdin input,--project-path, and--no-submitTest plan
npm run typechecknpm run test:precommit