Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1992a94
semantics of a single condensation captured in apply_condensation
Jan 13, 2026
1d29bf1
view condensation application via scanning
Jan 13, 2026
ccdc5c7
refactor enforce_batch_atomicity signature
Jan 13, 2026
6699327
minor enforcement function refactor
Jan 13, 2026
1841b0c
wq
Jan 13, 2026
dae64ed
deterministic summarization "ids"
Jan 13, 2026
9d2a2a2
tests passing, minor changes
Jan 13, 2026
880fd73
update llm condenser to treat summary events more generically
Jan 13, 2026
7cc678e
linting
Jan 13, 2026
d0370db
removing unused view functions
Jan 13, 2026
ddb6f57
removing refs to unused functions
Jan 13, 2026
d90cb4f
minor type fixes
Jan 13, 2026
a04705d
Merge branch 'main' into feat/multi-summary-views
csmith49 Jan 13, 2026
14adbf3
Merge branch 'main' into feat/multi-summary-views
csmith49 Jan 14, 2026
5401643
Merge branch 'main' into feat/multi-summary-views
csmith49 Jan 14, 2026
3485b1e
minor view tweak
Jan 14, 2026
33cc903
Id generation uses event ids
Jan 14, 2026
2407053
set + list comprehension changes, minor
Jan 15, 2026
d609b18
removing
Jan 15, 2026
9cb75a8
Merge branch 'main' into feat/multi-summary-views
csmith49 Jan 15, 2026
9ecb648
Merge branch 'main' into feat/multi-summary-views
csmith49 Jan 15, 2026
f8792e5
Merge branch 'main' into feat/multi-summary-views
csmith49 Jan 16, 2026
4cd9dc3
Merge branch 'main' into feat/multi-summary-views
csmith49 Jan 16, 2026
67ac567
moving summary event construction to condensation event, docs for sum…
Jan 16, 2026
20ddb71
condensation semantics to condensation event, documentation tweaks
Jan 16, 2026
beff30f
linting
Jan 16, 2026
e7ca22f
Merge branch 'main' into feat/multi-summary-views
csmith49 Jan 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from openhands.sdk.context.view import View
from openhands.sdk.event.base import LLMConvertibleEvent
from openhands.sdk.event.condenser import Condensation
from openhands.sdk.event.llm_convertible import MessageEvent
from openhands.sdk.llm import LLM, Message, TextContent
from openhands.sdk.observability.laminar import observe

Expand Down Expand Up @@ -117,33 +116,15 @@ def condensation_requirement(
if Reason.REQUEST in reasons:
return CondensationRequirement.HARD

def _get_summary_event_content(self, view: View) -> str:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer needed -- the previous summaries are now captured as regular events in the summary generation.

"""Extract the text content from the summary event in the view, if any.

If there is no summary event or it does not contain text content, returns an
empty string.
"""
summary_event_content: str = ""

summary_event = view.summary_event
if isinstance(summary_event, MessageEvent):
message_content = summary_event.llm_message.content[0]
if isinstance(message_content, TextContent):
summary_event_content = message_content.text

return summary_event_content

def _generate_condensation(
self,
summary_event_content: str,
forgotten_events: Sequence[LLMConvertibleEvent],
summary_offset: int,
) -> Condensation:
"""Generate a condensation by using the condenser's LLM to summarize forgotten
events.

Args:
summary_event_content: The content of the previous summary event.
forgotten_events: The list of events to be summarized.
summary_offset: The index where the summary event should be inserted.

Expand All @@ -161,7 +142,6 @@ def _generate_condensation(
prompt = render_template(
os.path.join(os.path.dirname(__file__), "prompts"),
"summarizing_prompt.j2",
previous_summary=summary_event_content,
events=event_strings,
)

Expand Down Expand Up @@ -269,10 +249,7 @@ def get_condensation(
"events. Consider adjusting keep_first or max_size parameters."
)

summary_event_content = self._get_summary_event_content(view)

return self._generate_condensation(
summary_event_content=summary_event_content,
forgotten_events=forgotten_events,
summary_offset=summary_offset,
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
You are maintaining a context-aware state summary for an interactive agent.
You will be given a list of events corresponding to actions taken by the agent, and the most recent previous summary if one exists.
You will be given a list of events corresponding to actions taken by the agent, which will include previous summaries.
If the events being summarized contain ANY task-tracking, you MUST include a TASK_TRACKING section to maintain continuity.
When referencing tasks make sure to preserve exact task IDs and statuses.

Expand Down Expand Up @@ -46,10 +46,6 @@ COMPLETED: 15 haikus written for results [T,H,T,H,T,H,T,T,H,T,H,T,H,T,H]
PENDING: 5 more haikus needed
CURRENT_STATE: Last flip: Heads, Haiku count: 15/20

<PREVIOUS SUMMARY>
{{ previous_summary }}
</PREVIOUS SUMMARY>

{% for event in events %}
<EVENT>
{{ event }}
Expand Down
Loading
Loading