Hey guys, I am playing around with the `Observatio...
# questions
a
Hey guys, I am playing around with the
ObservationMaskingCondenser
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:
Copy code
[{'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:
Copy code
[{'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!
To me the expected behaviour would be that the observation
Copy code
{'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.
w
Hey Tobias -- that's definitely a bug. It looks like the condenser is working as expected, but somehow the original masked observation is somehow making its way back in later on in the pipeline.
Best guess is the action/observation pairing that happens in the ConversationMemory.process_events step.
a
Thanks for the pointer and confirmation. I'll look into patching this when I find some time.