Skip to content

fix: auto-submit prompt template completions - #913

Merged
ankit-thesys merged 2 commits into
thesysdev:mainfrom
zahlekhan:agent/starter-prompt-auto-submit
Aug 4, 2026
Merged

fix: auto-submit prompt template completions#913
ankit-thesys merged 2 commits into
thesysdev:mainfrom
zahlekhan:agent/starter-prompt-auto-submit

Conversation

@zahlekhan

Copy link
Copy Markdown
Contributor

Summary

  • submit a prompt-template completion immediately after composing it with the prefilled prompt stem
  • preserve the initial template-chip prefill behavior so users can still edit or submit the stem manually
  • update the related API and Storybook descriptions to match the new interaction

Root cause

The contextual starter handler appended the selected completion to the controlled composer draft and returned focus to the textarea. It never called the thread's message processor, so users had to press Send manually before generation started.

Impact

Choosing a contextual completion now sends the complete prompt and starts generation in the same click.

Validation

  • pnpm --filter @openuidev/react-ui test (27 tests passed)
  • pnpm --filter @openuidev/react-ui typecheck
  • Prettier check on changed files
  • pnpm --filter @openuidev/react-ui lint:check (0 errors; existing warnings only)
  • Storybook interaction verified: template selection followed by completion selection immediately produced the combined user message and loading state

zahlekhan and others added 2 commits July 31, 2026 16:14
The auto-submit left draft/selectedChip populated; the thread-switch reset
never fires when selectedThreadId stays null (e.g. createThread fails on a
fresh chat), so the welcome could reappear with the stale stem and the
completions layer open. Clear both at submit time like the composer's own
submit path, and cover submitStarterPrompt with unit tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ankit-thesys
ankit-thesys marked this pull request as ready for review August 4, 2026 12:02
@ankit-thesys
ankit-thesys self-requested a review August 4, 2026 12:03

@ankit-thesys ankit-thesys left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, pushed one fix to handle the edge case

@ankit-thesys
ankit-thesys merged commit 12cd89d into thesysdev:main Aug 4, 2026
2 checks passed
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