Fix: task executes before response, craft parses single word

- Commands now get a quick "On it" / "Got it" acknowledgment
- No AI call before task runs — Doug does the task FIRST
- Craft regex captures single word only ("sticks" not "sticks with")

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
roberts 2026-03-30 13:37:53 -05:00
parent 9c7ae89dd2
commit 09464043bf
2 changed files with 14 additions and 8 deletions

View file

@ -57,7 +57,7 @@ class CommandParser:
] ]
CRAFT_PATTERNS = [ CRAFT_PATTERNS = [
r"(?:craft|make|build|create)\s+(?:a\s+|an\s+|some\s+|me\s+)?(\w+(?:\s+\w+)?)", r"(?:craft|make|build|create)\s+(?:a\s+|an\s+|some\s+|me\s+)?(\w+)",
] ]
MINE_PATTERNS = [ MINE_PATTERNS = [

View file

@ -2,6 +2,8 @@
Main application window - handles screen switching and Doug lifecycle. Main application window - handles screen switching and Doug lifecycle.
""" """
import random
from PySide6.QtWidgets import QMainWindow, QStackedWidget, QMessageBox from PySide6.QtWidgets import QMainWindow, QStackedWidget, QMessageBox
from PySide6.QtCore import QTimer, Signal from PySide6.QtCore import QTimer, Signal
@ -427,16 +429,20 @@ class MainWindow(QMainWindow):
if not task: if not task:
return False return False
# Add task to brain's queue # Add task to brain's queue — task runs first, then Doug responds
self._brain._tasks.add(task) self._brain._tasks.add(task)
log.info(f"Command from {sender}: {cmd.action} → task '{task.name}'") log.info(f"Command from {sender}: {cmd.action} → task '{task.name}'")
# Generate a personality-appropriate acknowledgment via AI # Short acknowledgment ONLY — no AI call, just a quick "on it" type response
ack_prompt = ( # The real response comes after the task completes or fails
f"{sender} asked you to: {message}. " if self._ws_client:
f"You understood and are now doing it. Acknowledge briefly." ack = random.choice([
) "On it.", "Got it.", "Sure.", "Okay.", "Alright.",
self._generate_response("SYSTEM", f"[Command: {cmd.action}] {ack_prompt}") "Yep.", "One sec.", "Working on it.", "Right.",
])
self._ws_client.send_chat(ack)
self.dashboard.log_viewer.append_chat(self._active_doug.name, ack)
return True return True
# ── Brain Chat ── # ── Brain Chat ──