astonishing-hamburger-10899
08/14/2025, 5:37 AMObservationMaskingCondenser and at runtime it behaves as expected, but when I check the llm completions afterwards the completions in which an observation was masked actually has more messages and all of the original ones are still present. I would have expected the messages in the log to match the view returned by ObservationMaskingCondenser .
E.g.
Turn 1:
[{'role': 'system',
'content': [{'type': 'text',
'text': 'You are OpenHands agent, a helpful AI assistant ...'}]},
{'role': 'user',
'content': [{'type': 'text',
'text': 'Here\'s a running example of how to perform a task with the provided tools ...'}]},
{'role': 'assistant',
'content': [{'type': 'text',
'text': '<function=execute_bash>\n<parameter=command>\n\nfind /workspace/scikit-learn__scikit-learn__0.21 -name "*pipeline.py*"\n\n</parameter>\n</function>'}]},
{'role': 'user',
'content': [{'type': 'text',
'text': 'EXECUTION RESULT of [execute_bash]:\n/workspace/scikit-learn__scikit-learn__0.21/sklearn/tests/test_pipeline.py\n/workspace/scikit-learn__scikit-learn__0.21/sklearn/pipeline.py\n/workspace/scikit-learn__scikit-learn__0.21/examples/feature_selection/plot_feature_selection_pipeline.py\n[The command completed with exit code 0.]\n[Current working directory: /workspace/scikit-learn__scikit-learn__0.21]\n[Python interpreter: /opt/miniconda3/envs/testbed/bin/python]\n[Command finished with exit code 0]'}]}]
Turn 2:
[{'role': 'system',
'content': [{'type': 'text',
'text': 'You are OpenHands agent, a helpful AI assistant ...'}]},
{'role': 'user',
'content': [{'type': 'text',
'text': 'Here\'s a running example of how to perform a task with the provided tools ...'}]},
{'role': 'user', 'content': [{'type': 'text', 'text': '\n\n<MASKED>'}]},
{'role': 'assistant',
'content': [{'type': 'text',
'text': '<function=execute_bash>\n<parameter=command>\n\nfind /workspace/scikit-learn__scikit-learn__0.21 -name "*pipeline.py*"\n\n</parameter>\n</function>'}]},
{'role': 'user',
'content': [{'type': 'text',
'text': 'EXECUTION RESULT of [execute_bash]:\n/workspace/scikit-learn__scikit-learn__0.21/sklearn/tests/test_pipeline.py\n/workspace/scikit-learn__scikit-learn__0.21/sklearn/pipeline.py\n/workspace/scikit-learn__scikit-learn__0.21/examples/feature_selection/plot_feature_selection_pipeline.py\n[The command completed with exit code 0.]\n[Current working directory: /workspace/scikit-learn__scikit-learn__0.21]\n[Python interpreter: /opt/miniconda3/envs/testbed/bin/python]\n[Command finished with exit code 0]'}]},
{'role': 'assistant',
'content': [{'type': 'text',
'text': '<function=str_replace_editor>\n<parameter=command>view</parameter>\n<parameter=path>/workspace/scikit-learn__scikit-learn__0.21/sklearn/tests/test_pipeline.py</parameter>\n</function>'}]},
{'role': 'user',
'content': [{'type': 'text',
'text': 'EXECUTION RESULT of [str_replace_editor]:\nHere\'s the result of running `cat -n` ...}]}]
Notice especially the additional masked message in the second turn, while all other messages are still present. This seems like a bug to me, or is this somehow intended? Thanks!astonishing-hamburger-10899
08/14/2025, 6:36 AM{'role': 'user',
'content': [{'type': 'text',
'text': 'EXECUTION RESULT of [execute_bash]:\n/workspace/scikit-learn__scikit-learn__0.21/sklearn/tests/test_pipeline.py\n/workspace/scikit-learn__scikit-learn__0.21/sklearn/pipeline.py\n/workspace/scikit-learn__scikit-learn__0.21/examples/feature_selection/plot_feature_selection_pipeline.py\n[The command completed with exit code 0.]\n[Current working directory: /workspace/scikit-learn__scikit-learn__0.21]\n[Python interpreter: /opt/miniconda3/envs/testbed/bin/python]\n[Command finished with exit code 0]'}]},
is replaced by the masked message {'role': 'user', 'content': [{'type': 'text', 'text': '\n\n<MASKED>'}]},
instead it seems like this masked message is just appended after the system and user prompt? Note that I am using an attention window of 4 here.wide-doctor-37830
08/14/2025, 2:28 PMwide-doctor-37830
08/14/2025, 2:29 PMastonishing-hamburger-10899
08/14/2025, 3:14 PM