feat: persist conversation read state - #4858
Draft
justavibedev wants to merge 1 commit into
Draft
Conversation
Co-authored-by: openhands <openhands@all-hands.dev>
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HUMAN:
AGENT:
Why
Agent Canvas cannot distinguish a completed response that has not been read from one the user has already seen. The server also currently advances
updated_atfor title-only metadata changes, so that timestamp cannot safely represent agent activity.This is the canonical Agent Server and TypeScript-client portion of OpenHands/OpenHands#17140. The Canvas UI must consume a released client version in a follow-up PR.
Summary
last_read_atand expose a derivedunreadvalue only for terminal runs with newer activity.Issue Number
Supports OpenHands/OpenHands#17140.
How to Test
All dependency setup happened in disposable containers without host secrets. Networking was disconnected before the test commands ran.
uv run pytest -q tests/agent_server/test_conversation_info_model.py tests/agent_server/test_conversation_service.py tests/agent_server/test_conversation_router.py— 225 passed.uv run pytest -q tests/agent_server/test_openapi_contract.py tests/agent_server/test_openapi_discriminator.py— 12 passed.uv run ruff check ...anduv run ruff format --check ...— passed for all changed Python files.uv run pyright openhands-agent-server/openhands/agent_server/models.py openhands-agent-server/openhands/agent_server/conversation_service.py— 0 errors.npm test -- --runInBand src/__tests__/api-clients.test.ts— 86 passed.npm run lint,npm run build, andnpm run format:check— passed (lint reported eight pre-existing warnings and no errors).The live Canvas demonstration belongs in the dependent UI PR after this client contract is released; this PR remains draft until then.
Video/Screenshots
Not applicable to this backend/client contract PR. The dependent Canvas PR will include the issue-required visual evidence.
Design Doc
N/A.
Type
Notes
This is additive at the REST layer. Existing conversations load with
last_read_at = null. Read state is reported only after a run reaches a terminal status, so in-flight output does not produce an unread marker.