refactor(agent): tighten SUMMARY_PREFIX wording and fix stale doc references
Legibility pass on the consolidated prefix: collapse the topic-overlap rule from three overlapping sentences into one WINS sentence + one discard/no-wrap-up sentence (same constraints, less dilution), fix the module docstring to describe the headings that actually shipped, and correct the #10896 comment's heading name (Historical Pending User Asks).
This commit is contained in:
parent
acb2954d82
commit
6c752ca3a5
@ -7,7 +7,7 @@ protecting head and tail context.
|
|||||||
Improvements over v2:
|
Improvements over v2:
|
||||||
- Structured summary template with Resolved/Pending question tracking
|
- Structured summary template with Resolved/Pending question tracking
|
||||||
- Filter-safe summarizer preamble that treats prior turns as source material
|
- Filter-safe summarizer preamble that treats prior turns as source material
|
||||||
- "Historical Work (DO NOT EXECUTE)" replaces "Next Steps" and "Remaining Work" to avoid reading as active instructions
|
- Historical (reference-only) section headings replace "Next Steps"/"Remaining Work" to avoid reading as active instructions
|
||||||
- Clear separator when summary merges into tail message
|
- Clear separator when summary merges into tail message
|
||||||
- Iterative summary updates (preserves info across multiple compactions)
|
- Iterative summary updates (preserves info across multiple compactions)
|
||||||
- Token-budget tail protection instead of fixed message count
|
- Token-budget tail protection instead of fixed message count
|
||||||
@ -49,18 +49,14 @@ SUMMARY_PREFIX = (
|
|||||||
"Respond ONLY to the latest user message that appears AFTER this "
|
"Respond ONLY to the latest user message that appears AFTER this "
|
||||||
"summary — that message is the single source of truth for what to do "
|
"summary — that message is the single source of truth for what to do "
|
||||||
"right now. "
|
"right now. "
|
||||||
"Any topic overlap between the summary and the latest user message does "
|
"Topic overlap with the summary does NOT mean you should resume its "
|
||||||
"NOT mean you should resume the summary's task. The latest user message "
|
"task: even on similar topics, the latest user message WINS. Treat ONLY "
|
||||||
"always takes priority and WINS, even on similar topics. "
|
"the latest message as the active task and discard stale items from "
|
||||||
"If the latest user message is a new question, request, or instruction "
|
f"'{HISTORICAL_TASK_HEADING}' / '{HISTORICAL_IN_PROGRESS_HEADING}' / "
|
||||||
"that relates to a topic also mentioned in "
|
|
||||||
f"'{HISTORICAL_TASK_HEADING}' / "
|
|
||||||
f"'{HISTORICAL_IN_PROGRESS_HEADING}' / "
|
|
||||||
f"'{HISTORICAL_PENDING_ASKS_HEADING}' / "
|
f"'{HISTORICAL_PENDING_ASKS_HEADING}' / "
|
||||||
f"'{HISTORICAL_REMAINING_WORK_HEADING}', treat ONLY the "
|
f"'{HISTORICAL_REMAINING_WORK_HEADING}' entirely — do not 'wrap up' or "
|
||||||
"latest message as the active task — discard those stale items entirely. "
|
"'finish' work described there unless the latest message explicitly "
|
||||||
"Do NOT 'wrap up' or 'finish' any work described in the summary unless "
|
"asks for it. "
|
||||||
"the latest message explicitly asks for it. "
|
|
||||||
"Reverse signals in the latest message (e.g. 'stop', 'undo', 'roll "
|
"Reverse signals in the latest message (e.g. 'stop', 'undo', 'roll "
|
||||||
"back', 'just verify', 'don't do that anymore', 'never mind', a new "
|
"back', 'just verify', 'don't do that anymore', 'never mind', a new "
|
||||||
"topic) must immediately end any in-flight work described in the "
|
"topic) must immediately end any in-flight work described in the "
|
||||||
@ -1790,7 +1786,7 @@ The user has requested that this compaction PRIORITISE preserving all informatio
|
|||||||
Context compressor bug (#10896): ``_align_boundary_backward`` can pull
|
Context compressor bug (#10896): ``_align_boundary_backward`` can pull
|
||||||
``cut_idx`` past a user message when it tries to keep tool_call/result
|
``cut_idx`` past a user message when it tries to keep tool_call/result
|
||||||
groups together. If the last user message ends up in the *compressed*
|
groups together. If the last user message ends up in the *compressed*
|
||||||
middle region the LLM summariser writes it into "Historical User Asks",
|
middle region the LLM summariser writes it into "Historical Pending User Asks",
|
||||||
but ``SUMMARY_PREFIX`` tells the next model to respond only to user
|
but ``SUMMARY_PREFIX`` tells the next model to respond only to user
|
||||||
messages *after* the summary — so the task effectively disappears from
|
messages *after* the summary — so the task effectively disappears from
|
||||||
the active context, causing the agent to stall, repeat completed work,
|
the active context, causing the agent to stall, repeat completed work,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user