feat: workspace persistence across conversational exchanges via content-parts#145
Open
radu-mocanu wants to merge 1 commit into
Open
feat: workspace persistence across conversational exchanges via content-parts#145radu-mocanu wants to merge 1 commit into
radu-mocanu wants to merge 1 commit into
Conversation
|
There was a problem hiding this comment.
Pull request overview
This PR adds a new runtime wrapper to persist a workspace across conversational exchanges by hydrating from the last assistant message’s file content-parts and (on success) emitting workspace files back as content-part attachments.
Changes:
- Introduces
ConversationalWorkspaceRuntimeto hydrate from conversation history and dehydrate workspace files as file content-parts before the final assistantendMessage. - Adds CAS URI helpers (
build_cas_uri,parse_attachment_id) andWorkspaceHydrator.hydrate_filesto support registry-less hydration from history. - Adds comprehensive tests for hydration/dehydration behavior and bumps package version to
0.12.2.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Bumps locked package version to 0.12.2. |
| pyproject.toml | Bumps project version to 0.12.2. |
| src/uipath/runtime/workspace/hydrator.py | Adds hydrate_files() to download attachments and build a registry without a preexisting registry. |
| src/uipath/runtime/workspace/conversational.py | Adds ConversationalWorkspaceRuntime that hydrates from history and emits workspace content-parts on success. |
| src/uipath/runtime/workspace/cas_uri.py | Adds helpers to build/parse CAS attachment URIs used by conversational workspace persistence. |
| src/uipath/runtime/workspace/init.py | Exposes the new conversational runtime and CAS URI helpers from the workspace package. |
| src/uipath/runtime/init.py | Re-exports ConversationalWorkspaceRuntime from the top-level runtime package. |
| tests/workspace/test_conversational_workspace.py | Adds tests covering ordering, hydration rules, relinking vs reupload, and disposal behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+95
to
+98
| async for event in self.stream( | ||
| input, | ||
| options=UiPathStreamOptions(resume=options.resume if options else False), | ||
| ): |
Comment on lines
+25
to
+33
| # The UUID is the last segment after the final colon | ||
| parts = uri.rsplit(":", 1) | ||
| if len(parts) != 2 or not parts[1]: | ||
| return None | ||
|
|
||
| try: | ||
| return str(uuid.UUID(parts[1])) | ||
| except (ValueError, AttributeError): | ||
| return None |
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.


Summary
ConversationalWorkspaceRuntime: hydrates the workspace from the file content-parts of the last assistant message in the conversation history, and on a successful exchange emits one content-part per workspace file (attachment uri +metaData {fileKind: workspace, sha256}) before the final assistantendMessagecas_urihelpers forurn:uipath:cas:file:orchestrator:{id}andWorkspaceHydrator.hydrate_filesfor registry-less hydration from historyWhy
conversational agents run one job per exchange, so the deepagents workspace (plan/todo/memory files) is lost between turns. per the contract agreed with the CAS team, the workspace now travels through job attachments referenced by file content-parts on the last assistant message.