Fix: Make magic wand prompt more forceful to prevent direct title injection

The magic wand feature now uses emphatic language to ensure AI assistants
use the 'vt title' command instead of injecting terminal escape sequences.
This prevents Claude from being "too smart" and bypassing our title filtering.

Fixes #248
This commit is contained in:
Peter Steinberger 2025-07-07 00:52:18 +01:00
parent 85d9f3d17a
commit 56db25efe2

View file

@ -28,7 +28,8 @@ export function isAIAssistantSession(session: Session): boolean {
* Send a prompt to an AI assistant session to update terminal title
*/
export async function sendAIPrompt(sessionId: string, authClient: AuthClient): Promise<void> {
const prompt = "use vt title to update the terminal title with what you're currently working on";
const prompt =
'IMPORTANT: You MUST use the \'vt title\' command to update the terminal title. DO NOT use terminal escape sequences. Run: vt title "Brief description of current task"';
const response = await fetch(`/api/sessions/${sessionId}/input`, {
method: 'POST',
headers: {