mirror of
https://github.com/mikeyobrien/ralph-orchestrator.git
synced 2026-04-24 22:55:57 +03:00
[GH-ISSUE #174] [Feature]: Add configuration option to disable scratchpad injection and instructions #67
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ralph-orchestrator#67
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @luisherranz on GitHub (Feb 13, 2026).
Original GitHub issue: https://github.com/mikeyobrien/ralph-orchestrator/issues/174
Use case
Currently, the scratchpad (
.ralph/agent/scratchpad.md) is unconditionally injected into every agent's prompt on every iteration, and the### 0b. SCRATCHPADinstructions section telling agents to write to it is always present. There is no way to disable this behavior.This is problematic in multi-hat configurations for several scenarios:
1. Adversarial HAT configurations
In setups where HATs are intentionally adversarial (e.g., a Builder and a Confessor that evaluates the Builder's honesty), the Confessor can read the Builder's reasoning in the scratchpad, which defeats the purpose of an independent evaluation. The scratchpad leaks the internal reasoning of one agent to another, potentially biasing their output.
2. Phase-separated workflows with independent state
When HATs are designed to operate in distinct phases (e.g., Design → Implementation → Review), each phase may manage its own structured files in
.ralph/agent/for state persistence. In these cases:.ralph/agent/design-notes.md.ralph/agent/implementation-log.md.ralph/agent/review-findings.mdThe shared scratchpad becomes noise — polluting each phase with irrelevant context from previous phases. Once the design phase is finished and implementation begins, there's no need to read what the design HATs wrote in the scratchpad, especially if the relevant output is already captured in purpose-built files.
3. Token efficiency
The scratchpad budget is 16,000 characters (~4,000 tokens) of content injected into every prompt. For HATs that don't need cross-iteration continuity via the scratchpad (because they use other mechanisms), this is wasted context window.
Proposed solution
Add a configuration option to
coreinralph.ymlto disable the scratchpad:When
scratchpad_injectis set tofalse:prepend_scratchpad()inEventLoopshould return the prompt unchanged.### 0b. SCRATCHPADinstructions section —core_prompt()inHatlessRalphshould omit the section that tells agents to write to the scratchpad. Injecting instructions to write to a file that won't be read back makes no sense and wastes tokens.### STATE MANAGEMENT— The state management guidance should not reference the scratchpad when it's disabled.## WORKFLOW— Workflow steps like "update scratchpad" should be omitted or adapted.The
## ORIENTATIONsection, guardrails, and other core prompt sections should remain unaffected.Area
Other
Backend(s) impacted
No response
Alternatives considered
No response
Additional context
In solo mode (no hats defined), the scratchpad is the primary continuity mechanism between iterations. Since each iteration starts with completely fresh context and there are no alternative state channels (events are routing signals, not narrative state), disabling the scratchpad in solo mode would effectively break the agent's ability to maintain state.
The implementation should either:
scratchpad_inject: falsein solo mode and log a warning, or@luisherranz commented on GitHub (Feb 13, 2026):
I'd be happy to send a PR if this functionality were accepted.
@mikeyobrien commented on GitHub (Feb 13, 2026):
I’d prefer scratchpad config per hat, with global fallback.
Something like this:
Resolution order per hat run:
This keeps backward compatibility, avoids cross-hat leakage, and still preserves continuity where needed.
@mikeyobrien commented on GitHub (Feb 13, 2026):
When I transitioned from scratchpad to the memory/task tool system, it caused a lot of undesirable side-effects and I readded it.
@luisherranz commented on GitHub (Feb 14, 2026):
Makes sense.
I will make a PR and try it myself to see how it works on those cases, thanks.
@luisherranz commented on GitHub (Feb 24, 2026):
I have opened a draft PR with an initial implementation proposal. I'll test it locally to see how it works.