th-d5b446: Python server list_conversations + resume-by-conversationId#209
Merged
Conversation
Mirror the merged Rust/Go/TS reference (pearl th-d5b446) on the Python smooth-operator-server — the conversation-sidebar / resume substrate every client builds against. - New WS action `list_conversations`: most-recent-first, only conversations with messageCount > 0, each with a first-inbound title preview (~60 chars, leading markdown/control stripped, name fallback), ISO-8601 updatedAt, and messageCount. Optional limit (default 50). - `create_conversation_session` gains optional `conversationId`: a known id resumes (reuse id + persisted log so send_message appends and history replays); absent/unknown mints fresh (unchanged). Additive + back-compat. SessionStore gains list_conversations() + optional conversation_id on create_session; in-memory store tracks per-conversation last-activity for the sort key. 16 new tests; full suite green (154). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 008b532 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Problem
The merged Rust (reference), Go (#205), and TS (#206) smooth-operator servers all speak
list_conversations+ resume-by-conversationId— the conversation-sidebar / resume substrate every client (daemon PWA,th codeTUI, chat-widget) builds against. The Python server (python/server) didn't. Pearl th-d5b446.Solution
Python parity, matching the merged contract byte-for-byte at the wire level.
list_conversations({action, requestId, limit?}, default limit 50): replies viaimmediate_response(200, "Conversations") with{ conversations: [ { conversationId, title, updatedAt, messageCount } ] }— most-recent-first, filtered tomessageCount > 0(drops the empty conversations every page-load mints).title= ~60-char preview of the first inbound (user) message with leading markdown/control chars stripped, name fallback;updatedAt= ISO-8601.create_conversation_sessiongains optionalconversationId: a known id resumes (reuse the conversation id + its persisted message log, sosend_messageappends and the runner replays history); absent/unknown mints fresh — unchanged behavior.SessionStoregainslist_conversations()+ an optionalconversation_idarg oncreate_session;InMemorySessionStoretracks per-conversation last-activity for the sort key.Additive + back-compat: no
conversationId/ nolist_conversationscall = unchanged behavior.Verification
test_list_conversations_resume.py): title strip/fallback/truncate, list filter/sort/limit, resume binds + preserves history, unknown/absent id mints fresh — both at the store and through the realFrameDispatcher.uv run pytest→ 154 passed.ruff format+ruff checkclean.Pearl th-d5b446.
🤖 Generated with Claude Code