From 582edb035037f8d602b7044eb5a2809ef3ab6a0c Mon Sep 17 00:00:00 2001 From: "devin-ai-integration[bot]" <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Mon, 13 Apr 2026 03:07:22 +0000 Subject: [PATCH] Update Jada Nextcloud testing skill with cache busting and icon verification Co-authored-by: garzasecure@pm.me --- .../skills/testing-jada-nextcloud/SKILL.md | 76 +++++++++++++++++-- 1 file changed, 68 insertions(+), 8 deletions(-) diff --git a/.agents/skills/testing-jada-nextcloud/SKILL.md b/.agents/skills/testing-jada-nextcloud/SKILL.md index 923c6c7..c88bf73 100644 --- a/.agents/skills/testing-jada-nextcloud/SKILL.md +++ b/.agents/skills/testing-jada-nextcloud/SKILL.md @@ -5,7 +5,7 @@ Guide for E2E testing the Jada AI native Nextcloud app on the live deployment. ## Devin Secrets Needed - `NEXTCLOUD_APP_PASSWORD` — Nextcloud admin app password for API auth -- SSH key file at `~/attachments/.../id_rsa` — provided per-session by user for server access to 83.228.213.100 +- SSH key at `~/.ssh/nc_rsa` — for server access to 83.228.213.100 (user: `ubuntu`, passwordless sudo) ## Infrastructure @@ -16,6 +16,7 @@ Guide for E2E testing the Jada AI native Nextcloud app on the live deployment. | External Hermes API | https://jada-api.garzaos.online | On 187.77.25.131 — may have STALE config; the Nextcloud app uses the LOCAL backend | | Telegram bot | Container `jada-telegram-bot` on 83.228.213.100 | Token changes frequently — check with user | | Conversations on disk | `/data/conversations.json` inside `hermes-backend` container | File-based persistence with 2s debounce | +| Nextcloud container | `nextcloud-aio-nextcloud` on 83.228.213.100 | PHP app at `/var/www/html/custom_apps/jadaagent/` | ## Key API Endpoints @@ -75,16 +76,71 @@ print(f'Double-prefix: {len(double)} {\"NONE\" if not double else double}') - New conversations should have format `admin:conv-{timestamp}` (single prefix) - Legacy conversations with `admin:admin:conv-...` are pre-fix artifacts -### 4. Tool Call Display -- After sending a message that triggers a tool call -- Right panel "Recent Tool Calls" should show the tool name with a checkmark -- The chat area should show inline tool call visualization +### 4. Tool Call Display & Icon Verification +- After sending a message that triggers tool calls (mix of success/error recommended) +- **Right panel**: "Recent Tool Calls" should show tool names with ✅ (success) or ❌ (error) +- **Chat body**: Inline tool call icons should match the right panel exactly +- Use "List my cookbook recipes and news feeds" as a good test — triggers ~12 tools with a mix of success (files/calendar) and error (cookbook 404, news 404) +- **Pass**: ❌ for failed tools, ✅ for successful tools in BOTH views, zero 🔧 in finalized messages +- **Fail**: 🔧 (wrench) icons remain after response completes, or icons don't match between views + +### 5. Streaming Icon Transitions +- Start a new chat and send a message that triggers tools +- During streaming: tool icons should show 🔧 (wrench) with spinning animation +- After each tool completes: icon should transition to ✅ or ❌ immediately +- After full response completes: zero 🔧 icons should remain + +### 6. JS Cache Verification +Nextcloud caches JS bundles using a `?v=` parameter derived from the app version in `appinfo/info.xml`. +```javascript +// Run in browser console to check which JS version is loaded +var s = document.querySelectorAll('script[src*="jadaagent-main"]')[0]; +console.log('Script URL:', s.src); +console.log('Version param:', s.src.match(/\?v=([^&]+)/)?.[1]); +``` +- If the `?v=` hash hasn't changed after deploying new code, the browser is serving old cached JS +- **Fix**: Bump `` in `appinfo/info.xml`, then run `occ upgrade` inside the Nextcloud container + +## Deploying Code Changes + +### Frontend (Vue/JS) +```bash +# Build locally +cd /home/ubuntu/repos/jada-agent && npm run build + +# Copy to remote +scp -i ~/.ssh/nc_rsa js/jadaagent-main.js ubuntu@83.228.213.100:/tmp/ + +# Deploy into Nextcloud container +ssh -i ~/.ssh/nc_rsa ubuntu@83.228.213.100 \ + "sudo docker cp /tmp/jadaagent-main.js nextcloud-aio-nextcloud:/var/www/html/custom_apps/jadaagent/js/" +``` + +### Cache busting after frontend deploy +```bash +# If the JS ?v= hash didn't change, bump the version in info.xml: +# Edit appinfo/info.xml → increment +# Then: +scp -i ~/.ssh/nc_rsa appinfo/info.xml ubuntu@83.228.213.100:/tmp/ +ssh -i ~/.ssh/nc_rsa ubuntu@83.228.213.100 \ + "sudo docker cp /tmp/info.xml nextcloud-aio-nextcloud:/var/www/html/custom_apps/jadaagent/appinfo/ && \ + sudo docker exec -u www-data nextcloud-aio-nextcloud php occ upgrade" +``` + +### Backend (Hermes) +```bash +scp -i ~/.ssh/nc_rsa backend/server.mjs backend/agent-loop.mjs ubuntu@83.228.213.100:/tmp/ +ssh -i ~/.ssh/nc_rsa ubuntu@83.228.213.100 \ + "sudo docker cp /tmp/server.mjs hermes-backend:/app/ && \ + sudo docker cp /tmp/agent-loop.mjs hermes-backend:/app/ && \ + sudo docker restart hermes-backend" +``` ## Common Pitfalls -1. **SSH access to 83.228.213.100** — Only accepts SSH key auth (no password). The key is provided per-session as an attachment. Run `chmod 600` on it before use. The key may stop working mid-session. +1. **SSH access to 83.228.213.100** — Use `ssh -i ~/.ssh/nc_rsa ubuntu@83.228.213.100` (not root). Passwordless sudo available. The key may also be at `~/attachments/.../id_rsa` if provided as session attachment. -2. **Brief "Hello, User" / "0 servers" flash on page load** — When navigating to the app, the UI briefly shows defaults before the health check completes (~3-5 seconds). This is a known minor UX issue, not a functional bug. +2. **Brief "Hello, User" / "0 servers" flash on page load** — The UI briefly shows defaults before the health check completes (~3-5 seconds). This is a known minor UX issue, not a functional bug. 3. **External vs Local Hermes** — The Nextcloud app uses the LOCAL Hermes on 83.228.213.100, NOT the external one at jada-api.garzaos.online. The external API may have stale/different config. @@ -92,4 +148,8 @@ print(f'Double-prefix: {len(double)} {\"NONE\" if not double else double}') 5. **Telegram bot token changes** — The bot token gets revoked/regenerated periodically. Always verify with the user if you see 401 errors from the Telegram bot container. -6. **Deploying code changes** — Use `docker cp` to copy files into containers, then `docker restart` the container. For PHP changes, copy to `/var/www/html/custom_apps/jadaagent/` inside the Nextcloud container. For backend changes, copy to `/app/` inside `hermes-backend` container. +6. **Nextcloud JS caching** — Nextcloud appends `?v=` to JS URLs based on the app version in `appinfo/info.xml`. If you deploy new JS but don't bump the version, browsers will serve the old cached bundle indefinitely. Always bump `` and run `occ upgrade` after frontend changes. + +7. **HTML entities vs Unicode escapes in Vue templates** — Inline HTML entity ternaries (e.g., `❌`) can get corrupted during Vite minification. The app uses a `toolIcon()` method with JS Unicode escapes (`\u274c`, `\u2705`, `\ud83d\udd27`) instead — this is more reliable. If icons appear wrong, check the minified JS to see if entities were corrupted. + +8. **Tool icon rendering paths** — The chat body has TWO template blocks for tool icons: finalized messages (line ~34) and streaming messages (line ~56). Both use `{{ toolIcon(tc.status) }}`. If icons are wrong in one view but not the other, check both template blocks.