Skip to content

feat: remove random prompts #765

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 4, 2025
Merged

feat: remove random prompts #765

merged 2 commits into from
Jun 4, 2025

Conversation

junhyr
Copy link
Collaborator

@junhyr junhyr commented Jun 4, 2025

PR Type

Enhancement


Description

  • Disable random prompt injection logic

  • Remove random prompt code and trackers

  • Rename and silence unused prompt constants

  • Add WebSocket message type debug log


Changes walkthrough 📝

Relevant files
Enhancement
usePromptQueue.ts
Add WebSocket message type logging                                             

apps/app/app/hooks/usePromptQueue.ts

  • Inserted debug log for incoming message types
  • Logs "MT" followed by message.type value
  • +1/-0     
    prompt_manager.rs
    Remove random prompt injection logic                                         

    apps/api/src/services/prompt_manager.rs

  • Renamed RANDOM_PROMPTS to _RANDOM_PROMPTS
  • Removed random prompt scheduling and related trackers
  • Deleted check_and_add_random_prompt_if_needed function
  • Cleaned up unused last_prompt_activity map
  • +2/-61   

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • Copy link

    vercel bot commented Jun 4, 2025

    The latest updates on your projects. Learn more about Vercel for Git ↗︎

    Name Status Preview Comments Updated (UTC)
    pipelines-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 10:23am

    Copy link

    github-actions bot commented Jun 4, 2025

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Debug logging

    The new console.log for message type may clutter production logs; use a configurable log level or conditional debug logging instead.

    console.log("MT", message.type);
    Unused constant

    The _RANDOM_PROMPTS constant is declared but never used; consider removing it to clean up dead code.

    const _RANDOM_PROMPTS: &[&str] = &[
        "hyperrealistic portrait of an alien queen --quality 3",
        "fantasy castle floating among clouds at sunset --creativity 0.8",
        "cybernetic ((animal)) with glowing parts --quality 2",
        "dreamlike surreal landscape with impossible physics --creativity 0.9",
    Unused import

    The import of WsMessage is not referenced in this file and can be removed to avoid unused code.

    use crate::models::WsMessage;

    Copy link

    github-actions bot commented Jun 4, 2025

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    General
    Remove stray debug log

    Remove this stray debug statement to prevent extraneous logs in production. If you
    need this for debugging, guard it with an environment check or a debug flag.

    apps/app/app/hooks/usePromptQueue.ts [89]

    -console.log("MT", message.type);
    +// (debug log removed)
    Suggestion importance[1-10]: 5

    __

    Why: The stray console.log("MT", message.type) adds unnecessary production noise and should be removed or gated behind a debug flag for cleaner logs.

    Low
    Remove unused constant

    Eliminate this unused constant now that random prompts are fully removed to clean up
    dead code and reduce maintenance overhead.

    apps/api/src/services/prompt_manager.rs [11-16]

    -const _RANDOM_PROMPTS: &[&str] = &[
    -    "hyperrealistic portrait of an alien queen --quality 3",
    -    "fantasy castle floating among clouds at sunset --creativity 0.8",
    -    "cybernetic ((animal)) with glowing parts --quality 2",
    -    "dreamlike surreal landscape with impossible physics --creativity 0.9",
    -];
    +// (unused constant removed)
    Suggestion importance[1-10]: 5

    __

    Why: The _RANDOM_PROMPTS constant is no longer referenced after removing the random prompt logic and should be deleted to eliminate dead code.

    Low

    @junhyr junhyr merged commit 161b195 into main Jun 4, 2025
    5 of 6 checks passed
    @junhyr junhyr deleted the jun/fix-queue branch June 4, 2025 10:50
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    1 participant