Skip to content

Deliver sub-skill instructions to persistent ClaudeSession turns (closes #477)#478

Merged
FidoCanCode merged 2 commits into
mainfrom
fix-persistent-session-subskill
Apr 14, 2026
Merged

Deliver sub-skill instructions to persistent ClaudeSession turns (closes #477)#478
FidoCanCode merged 2 commits into
mainfrom
fix-persistent-session-subskill

Conversation

@FidoCanCode
Copy link
Copy Markdown
Owner

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:

  • `build_prompt` now writes a third file `fido_dir/skill` containing just the sub-skill content (`setup.md`, `task.md`, …)
  • New `_session_turn_prompt` helper reads `fido_dir/skill` + `fido_dir/prompt` and joins them with `\n\n---\n\n`
  • Both `claude_start` and `claude_run` persistent-session paths now send `_session_turn_prompt(fido_dir)`

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.

…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.
@FidoCanCode FidoCanCode requested a review from rhencke April 14, 2026 17:51
@FidoCanCode FidoCanCode merged commit ddc0afd into main Apr 14, 2026
2 checks passed
@FidoCanCode FidoCanCode deleted the fix-persistent-session-subskill branch April 14, 2026 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Persistent ClaudeSession ignores the sub-skill system prompt, causing 'setup produced no tasks'

2 participants