fix: session isolation and blocking wait for visual companion

- Each session gets unique temp directory (/tmp/brainstorm-{pid}-{timestamp})
- Server outputs screen_dir and screen_file in startup JSON
- stop-server.sh takes screen_dir arg and cleans up session directory
- Document blocking TaskOutput pattern: 10-min timeouts, retry up to 3x,
  then prompt user "let me know when you want to continue"
This commit is contained in:
Jesse Vincent
2026-01-17 17:25:45 -08:00
parent 2a61167b02
commit b98afbd74f
6 changed files with 77 additions and 40 deletions

View File

@@ -1,14 +1,21 @@
#!/bin/bash
# Stop the brainstorm server and clean up
# Usage: stop-server.sh
# Stop the brainstorm server and clean up session directory
# Usage: stop-server.sh <screen_dir>
SCREEN_DIR="$1"
if [[ -z "$SCREEN_DIR" ]]; then
echo '{"error": "Usage: stop-server.sh <screen_dir>"}'
exit 1
fi
SCREEN_DIR="${BRAINSTORM_SCREEN_DIR:-/tmp/brainstorm}"
PID_FILE="${SCREEN_DIR}/.server.pid"
if [[ -f "$PID_FILE" ]]; then
pid=$(cat "$PID_FILE")
kill "$pid" 2>/dev/null
rm -f "$PID_FILE"
# Clean up session directory
rm -rf "$SCREEN_DIR"
echo '{"status": "stopped"}'
else
echo '{"status": "not_running"}'