Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Filter AgentCondensationObservation events from agent state #6705

Merged

Conversation

csmith49
Copy link
Collaborator

End-user friendly description of the problem this fixes or functionality that this introduces

  • Include this change in the Release Notes. If checked, you must provide an end-user friendly description for your change below

Give a summary of what the PR does, explaining any non-trivial design decisions

Adds AgentCondensationObservation to the agent controller's list of filtered events. These events will still trigger a step, but now the user and LLM will not be made aware because the event is not stored in the agent's state.


Link of any specific issues this addresses

#6634 - removes chat messages mentioned here

Copy link
Collaborator

@enyst enyst left a comment

Choose a reason for hiding this comment

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

Thank you! I think you're right, this way of doing it may be best for now, although we may want to reconsider it when the condensation obs has actual content we want in history (e.g. summaries)

I looked at where we send all events to the frontend, we do there some kind of ad-hoc filtering too. It seems like we do send it over, so it can be displayed?

@csmith49
Copy link
Collaborator Author

I looked at where we send all events to the frontend, we do there some kind of ad-hoc filtering too. It seems like we do send it over, so it can be displayed?

I see. The fix here just ensures the observation isn't added to the state, but it looks like inclusion in the event stream is responsible for sending it up to the front-end. Might be the best of both worlds: shows the user something happened, but the LLM has no idea.

The other usage of the AgentCondensationObservation happens when a summary event occurs. One problem there is that, because this happens inside the agent's step function, there is no event stream in scope and no visibility (outside the LLM) of the condensation in the first place. We'd need a way to bubble it out of the step function (perhaps as part of the step return value?) if we want users to see it.

@csmith49
Copy link
Collaborator Author

The other usage of the AgentCondensationObservation happens when a summary event occurs. One problem there is that, because this happens inside the agent's step function, there is no event stream in scope and no visibility (outside the LLM) of the condensation in the first place. We'd need a way to bubble it out of the step function (perhaps as part of the step return value?) if we want users to see it.

If anyone has thoughts about this I've opened #6706.

@enyst
Copy link
Collaborator

enyst commented Feb 13, 2025

Thank you! Yes, I agree, this might be best. I suggest we can merge this PR and take the rest in the linked issue.

@csmith49 csmith49 merged commit 341b695 into All-Hands-AI:main Feb 13, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants