Skip to content

Improve assistant management for more consistent behavior#14

Merged
jbencina merged 11 commits intov0.6.0from
jbencina/assistant
May 16, 2025
Merged

Improve assistant management for more consistent behavior#14
jbencina merged 11 commits intov0.6.0from
jbencina/assistant

Conversation

@jbencina
Copy link
Copy Markdown
Owner

Summary

The main change in this PR is to refactor the initialization of the assistant class such that we are more aligned with the remote state in OpenAI. Instead of locally managing the assistant ID, we now rely on OpenAPI. This should enforce at most a single assistant ID in the user account at any point in time.

Extra commands assistants list and assistants clean were added to help manage the assistants.

Test Plan

Locally ran through multiple scenarios of creating assistants, deleting assistants, and deleting settings to confirm behavior:

  • Assistant created if not existing remotely
  • Extra assistants pruned if > 1 exists remotely (created manually via OpenAI playground)
  • Deleting an active assistant and attempting to chat will automatically create a new one

@jbencina jbencina requested a review from Copilot May 16, 2025 15:43
@jbencina jbencina marked this pull request as ready for review May 16, 2025 15:44
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors assistant initialization to rely on the OpenAI API (removing local assistant ID persistence), adds assistants list and assistants clean CLI commands for remote assistant management, and cleans up related CLI entry points and docstrings.

  • Renamed the settings info command to settings show
  • Introduced the assistants command group with list and clean subcommands
  • Refactored OpenAIClient to unify assistant/thread initialization, remove persisted assistant IDs, and added docstrings across client and handler classes

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/vecsync/cli/settings.py Renamed info to show and updated registration in settings group
src/vecsync/cli/entry.py Registered the new assistants command group
src/vecsync/cli/chat.py Removed the --new-conversation flag and updated function signatures
src/vecsync/cli/assistants.py Added assistants list and assistants clean commands
src/vecsync/chat/clients/openai.py Refactored OpenAIClient, added connect/disconnect, cleaned up assistant persistence, and enriched docstrings
src/vecsync/chat/clients/base.py Introduced Assistant Pydantic model
CHANGELOG.md Documented the new assistant CLI commands and cleanup behavior
Comments suppressed due to low confidence (2)

src/vecsync/cli/assistants.py:9

  • [nitpick] Using list as a function name shadows the built-in list. Consider renaming to list_assistants or explicitly setting @click.command(name='list') to avoid confusion.
def list():

Comment thread src/vecsync/chat/clients/openai.py Outdated
@jbencina jbencina merged commit 6c05bc9 into v0.6.0 May 16, 2025
13 checks passed
@jbencina jbencina deleted the jbencina/assistant branch May 16, 2025 15:52
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