mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 13:47:19 +08:00
Remove/reduce unused content in a CmdOutputObservation (#7404)
Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
@@ -369,8 +369,11 @@ class ConversationMemory:
|
||||
message: Message
|
||||
|
||||
if isinstance(obs, CmdOutputObservation):
|
||||
# if it doesn't have tool call metadata, it was triggered by a user action
|
||||
# Note: CmdOutputObservation content is already truncated at initialization,
|
||||
# and the observation content should not have been modified after initialization
|
||||
# we keep this truncation for backwards compatibility for a time
|
||||
if obs.tool_call_metadata is None:
|
||||
# if it doesn't have tool call metadata, it was triggered by a user action
|
||||
text = truncate_content(
|
||||
f'\nObserved result of command executed by user:\n{obs.to_agent_observation()}',
|
||||
max_message_chars,
|
||||
|
||||
Reference in New Issue
Block a user