Fix double spaced tweets in Post.ts #1626
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Relates to:
N/A
Risks
Low risk, simply ensures tweets generated follow the prompt guidelines of double spaces (\n\n) for new statements instead of a single space to improve tweet readability.
Background
What does this PR do?
Updates the line break handling in the tweet formatting logic to follow the prompt stating to use double spaces between statements. Currently statements only use a single line break (\n). This enforces the double line breaks for better readability in tweets.
What kind of change is this?
Improvements (misc. changes to existing features)
Why are we doing this? Any context or related work?
This allows agents to tweet better-structured posts that are optimally formatted for readability. Also ensures posting follows the double space guideliens written out into the prompt.
Documentation changes needed?
My changes do not require a change to the project documentation.
Testing
Where should a reviewer start?
The changes are in the generateNewTweet() function and the fixNewLines() helper within post.ts.
Detailed testing steps
Generate a sample tweet using the updated code.
Verify all escaped newlines (\n) in the model's output are replaced with double linebreaks (\n\n).
Screenshots
Before
After
Discord username
suicidal_goofy