Skip to content

Move vibe inversion into vibe task#90

Merged
QMasterMoo merged 6 commits into
mainfrom
copilot/fix-63
Jun 1, 2025
Merged

Move vibe inversion into vibe task#90
QMasterMoo merged 6 commits into
mainfrom
copilot/fix-63

Conversation

Copilot AI commented May 31, 2025

Copy link
Copy Markdown
Contributor

This PR moves the vibe inversion logic from the context prompt generation phase into the vibe generation phase, making the vibe "pre-inverted" when needed.

Changes Made

Before

  • Vibe was generated normally in get_vibe activity
  • Later, in GenerateContextPromptParams.__post_init__(), a random decision was made to invert the vibe (10% chance)
  • During context prompt generation, if inversion was needed, additional instructions were added to tell the AI to respond with the opposite tone

After

  • get_vibe activity now handles inversion internally with the same 10% probability
  • When inverting, the AI is directly prompted to generate the OPPOSITE vibe from what was detected
  • GenerateContextPromptParams no longer needs the should_invert_vibe field or random logic
  • generate_context_prompt is simplified without inversion handling

Benefits

  • Cleaner architecture: Vibe inversion decision happens earlier in the pipeline where it logically belongs
  • Pre-inverted vibes: The vibe returned is already the final vibe to use, whether normal or inverted
  • Simplified downstream logic: Context prompt generation no longer needs to handle inversion
  • Preserved functionality: Same 10% inversion probability and behavior

Example

# Before: Normal vibe + later inversion instruction
vibe = "cheerful and upbeat"
# Later: "Please intentionally respond with the opposite tone from what was detected."

# After: Pre-inverted vibe when needed  
vibe = "somber and serious"  # Already inverted during generation
# No additional inversion logic needed

Fixes #63.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits May 31, 2025 21:35
Co-authored-by: QMasterMoo <3915399+QMasterMoo@users.noreply.github.com>
Co-authored-by: QMasterMoo <3915399+QMasterMoo@users.noreply.github.com>
Co-authored-by: QMasterMoo <3915399+QMasterMoo@users.noreply.github.com>
Copilot AI changed the title [WIP] move vibe inversion into vibe task Move vibe inversion into vibe task May 31, 2025
Copilot AI requested a review from QMasterMoo May 31, 2025 21:38

@QMasterMoo QMasterMoo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good start, but needs a few things

Comment thread src/friendly_computing_machine/temporal/ai/activity.py Outdated
Comment thread src/friendly_computing_machine/temporal/ai/activity.py Outdated
Comment thread tests/test_vibe_inversion.py Outdated
…able inversion probability, remove tests

Co-authored-by: QMasterMoo <3915399+QMasterMoo@users.noreply.github.com>
Comment on lines +71 to +86
Please figure out the vibe of this prompt and then provide the OPPOSITE vibe:

{prompt}

Please return a one sentence summary of the OPPOSITE vibe from what was detected.
Please be as concise as possible.
Please do not include any other text or formatting. Just the opposite vibe.
""")
else:
vibe_prompt = dedent(f"""
Please figure out the vibe of this prompt:

{prompt}

Please return a one sentence summary of the vibe. Please be as concise as possible.
Please do not include any other text or formatting. Just the vibe.

@QMasterMoo QMasterMoo Jun 1, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please in all these sentences is not necessary. Remove and replace them with more precise language, please

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed all unnecessary "Please" words from the vibe prompt instructions and replaced them with more direct imperative statements for precise language. Commit e126708

Co-authored-by: QMasterMoo <3915399+QMasterMoo@users.noreply.github.com>
@QMasterMoo QMasterMoo marked this pull request as ready for review June 1, 2025 05:12
@QMasterMoo QMasterMoo enabled auto-merge (squash) June 1, 2025 05:12
@QMasterMoo QMasterMoo merged commit eed2c95 into main Jun 1, 2025
@codecov

codecov Bot commented Jun 1, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 37.50000% with 5 lines in your changes missing coverage. Please review.

Project coverage is 36.17%. Comparing base (10de6eb) to head (e126708).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...friendly_computing_machine/temporal/ai/activity.py 28.57% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #90      +/-   ##
==========================================
- Coverage   36.20%   36.17%   -0.04%     
==========================================
  Files          66       66              
  Lines        2563     2560       -3     
  Branches      167      167              
==========================================
- Hits          928      926       -2     
+ Misses       1624     1623       -1     
  Partials       11       11              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

move vibe inversion into vibe task

2 participants