Deliver sub-skill instructions to persistent ClaudeSession turns (closes #477)#478
Merged
Conversation
…oses #477) Before this fix, the persistent-session code paths in claude_start / claude_run sent only fido_dir/prompt to the session. fido_dir/system — which contains the sub-skill instructions (setup.md, task.md, etc.) — was built by build_prompt but never delivered. Claude saw only the bare context ("Request: ...", "Repo: ...") without any instructions, produced empty output, and find_or_create_pr raised "setup produced no tasks". The watchdog restarted the thread, the same failure repeated, and fido piled up abandoned branches. Extract the concatenation into _session_turn_prompt() and use it for both setup (claude_start) and task (claude_run) paths through the persistent session. Tests updated to expect the combined message.
…em file (closes #477) Before this fix, the persistent ClaudeSession code paths in claude_start / claude_run sent only fido_dir/prompt to the session. The sub-skill instructions (setup.md, task.md, etc.) — built into fido_dir/system by build_prompt — were never delivered, so claude saw only the bare context ("Request: ...", "Repo: ...") with no instructions, produced empty output, and find_or_create_pr raised "setup produced no tasks". The persistent session's system prompt is already persona.md, so we shouldn't prepend the full fido_dir/system (persona+skill) — that would duplicate the persona. Instead, build_prompt now also writes fido_dir/skill containing just the sub-skill content, and _session_turn_prompt prepends that (not the full system) to the per-turn user message. Apply to both claude_start (setup) and claude_run (task/ci/threads) persistent-session paths. Tests updated.
rhencke
approved these changes
Apr 14, 2026
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.
Fixes the "setup produced no tasks" regression from #456.
Problem
When the persistent `ClaudeSession` was introduced in #456, `claude_start` / `claude_run` started sending only `fido_dir/prompt` (context) to the session. The sub-skill instructions — `setup.md`, `task.md`, `ci.md`, `comments.md`, `resume.md` — were built into `fido_dir/system` by `build_prompt` but never delivered to the session.
Claude saw only the bare "Request: ... Repo: ... Branch: ..." with no instructions, produced empty output, and `find_or_create_pr` raised `setup produced no tasks`. Observed live after #475 landed: fido stuck on #465, watchdog kept restarting, three abandoned branches.
Fix
The persistent session already has `persona.md` as its system prompt, so prepending the full `fido_dir/system` (persona + sub-skill) would duplicate the persona. Instead:
Tests updated: `_setup_fido_dir` fixtures now write `skill`, and the `session_path_sends_prompt_content` tests expect the combined `\n\n---\n\n` body.
100% coverage, suite passes.
Closes #477.