Skip to content

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

@FidoCanCode

Description

@FidoCanCode

Regression introduced in #456. claude_start/claude_run in kennel/worker.py call build_prompt(fido_dir, subskill, context) which writes two files:

  • fido_dir/system — persona.md + sub-skill.md (e.g. setup.md, task.md)
  • fido_dir/prompt — the context (request, repo, branch, etc.)

In the pre-session code path, print_prompt_from_file spawns a new claude with BOTH files — the sub-skill instructions are loaded as system prompt.

In the persistent-session path (if session is not None), only the prompt file is sent:

prompt = (fido_dir / "prompt").read_text()
with session:
    session.send(prompt)
    session.consume_until_result()

The persistent ClaudeSession was constructed with only sub/persona.md as its system prompt, so claude never sees setup.md. Result: claude responds to a bare context with no instructions and doesn't call kennel task add. Then:

RuntimeError: setup produced no tasks

Watchdog restarts the thread, it tries again, same failure. Observed live after #475 landed, leaving fido stuck on #465 with 3+ abandoned branches.

Fix: prepend fido_dir/system content to the user message when routing through the persistent session, so claude gets the sub-skill instructions as part of each turn. Something like:

system_content = (fido_dir / "system").read_text()
prompt = (fido_dir / "prompt").read_text()
with session:
    session.send(f"{system_content}\n\n---\n\n{prompt}")
    session.consume_until_result()

Apply to claude_start and claude_run both. Test that setup, task, ci, resume, and comments sub-skills all deliver their instructions through the persistent session.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions