Skip to content
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

WIP feat: update default assistant name to [Deleted Assistant] #430

Conversation

ryanhopperlowe
Copy link
Contributor

@ryanhopperlowe ryanhopperlowe commented Sep 4, 2024

Upon deleting an assistant, any left over chats with that assistant will be displayed in a read only state.

#90

While making this change, I discovered a bug where switching threads causes the websocket server to restart, but does not wait for the server to come back up before relaying new messages. It wasn't apparent until I started making my changes and should not cause any issues after this PR.

@thedadams
Copy link
Contributor

This change is not self-explanatory. I don't understand how changing this constant addresses the issue you linked.

Copy link
Contributor

@cjellick cjellick left a comment

Choose a reason for hiding this comment

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

This PR is not right. It is just renaming Tildy to [Delete Assistant], even for new threads (as depicted in my screenshot). This doesn't address the original bug at all and would introduce a new regression.

Screenshot 2024-09-04 at 4 20 13 PM

@ryanhopperlowe
Copy link
Contributor Author

ryanhopperlowe commented Sep 5, 2024

This PR is not right. It is just renaming Tildy to [Delete Assistant], even for new threads (as depicted in my screenshot). This doesn't address the original bug at all and would introduce a new regression.

My mistake. It appeared as though the code only used this variable when there was no script available for a given thread, so I didn't check the create/edit workflow. Will fix today

Copy link
Contributor

@tylerslaton tylerslaton left a comment

Choose a reason for hiding this comment

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

Removing approval until follow-ups come through.

@ryanhopperlowe ryanhopperlowe force-pushed the 90-handle-left-over-threads-from-deleted-assistants-better branch from 1ecd47b to 9ca8bd5 Compare September 6, 2024 00:03
Copy link
Contributor

@thedadams thedadams left a comment

Choose a reason for hiding this comment

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

This change does not work as I expect.

In this screen recording, the assistant associated to the "Casual Greeting" thread has been deleted. However, there is no indication of this other than the fact that there are no messages.

Screen.Recording.2024-09-06.at.09.45.24.mov

EDIT: This seems to have been an issue with my environment. My apologies for the false alarm.

contexts/chat.tsx Outdated Show resolved Hide resolved
thedadams
thedadams previously approved these changes Sep 6, 2024
StrongMonkey
StrongMonkey previously approved these changes Sep 6, 2024
Copy link
Contributor

@StrongMonkey StrongMonkey left a comment

Choose a reason for hiding this comment

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

Looks like you have found a way to re-run the thread even when script is not found. As long as it doesn't have side effect on server side, LGTM

@ryanhopperlowe ryanhopperlowe force-pushed the 90-handle-left-over-threads-from-deleted-assistants-better branch from 6108d09 to af6c9b5 Compare September 9, 2024 14:38
thedadams
thedadams previously approved these changes Sep 9, 2024
contexts/chat.tsx Outdated Show resolved Hide resolved
@ryanhopperlowe ryanhopperlowe force-pushed the 90-handle-left-over-threads-from-deleted-assistants-better branch from 7fbb2d1 to af6c9b5 Compare September 9, 2024 16:22
setThread(id);
setScriptContent((await getScript(scriptId))?.script || []);
setScriptId(scriptId);
setForceRun(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you shouldn't need to setsetForceRun, setting Thread and ShouldRestart should be sufficient. I see a double refreshing issue when switch to thread, like the thread reloads twices on screen.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So I thought the same thing and removed it in a previous commit, but actually had to revert that change, because it caused the issue where it just reused the chat from the previous thread

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can try removing the shouldRestart, but I'm not sure if that will work

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok I fixed this by removing setShouldRestart and keeping setForceRun the reason I opted for this is because it doesn't look like setShouldRestart consistently triggers the run event (which updates the messages). It would probably be more ideal to get shouldRestart to update the messages, but in the interest of time spent on this issue I opted to use the tool already available

StrongMonkey
StrongMonkey previously approved these changes Sep 9, 2024
thedadams
thedadams previously approved these changes Sep 9, 2024
Copy link
Contributor

@tylerslaton tylerslaton left a comment

Choose a reason for hiding this comment

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

I tested this locally and noticed some weird behavior that seemed unrelated to your PR.

Switching between a thread and then sending a message causes me to be in a weird state forever. Are you seeing the same thing @ryanhopperlowe?

Screen.Recording.2024-09-09.at.2.51.58.PM.mov

@thedadams
Copy link
Contributor

Related to Tyler's comment and screencast, it seems like there is an issue here.
Screenshot 2024-09-09 at 15 33 18

This only happens when switching to a "Tildy" chat. It doesn't have to be from a thread with a deleted assistant. I confirmed that this is not happening on main.

Additionally, switching to a thread with a custom assistant seems to break chat.

Copy link
Contributor

@thedadams thedadams left a comment

Choose a reason for hiding this comment

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

It looks like there are some issues when testing this locally.

@ryanhopperlowe ryanhopperlowe force-pushed the 90-handle-left-over-threads-from-deleted-assistants-better branch from 19da86c to fc32008 Compare September 9, 2024 22:42
@ryanhopperlowe ryanhopperlowe marked this pull request as draft September 10, 2024 13:26
@ryanhopperlowe ryanhopperlowe changed the title feat: update default assistant name to [Deleted Assistant] WIP feat: update default assistant name to [Deleted Assistant] Sep 10, 2024
@ryanhopperlowe
Copy link
Contributor Author

@StrongMonkey and I noticed that there is an issue with my most recent update that causes a double refresh when switching threads. Switching to WIP while I figure out how to prevent this

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.

5 participants