Skip to content

Fix: Filtering conversations with no created at #6414

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

Merged
merged 3 commits into from
Jan 23, 2025

Conversation

tofarr
Copy link
Collaborator

@tofarr tofarr commented Jan 22, 2025

Filter out older conversations that don't have all required details

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

Filtering out conversations that don't have a 'created_at' field. (The top 2 in the screenshot below):

image

To run this PR locally, use the following command:

docker run -it --rm   -p 3000:3000   -v /var/run/docker.sock:/var/run/docker.sock   --add-host host.docker.internal:host-gateway   -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:a3b248f-nikolaik   --name openhands-app-a3b248f   docker.all-hands.dev/all-hands-ai/openhands:a3b248f

@tofarr tofarr marked this pull request as ready for review January 23, 2025 21:03
@@ -40,6 +40,8 @@ async def get_metadata(self, conversation_id: str) -> ConversationMetadata:

# Temp: force int to str to stop pydandic being, well... pedantic
json_obj = json.loads(json_str)
if 'created_at' not in json_obj:
raise FileNotFoundError(path)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why wouldn't it have a created_at?

Copy link
Collaborator

Choose a reason for hiding this comment

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

If it's older than this feature 😄

We currently see a lot of "55 years ago" timestamps

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah... I wonder if we could just add a created_at if it's missing.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Conversations are not implemented anywhere else than server currently, but I don't think it's difficult to do, at least in some basic way. This code is outside server. So I wonder if it makes sense to be lenient: once implemented elsewhere, e.g. cli, old streams could be loaded using conversations (replacing/using the session name).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Older entries from the start of January didn't have this field yet.

Copy link
Collaborator

Choose a reason for hiding this comment

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

If they don't have it, they fail to load, right? An alternative is to allow them to load and provide something (initialize it with now)

Maybe it doesn't matter a lot, admittedly, because there aren't many that both have metadata and don't have this field.

@tofarr tofarr merged commit b19a33c into main Jan 23, 2025
28 checks passed
@tofarr tofarr deleted the fix-filter-missing-created-at branch January 23, 2025 22:10
zchn pushed a commit to zchn/OpenHands that referenced this pull request Feb 4, 2025
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.

3 participants