fix(core): skip PTY initial-prompt delivery for fleet claude sessions#584
Merged
Conversation
Fleet claude sessions get their initial prompt via the dropbox task.md file, which exists before the agent process starts — no timing issues. The PTY delivery (text + \r to stdin) is unreliable because the agent TUI may not be ready to accept input when the Enter arrives (#540). For fleet claude sessions: dropbox::write_task() writes task.md, then PTY delivery is skipped entirely. For non-fleet sessions and non-claude agents: PTY delivery remains the only path (unchanged behavior). Also adds dropbox task write to open.rs initial-prompt path, which was previously missing — open only did PTY delivery without recording the task in the dropbox. Fixes #540
Deduplicate initial-prompt delivery logic from create.rs and open.rs into a shared helper in daemon_request.rs. Both callers now use the same function for dropbox write, fleet skip logic, idle gate clearing, and PTY delivery.
Wirasm
added a commit
that referenced
this pull request
Feb 26, 2026
…sions PR #584 fixed PTY timing issues (#540) by skipping PTY delivery for fleet claude sessions, intending to rely on "dropbox task.md + Claude inbox". However, only the dropbox write was implemented — the Claude Code inbox write was never added. Since Claude Code polls its inbox file (not the dropbox), the initial prompt was silently dropped. Changes: - Move write_to_inbox from CLI inject.rs to kild-core fleet.rs - Call write_to_inbox from deliver_initial_prompt_for_session when skip_pty is true (fleet claude sessions) - Update inject.rs to use the kild-core version - Add tests for write_to_inbox in fleet.rs
4 tasks
Wirasm
added a commit
that referenced
this pull request
Feb 26, 2026
…sions (#609) PR #584 fixed PTY timing issues (#540) by skipping PTY delivery for fleet claude sessions, intending to rely on "dropbox task.md + Claude inbox". However, only the dropbox write was implemented — the Claude Code inbox write was never added. Since Claude Code polls its inbox file (not the dropbox), the initial prompt was silently dropped. Changes: - Move write_to_inbox from CLI inject.rs to kild-core fleet.rs - Call write_to_inbox from deliver_initial_prompt_for_session when skip_pty is true (fleet claude sessions) - Update inject.rs to use the kild-core version - Add tests for write_to_inbox in fleet.rs
Wirasm
added a commit
that referenced
this pull request
Feb 26, 2026
When --initial-prompt is used with fleet claude sessions, the CLI now: 1. Prints a deprecation warning telling the agent to use kild inject 2. Delivers the prompt via the reliable inbox path as fallback Also updates kild-brain.md to instruct the brain to always use kild create + kild inject (two-step), never --initial-prompt. The --initial-prompt delivery path has been unreliable for fleet sessions across PRs #540, #584, #609. The inject path is battle-tested. Changes: - create.rs/open.rs: detect fleet claude sessions with --initial-prompt, print warning, deliver via fleet::write_to_inbox as fallback - fleet.rs: make is_claude_fleet_agent and fleet_mode_active pub - kild-brain.md: replace --initial-prompt usage with create + inject
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
deliver_initial_promptwhen the dropboxwrite_tasksucceeds — thetask.mdfile exists before the agent process starts, eliminating the TUI-not-ready timing issueopen.rsinitial-prompt path now writes to the dropbox (was previously PTY-only, with no task recorded in the dropbox)Test plan
cargo fmt --check— no violationscargo clippy --all -- -D warnings— no warningscargo test --all— all tests passkild create test --daemon --agent claude --initial-prompt "Hello"with fleet mode active — verify PTY delivery is skipped (check logs forinitial_prompt_pty_skipped)kild create test --daemon --agent claude --initial-prompt "Hello"without fleet mode — verify PTY delivery still fireskild open test --initial-prompt "Next task"with fleet mode — verify dropbox write + PTY skipFixes #540