Skip to content

Save chat prompt to thread before the AI responds - #6751

Open
shatfield4 wants to merge 1 commit into
masterfrom
6718-feat-quality-of-life-improvement---update-save-thread-before-ai-response-provided
Open

shatfield4 wants to merge 1 commit into
masterfrom
6718-feat-quality-of-life-improvement---update-save-thread-before-ai-response-provided

Conversation

@shatfield4

Copy link
Copy Markdown
Collaborator

Pull Request Type

  • ✨ feat (New feature)
  • 🐛 fix (Bug fix)
  • ♻️ refactor (Code refactoring without changing behavior)
  • 💄 style (UI style changes)
  • 🔨 chore (Build, CI, maintenance)
  • 📝 docs (Documentation updates)

Relevant Issues

resolves #6718

Description

  • save the user's prompt to the thread before the LLM is called so it is kept if the response fails or the user leaves mid-generation
  • applies to both regular workspace chats and agent chats
  • unanswered prompts stay visible in the thread and can be re-sent with edit + submit
  • unanswered prompts are left out of the history sent to the LLM since some providers reject a blank assistant message

Visuals (if applicable)

Additional Information

  • LLM unreachable → error shown, prompt still in thread after reload
  • invalid model (API error) → prompt still in thread after reload (lost on master)
  • reload before the first token → prompt still in thread after reload
  • reload mid-stream → prompt + partial response saved
  • follow-up chat after a failed prompt works and the chat row is updated in place (no duplicate)
  • edit + submit on a failed prompt replaces it and gets a response

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated (if applicable)
  • I have tested my code functionality
  • Docker build succeeds locally

@timothycarambat

Copy link
Copy Markdown
Member

If you send a prompt successfully in an agent session and then force fail it on the second - does the second submitted prompt save on reload?

This branch has not been deployed

No deployments
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.

[FEAT]: Quality of Life improvement - Update & save Thread before AI response provided

2 participants