flaky-ability-71097
07/25/2025, 11:38 AMlimited-student-10747
07/25/2025, 11:43 AMpolite-architect-52194
07/25/2025, 11:57 AMflaky-ability-71097
07/25/2025, 11:59 AMcreamy-angle-16764
07/25/2025, 2:28 PMmitmproxy in reverse proxy mode between open hands and your LLM and record the entire conversation. I think it allows you to step through it too: https://mitmproxy.org/flaky-ability-71097
07/25/2025, 5:19 PMlimited-student-10747
07/25/2025, 5:24 PMflaky-ability-71097
07/25/2025, 5:39 PMlimited-student-10747
07/25/2025, 5:43 PMflaky-ability-71097
07/28/2025, 8:55 AMif cfg.replay_trajectory_path:
initial_user_action = NullAction()
else:
initial_user_action = MessageAction(content=instruction)
And it's ok now. However I have another issue 😄, when loading the trajectory my first message is a SystemMessageAction, but there is an assertion stating that the first message should be a MessageAction (in the load_replay_log function). Why do you require a MessageAction and a SystemMessageAction is not good enough? My gut feeling is that SystemMessageAction should inherit from MessageAction rather than Action... but I don't know the codebase well enough to understand what this change would entailflaky-ability-71097
07/29/2025, 10:35 AMflaky-ability-71097
07/29/2025, 10:43 AMdef load_replay_log(trajectory_path: str) -> tuple[list[Event] | None, Action]:
"""
Load trajectory from given path, serialize it to a list of events, and return
two things:
1) A list of events except the first action
2) First action (user message, a.k.a. initial task)
"""
try:
path = Path(trajectory_path).resolve()
if not path.exists():
raise ValueError(f'Trajectory file not found: {path}')
if not path.is_file():
raise ValueError(f'Trajectory path is a directory, not a file: {path}')
with open(path, 'r', encoding='utf-8') as file:
output_saved = json.load(file)
trajectory = output_saved['history']
events = ReplayManager.get_replay_events(trajectory)
assert isinstance(events[0], MessageAction)
return events[1:], events[0]
except json.JSONDecodeError as e:
raise ValueError(f'Invalid JSON format in {trajectory_path}: {e}')
Rather than events = ReplayManager.get_replay_events(json.load(file)) in such a way you can directly feed the output.json (the same used in the trajectory visualizer) to the load replay function. Let me know what you think, I can create a pull request in case in case you think it's usefulfancy-salesmen-9987
07/30/2025, 9:55 AMaction = self._replay_manager.step() https://github.com/All-Hands-AI/OpenHands/blob/a32a6230782be168002cc4050efa71c9aabccc9c/openhands/controller/agent_controller.py#L810 shows that the first message does not include the replay trajectory. Does this mean that the replay is not passed into the model? Thx!