Skip to content

Agent: loop prompts reference non-existent .ralph/AGENTS.md #128

@federiconeri

Description

@federiconeri

Summary

Loop prompt templates reference @.ralph/AGENTS.md which doesn't exist, causing failed file reads in every session that uses those prompts.

Problem / Context

During the second agent test, sessions 1 and 3 both errored trying to read .ralph/AGENTS.md:

  • Session 1 (planning): 5 AGENTS.md references, file-not-found errors
  • Session 3 (pr-review): 6 AGENTS.md references, file-not-found errors

Each failed read wastes an API turn (~53K tokens of context re-read) and adds noise to the session.

Root Cause

Two prompt templates contain Study @.ralph/AGENTS.md for commands and patterns:

  • .ralph/prompts/PROMPT_feature.md (line 2)
  • .ralph/prompts/PROMPT_review_manual.md (line 2)

The file .ralph/guides/AGENTS.md exists but at a different path than what the prompts reference.

Proposed Solution

Either:

  1. Fix the path: Change @.ralph/AGENTS.md@.ralph/guides/AGENTS.md in the prompt templates
  2. Remove the reference: If the guides content isn't useful for loop sessions, remove the line entirely

This is a ralph-side fix (prompt templates), but wiggum's agent mode should validate that referenced files exist before spawning sessions.

Files to Modify

File Changes
src/agent/tools/execution.ts Consider validating prompt template file references before spawning

Acceptance Criteria

  • No "file not found" errors for AGENTS.md in loop sessions
  • Agent validates or warns about missing referenced files in prompts

Metadata

Metadata

Assignees

Labels

ai/llmAI workflows, agents, promptsbugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions