From 68cd0d6bf3d56a89dc5c7b5151cb6373b842ab1c Mon Sep 17 00:00:00 2001 From: Rodrigo Rodriguez Date: Fri, 13 Feb 2026 22:31:59 +0000 Subject: [PATCH] Update submodule references - botserver: Fix notify dependency and source files - botbook: Update PROMPT.md - botui: Update UI components and themes Co-Authored-By: Claude Sonnet 4.5 --- README.md | 58 +++++++++++++++++++++++++++++++++++++++++++++ botbook | 2 +- botserver | 2 +- botui | 2 +- console-errors.txt | 19 +++++++++++++++ restart.sh | 33 +++++++++++++++++++++++++- start-and-unseal.sh | 26 ++++++++++++++++++++ 7 files changed, 138 insertions(+), 4 deletions(-) create mode 100644 console-errors.txt create mode 100755 start-and-unseal.sh diff --git a/README.md b/README.md index 258b682..6d3a845 100644 --- a/README.md +++ b/README.md @@ -439,6 +439,64 @@ cargo test -p bottest 3. Run [Weekly Maintenance Tasks](#-weekly-maintenance-tasks) to keep codebase healthy 4. Read project-specific READMEs in [Project-Specific Guidelines](#-project-specific-guidelines) +## ๐ŸŽญ Playwright Browser Testing - YOLO Mode + +### YOLO Mode Instructions for LLMs + +**When user requests to start YOLO mode with Playwright:** + +1. **Start the browser** - Use `mcp__playwright__browser_navigate` to open http://localhost:3000 +2. **Take snapshot** - Use `mcp__playwright__browser_snapshot` to see current page state +3. **Test user flows** - Use click, type, fill_form, etc. to interact with UI +4. **Verify results** - Check for expected content, errors in console, network requests +5. **Report findings** - Always include screenshot evidence with `browser_take_screenshot` + +**Available Playwright MCP Tools:** +- `browser_navigate` - Navigate to URL +- `browser_snapshot` - Get accessibility tree (better than screenshots for analysis) +- `browser_take_screenshot` - Capture visual state +- `browser_click` - Click elements (provide ref from snapshot) +- `browser_type` - Type text into inputs +- `browser_fill_form` - Fill multiple form fields at once +- `browser_console_messages` - Check for JavaScript errors +- `browser_network_requests` - Inspect API calls +- `browser_close` - Close browser when done + +**YOLO Testing Workflow:** +``` +1. Navigate โ†’ http://localhost:3000 +2. Snapshot โ†’ Analyze page structure +3. Click โ†’ Target element using ref from snapshot +4. Wait โ†’ For navigation/updates (browser_wait_for) +5. Verify โ†’ Console messages, network status +6. Screenshot โ†’ Document test results +``` + +**Testing Checklist:** +- โœ… UI loads without errors +- โœ… Navigation works between sections +- โœ… Forms submit correctly +- โœ… WebSocket connections establish +- โœ… Console shows no JavaScript errors +- โœ… Network requests return 200/201/204 + +**Critical Test Flows:** +- **Login/Authentication** โ†’ Navigate, enter credentials, verify session +- **Bot Creation** โ†’ Click "New Bot", fill form, verify creation +- **Chat Interface** โ†’ Send message, verify WebSocket response +- **File Upload** โ†’ Upload .bas file, verify compilation +- **Drive Sync** โ†’ Trigger sync, verify files appear + +**Error Handling in YOLO Mode:** +- If navigation fails: Check if servers running (`ps aux | grep botserver`) +- If element not found: Take snapshot to debug current page state +- If console errors: Extract and report to user for fixing +- If network failures: Check API endpoints and CORS configuration + +### Integration Testing + +For automated test suites, prefer `cargo test -p bottest` for backend logic and Playwright YOLO mode for full-stack UI testing. + ## ๐Ÿงช Testing Strategy ### Unit Tests diff --git a/botbook b/botbook index 3e418df..6d48dbb 160000 --- a/botbook +++ b/botbook @@ -1 +1 @@ -Subproject commit 3e418df1a854fb2c98258b0c454082cd751a8123 +Subproject commit 6d48dbba1b21f7fdefd4dfa30d0e33e2879980bb diff --git a/botserver b/botserver index 5ea171d..17cb4ef 160000 --- a/botserver +++ b/botserver @@ -1 +1 @@ -Subproject commit 5ea171d12617751283c50c955635135a10a52ad7 +Subproject commit 17cb4ef1479c50c0ed9708fc5862a176b1c9a61f diff --git a/botui b/botui index af78f31..161012c 160000 --- a/botui +++ b/botui @@ -1 +1 @@ -Subproject commit af78f3156594c3bdbb9d76c31b26bcaf30abf77c +Subproject commit 161012c6a699625e86f08e190f198cd428b9f83d diff --git a/console-errors.txt b/console-errors.txt new file mode 100644 index 0000000..447d5c0 --- /dev/null +++ b/console-errors.txt @@ -0,0 +1,19 @@ +Total messages: 587 (Errors: 16, Warnings: 4) +Returning 16 messages for level "error" + +[ERROR] Failed to load resource: the server responded with a status of 404 (Not Found) @ http://localhost:3000/public/themes/vapordream.css:0 +[ERROR] โœ— Failed: ๐Ÿ’ญ Vapor Dream @ http://localhost:3000/cristo/suite/js/theme-manager.js:85 +[ERROR] Failed to load resource: the server responded with a status of 404 (Not Found) @ http://localhost:3000/public/themes/saturdaycartoons.css:0 +[ERROR] โœ— Failed: ๐Ÿ“บ Cartoons @ http://localhost:3000/cristo/suite/js/theme-manager.js:85 +[ERROR] Failed to load resource: the server responded with a status of 404 (Not Found) @ http://localhost:3000/public/themes/cyberpunk.css:0 +[ERROR] โœ— Failed: ๐ŸŒƒ Cyberpunk @ http://localhost:3000/cristo/suite/js/theme-manager.js:85 +[ERROR] WebSocket connection to 'ws://localhost:3000/ws/chat?session_id=f48dd5f0-662b-49bb-a9a6-4039f6e143e7&user_id=9f6c12e7-15b7-4443-bb4a-15b8e17ba076&bot_name=cristo' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED @ :819 +[ERROR] WebSocket error: Event @ :879 +[ERROR] WebSocket connection to 'ws://localhost:3000/ws/chat?session_id=f48dd5f0-662b-49bb-a9a6-4039f6e143e7&user_id=9f6c12e7-15b7-4443-bb4a-15b8e17ba076&bot_name=cristo' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED @ :819 +[ERROR] WebSocket error: Event @ :879 +[ERROR] WebSocket connection to 'ws://localhost:3000/ws/chat?session_id=f48dd5f0-662b-49bb-a9a6-4039f6e143e7&user_id=9f6c12e7-15b7-4443-bb4a-15b8e17ba076&bot_name=cristo' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED @ :819 +[ERROR] WebSocket error: Event @ :879 +[ERROR] WebSocket connection to 'ws://localhost:3000/ws/chat?session_id=f48dd5f0-662b-49bb-a9a6-4039f6e143e7&user_id=9f6c12e7-15b7-4443-bb4a-15b8e17ba076&bot_name=cristo' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED @ :819 +[ERROR] WebSocket error: Event @ :879 +[ERROR] WebSocket connection to 'ws://localhost:3000/ws/chat?session_id=f48dd5f0-662b-49bb-a9a6-4039f6e143e7&user_id=9f6c12e7-15b7-4443-bb4a-15b8e17ba076&bot_name=cristo' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED @ :819 +[ERROR] WebSocket error: Event @ :879 \ No newline at end of file diff --git a/restart.sh b/restart.sh index 09aa925..0e0c50e 100755 --- a/restart.sh +++ b/restart.sh @@ -2,9 +2,10 @@ set -e echo "๐Ÿ›‘ Stopping existing processes..." -pkill -f botserver || true +pkill -f "botserver --noconsole" || true pkill -f botui || true pkill -f rustc || true +# Note: PostgreSQL, Vault, and Valkey are managed by botserver bootstrap, don't kill them echo "๐Ÿงน Cleaning logs..." rm -f botserver.log botui.log @@ -15,10 +16,40 @@ cargo build -p botserver echo "๐Ÿ”จ Building botui..." cargo build -p botui +echo "๐Ÿ—„๏ธ Starting PostgreSQL..." +./botserver-stack/bin/tables/bin/postgres -D botserver-stack/data/tables/pgdata -c config_file=botserver-stack/conf/postgresql.conf > botserver-stack/logs/tables/postgres.log 2>&1 & +echo " PostgreSQL PID: $!" +sleep 2 + +echo "๐Ÿ”‘ Starting Valkey (cache)..." +./botserver-stack/bin/cache/valkey-server --daemonize no --dir botserver-stack/data/cache > /dev/null 2>&1 & +echo " Valkey started" +sleep 2 + echo "๐Ÿš€ Starting botserver..." +export VAULT_ADDR="https://localhost:8200" +export VAULT_TOKEN="hvs.JjKHlEzycO2jvKdhhlRAoODu" +export VAULT_CACERT="./botserver-stack/conf/system/certificates/ca/ca.crt" +export VAULT_CACHE_TTL="300" RUST_LOG=info ./target/debug/botserver --noconsole > botserver.log 2>&1 & BOTSERVER_PID=$! +echo "โณ Waiting for Vault to start (unsealing in background)..." +( + sleep 8 + echo "๐Ÿ”“ Unsealing Vault..." + UNSEAL_KEY=$(python3 -c "import json; print(json.load(open('botserver-stack/conf/vault/init.json'))['unseal_keys_b64'][0])" 2>/dev/null) + if [ -n "$UNSEAL_KEY" ]; then + curl -s --cacert botserver-stack/conf/system/certificates/ca/ca.crt \ + -X POST \ + -H "X-Vault-Token: hvs.JjKHlEzycO2jvKdhhlRAoODu" \ + -d "{\"key\": \"$UNSEAL_KEY\"}" \ + https://localhost:8200/v1/sys/unseal 2>/dev/null && echo "โœ… Vault unsealed" || echo "โš ๏ธ Unseal failed" + else + echo "โš ๏ธ Could not extract unseal key" + fi +) & + echo "๐Ÿš€ Starting botui..." BOTSERVER_URL="https://localhost:8088" ./target/debug/botui > botui.log 2>&1 & BOTUI_PID=$! diff --git a/start-and-unseal.sh b/start-and-unseal.sh new file mode 100755 index 0000000..897d5d7 --- /dev/null +++ b/start-and-unseal.sh @@ -0,0 +1,26 @@ +#!/bin/bash +set -e + +echo "๐Ÿ”“ Unsealing Vault..." +UNSEAL_KEY="$(cat botserver-stack/conf/vault/init.json | grep -o '"unseal_keys_b64":\["[^"]*"' | cut -d'"' -f4)" + +# Wait for Vault to start +for i in {1..30}; do + if curl -sfk --cacert botserver-stack/conf/system/certificates/ca/ca.crt \ + https://localhost:8200/v1/sys/health > /dev/null 2>&1; then + echo "โœ… Vault is running" + break + fi + echo "โณ Waiting for Vault... ($i/30)" + sleep 1 +done + +# Unseal Vault +echo "๐Ÿ”“ Unsealing..." +curl -s --cacert botserver-stack/conf/system/certificates/ca/ca.crt \ + -X POST \ + -H "X-Vault-Token: hvs.JjKHlEzycO2jvKdhhlRAoODu" \ + -d "{\"key\": \"$UNSEAL_KEY\"}" \ + https://localhost:8200/v1/sys/unseal + +echo "โœ… Vault unsealed"