feat(long-task): make goal idempotent by removing up-front split planning

- step_start: remove "Plan the split" instruction that encouraged users
to write procedural steps inside the goal. The first step now only
explores and starts the first chunk, leaving split decisions to runtime
handoff hints.
- step_middle: add "Follow the hint" as the first instruction so each
step executes exactly what the previous step's next_step_hint asks for,
making the goal itself stateless and safe to repeat.
This commit is contained in:
chengyongru 2026-05-15 01:13:35 +08:00
parent 7c29a738a5
commit 9a893c0f10
2 changed files with 6 additions and 7 deletions

View File

@ -31,8 +31,9 @@ You are one step in a chain working toward a goal.
{% endif %} {% endif %}
## Instructions ## Instructions
1. **Check existing work**: Use the file list above — do NOT re-explore files already handled. 1. **Follow the hint**: Do exactly what the Suggested Next Step above asks for.
2. **Do the next chunk**: Make concrete progress. Write results to files. 2. **Check existing work**: Use the file list above — do NOT re-explore files already handled.
3. **Handoff**: Call `handoff()` with your progress summary, files changed, and a hint for the next step. Call `complete()` only if the ENTIRE goal is achieved. 3. **Do the next chunk**: Make concrete progress. Write results to files.
4. **Handoff**: Call `handoff()` with your progress summary, files changed, and a hint for the next step. Call `complete()` only if the ENTIRE goal is achieved.
You have {{ budget }} tool calls total. Reserve the last 1-2 calls for `handoff()` or `complete()`. You have {{ budget }} tool calls total. Reserve the last 1-2 calls for `handoff()` or `complete()`.

View File

@ -7,12 +7,10 @@ You are the FIRST step in a meta-ReAct loop. Your job is NOT to finish the entir
## Instructions ## Instructions
1. **Explore**: Check the filesystem and any relevant state. Do NOT assume anything. 1. **Explore**: Check the filesystem and any relevant state. Do NOT assume anything.
2. **Plan the split**: Explicitly decide how the goal will be divided across the remaining {{ max_steps - 1 }} steps. Write this plan down. 2. **Start**: Make concrete progress on the FIRST chunk only. Do NOT plan the entire split — the next step will decide what follows based on your handoff hint.
3. **Do ONE chunk**: Make concrete progress on ONLY the first chunk. Do NOT attempt to finish the entire goal now, even if you have enough tool calls. The meta-loop exists so later steps can review, correct, and refine your work. 3. **Handoff**: Call `handoff()` with:
4. **Handoff**: Call `handoff()` with:
- A detailed summary of what you did - A detailed summary of what you did
- Files changed - Files changed
- The explicit plan for the remaining steps
- A clear hint for the next step - A clear hint for the next step
You have {{ budget }} tool calls. Reserve the last 1-2 for `handoff()`. You have {{ budget }} tool calls. Reserve the last 1-2 for `handoff()`.