fix: address review — scratch file survives crash, cap read size, fix instruction (#262)

- Remove SCRATCH_FILE from action-agent cleanup() trap so it survives crashes
- Change instruction to note contents already injected (avoid wasted tool call)
- Cap scratch file read at 8KB via head -c 8192
- Move predictor scratch instruction after formula (consistent placement)
- Remove redundant FINAL_PHASE re-reads in planner/predictor

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
openhands 2026-03-20 20:58:32 +00:00
parent 6405ac9837
commit 26d20af48c
4 changed files with 9 additions and 10 deletions

View file

@ -64,12 +64,11 @@ about CI health, issue staleness, agent status, and system conditions.
## Project context
${CONTEXT_BLOCK}
${SCRATCH_CONTEXT:+${SCRATCH_CONTEXT}
}${SCRATCH_INSTRUCTION}
${SCRATCH_CONTEXT}
## Formula
${FORMULA_CONTENT}
${SCRATCH_INSTRUCTION}
${PROMPT_FOOTER}"
# ── Run session ──────────────────────────────────────────────────────────
@ -77,7 +76,7 @@ export CLAUDE_MODEL="sonnet"
run_formula_and_monitor "predictor"
# ── Cleanup scratch file on normal exit ──────────────────────────────────
FINAL_PHASE=$(read_phase "$PHASE_FILE")
if [ "$FINAL_PHASE" = "PHASE:done" ]; then
# FINAL_PHASE already set by run_formula_and_monitor
if [ "${FINAL_PHASE:-}" = "PHASE:done" ]; then
rm -f "$SCRATCH_FILE"
fi