Skip to content

Conversation

@uinstinct
Copy link
Contributor

@uinstinct uinstinct commented Sep 23, 2025

Description

Show the warning for dangerous commands in the cli only once per session.

resolves CON-4021

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-general-review or @continue-detailed-review

Checklist

  • [] I've read the contributing guide
  • [] The relevant docs, if any, have been updated or created
  • [] The relevant tests, if any, have been updated or created

Screen recording or screenshot

[ When applicable, please include a short screen recording or screenshot - this makes it much easier for us as contributors to review and understand your changes. See this PR as a good example. ]

Tests

[ What tests were added or updated to ensure the changes work as expected? ]


Summary by cubic

Show the dangerous command warning only once per CLI session to reduce noise while keeping blocking behavior unchanged. Aligns with CON-4021.

  • New Features
    • Gate the dynamic-evaluation warning behind an in-process flag (set on first display) so subsequent prompts skip it; blocking remains unchanged.

@uinstinct uinstinct requested a review from a team as a code owner September 23, 2025 13:54
@uinstinct uinstinct requested review from tingwai and removed request for a team September 23, 2025 13:54
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Sep 23, 2025
Copy link
Collaborator

@RomneyDa RomneyDa left a comment

Choose a reason for hiding this comment

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

@uinstinct could you show a video of this in action? I'm wondering if it wouldn't just immediately hide the warning on any other prop updating

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs Sep 23, 2025
@uinstinct
Copy link
Contributor Author

That was a very good catch! Yes the warning disappeared on prop change - used state to persist.

feat.mp4

@uinstinct uinstinct requested a review from RomneyDa September 24, 2025 13:33
RomneyDa
RomneyDa previously approved these changes Sep 25, 2025
Copy link
Collaborator

@RomneyDa RomneyDa left a comment

Choose a reason for hiding this comment

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

Approved, idea for simplification:

  const [initialHasShownDangerousCommand] = useState(hasShownDangerousCommandWarning);
  hasShownDangerousCommandWarning = false
  const showDynamicWarning =
    hasDynamicEvaluation && !initialHasShownDangerousCommand;

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 25, 2025
@chezsmithy
Copy link
Contributor

It would be nice to have something like this in the vscode and IntelliJ extensions as well.

@RomneyDa
Copy link
Collaborator

RomneyDa commented Sep 25, 2025

@chezsmithy agree the dangerous warning in the extensions is pretty noisy. I think the difference is that this message in CLI is talking about commands that are auto-blocked e.g. rm -rf / with no approval step, while in the extension it's the warning for commands at approval time (auto block just causes tool to error)

I'll open a PR that makes that message less noisy for starters

@RomneyDa
Copy link
Collaborator

#7987

@RomneyDa RomneyDa merged commit 2a4fbac into continuedev:main Sep 26, 2025
55 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Issues and PRs Sep 26, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Sep 26, 2025
@uinstinct uinstinct deleted the cli-danger-command branch September 26, 2025 02:25
@sestinj
Copy link
Contributor

sestinj commented Sep 26, 2025

🎉 This PR is included in version 1.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@sestinj
Copy link
Contributor

sestinj commented Sep 26, 2025

🎉 This PR is included in version 1.22.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@sestinj
Copy link
Contributor

sestinj commented Oct 1, 2025

🎉 This PR is included in version 1.21.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

lgtm This PR has been approved by a maintainer released size:S This PR changes 10-29 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants