Skip to content

Conversation

@joshistoast
Copy link
Contributor

@joshistoast joshistoast commented Dec 18, 2025

Summary

Fixed a case where selecting and adjusting b and c in the prompt (a b)+ c would result in a mangled output, it now correctly adjusts to ((a b)+ c)[attention] instead of (a (b)[attention].

Added tests to ensure any changes follow desired behavior.

Related Issues / Discussions

Automatic Prompt Weighting Behavior Discussion

QA Instructions

Merge Plan

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • ❗Changes to a redux slice have a corresponding migration
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

@github-actions github-actions bot added the frontend PRs that change frontend files label Dec 18, 2025
@joshistoast joshistoast changed the title fix(prompts): 🐛 prompt attention elevation edge case, add tests fix(prompts): 🐛 prompt attention behaviors, add tests Dec 18, 2025
@joshistoast joshistoast marked this pull request as draft December 21, 2025 00:00
@lstein
Copy link
Collaborator

lstein commented Dec 22, 2025

The PR is still marked draft. Is it ready for review?

@lstein
Copy link
Collaborator

lstein commented Dec 22, 2025

The use case described in the description is working properly. However, I found a case that does not do what I'd expect:

  1. Original prompt: pre (a b c)+ d post
  2. Select two or more words within the parentheses: pre (a b c)+ d post
  3. Hit the upweight key, get: pre (a b c)++ d post. I expected: pre (a (b c)+)+ d post

Maybe the desired behavior is that any up/down-weighting action within a parentheses expands to the entire contents of the parentheses, but then there is a UI inconsistency, because if I select a single word within the parentheses, or even just have the insertion point adjacent to a word, then that single word is weighted:

  1. Original prompt: pre (a b c)+ d post
  2. Select one word within the parentheses: pre (a b c)+ d post
  3. Hit the upweight key, get: pre (a b+ c)+ d post, which is what I expect

Copy link
Collaborator

@lstein lstein left a comment

Choose a reason for hiding this comment

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

I suggest making the weighting behavior when a phrase is selected consistent with the behavior when a single word is selected.

@joshistoast joshistoast marked this pull request as ready for review December 24, 2025 07:58
@joshistoast joshistoast requested a review from lstein December 24, 2025 07:58
Copy link
Collaborator

@lstein lstein left a comment

Choose a reason for hiding this comment

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

I've tried multiple scenarios, including changing weighting after selecting across heavily nested parentheses, and could not break it. Nice work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend PRs that change frontend files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants