You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On fresh clone @ 0b62e7d, loading any dashboard-style PraisonAIUI app in Chromium or Edge throws a console error during buildDashboard():
NotFoundError: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.
The dashboard plugin fails to initialize. Downstream initializers — including initCommandPalette() (Ctrl+K) and view modules that depend on a fully built shell — never run. Browser chat UI (#chat-input) does not mount even though REST chat APIs work.
Business impact
Operators cannot use keyboard-first navigation (Ctrl+K) on the primary dashboard ops plane.
Browser-based chat validation and demos fail despite working backend APIs.
[AIUI] Failed to load plugin "dashboard": NotFoundError: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.
at buildDashboard (http://127.0.0.1:8082/plugins/dashboard.js?v=1782452566208:1308:41)
at async Object.init (http://127.0.0.1:8082/plugins/dashboard.js?v=1782452566208:1233:3)
at async loadPlugin (http://127.0.0.1:8082/plugins/plugin-loader.js?v=1782451154:39:9)
at async Promise.allSettled (index 1)
at async HTMLDocument.main (http://127.0.0.1:8082/plugins/plugin-loader.js?v=1782451154:116:7)
Same error on :8083 (LLM browser pass, console capture from Playwright).
main is not yet a child of root when insertBefore(shellHeader, main) executes — invalid per DOM spec.
Playwright / browser E2E
Test
Result
ctrl_k_palette
❌ FAIL — .db-cmdk-overlay not visible
browser:chat_input
❌ FAIL — no textarea
browser:load
✅ PASS
browser:session_refresh
✅ PASS (page reloads without crash)
window.aiui.openSessionSearch()
✅ PASS (API exposed before plugin failure path)
Playwright command output (2026-06-26)
[FAIL] chromium:ctrl_k_palette - palette not found after Ctrl+K and JS fallback
[PARTIAL] chromium:chat_input - chat page without input
[FAIL] browser:chat_input - no textarea found
Browser console (exact capture from Playwright, Chromium @ :8082)
[AIUI] Failed to load plugin "dashboard": NotFoundError: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.
at buildDashboard (http://127.0.0.1:8082/plugins/dashboard.js?v=1782452566208:1308:41)
at async Object.init (http://127.0.0.1:8082/plugins/dashboard.js?v=1782452566208:1233:3)
at async loadPlugin (http://127.0.0.1:8082/plugins/plugin-loader.js?v=1782451154:39:9)
at async Promise.allSettled (index 1)
at async HTMLDocument.main (http://127.0.0.1:8082/plugins/plugin-loader.js?v=1782451154:116:7)
(Same message repeated on each page reload during the E2E run.)
HTTP / API (unaffected)
REST chat APIs work independently (POST /api/chat/send → 200). This is a frontend-only initialization failure.
WebSocket
Not applicable to this bug (API streaming verified separately).
False negative on competitive gap closure (#103); E2E flakes
Business
Dashboard-style ops UX degraded vs OpenClaw/Hermes
Regression
Feature code present but unreachable — worse than missing feature
Performance
None (fail-fast on load)
Security
None direct
Accessibility
Keyboard navigation (Ctrl+K) broken
Compatibility
Reproduced Chromium + Edge on Windows; likely all engines
Root Cause Analysis
Architectural cause
buildDashboard() constructs the shell DOM in an order that violates the DOM insertBefore(newNode, referenceNode) contract: referenceNode must already be a child of the parent (root).
When renderSlot('shell:header', shellHeader) injects children, the code attempts to insert the header beforemain, but main is only appended on the next line.
sequenceDiagram
participant PL as plugin-loader
participant DB as dashboard.js
participant DOM as document #db-root
participant CP as initCommandPalette
PL->>DB: init()
DB->>DB: buildDashboard()
DB->>DOM: appendChild(sidebar)
DB->>DB: renderSlot(shell:header) → children added
DB->>DOM: insertBefore(shellHeader, main)
Note over DOM: main NOT child of root yet
DOM-->>DB: NotFoundError
DB-->>PL: throw
PL->>PL: log plugin failed
Note over CP: never called
Loading
Expected / corrected architecture
flowchart TD
BUILD[buildDashboard] --> A[appendChild main to root FIRST]
A --> B{shell:header has children?}
B -->|yes| C[insertBefore shellHeader before main]
B -->|no| D[skip header insert]
C --> E[initCommandPalette]
D --> E
E --> F[selectPage + view modules]
F --> G[chat.js mounts #chat-input]
Captured 2026-06-26 @ commit 0b62e7d. Source: Playwright run_browser_e2e.py / run_llm_browser_e2e.py stdout and console_errors in browser-e2e/artifacts/e2e-results.json.
Confidence: 100%
Suggested Fix
Primary fix (DOM ordering)
// Append main first so it is a valid reference noderoot.appendChild(main);constshellHeader=document.createElement('div');shellHeader.id='db-shell-header-slot';renderSlot('shell:header',shellHeader);if(shellHeader.children.length){root.insertBefore(shellHeader,main);}
Alternative: insert header before sidebar or use main.prepend() pattern — choose one consistent shell layout contract.
Dashboard
buildDashboard()throwsinsertBeforeNotFoundError — plugin init aborts, Ctrl+K and browser chat blockedSummary
Problem statement
On fresh clone @
0b62e7d, loading any dashboard-style PraisonAIUI app in Chromium or Edge throws a console error duringbuildDashboard():The dashboard plugin fails to initialize. Downstream initializers — including
initCommandPalette()(Ctrl+K) and view modules that depend on a fully built shell — never run. Browser chat UI (#chat-input) does not mount even though REST chat APIs work.Business impact
Technical impact
plugin-loader.jsreports[AIUI] Failed to load plugin "dashboard".ctrl_k_palettefails;browser:chat_inputfails on LLM pass.User impact
.db-cmdk-overlay).Regression impact
dashboard.js(initCommandPalette) but never executes whenshell:headerslot has content.Repository Information
0b62e7dcec89767a49a5495ae6522b302c0fd232main(latest at validation time)0.3.124:8082(15-dashboard-test) and Gateway:8083(18-full-chat)Preconditions
http://127.0.0.1:8082.shell:headerslot renders at least one child (default template populates header content in built dashboard).Reproduction Steps
http://127.0.0.1:8082/in Chrome or Edge.networkidle(~2–5 s).dashboard.js:1308.#chat-inputtextarea in DOM (document.querySelector('#chat-input')→null).Actual Result
Console output (captured 2026-06-26, Chromium @ :8082)
Same error on
:8083(LLM browser pass, console capture from Playwright).Source code at failure point
mainis not yet a child ofrootwheninsertBefore(shellHeader, main)executes — invalid per DOM spec.Playwright / browser E2E
ctrl_k_palette.db-cmdk-overlaynot visiblebrowser:chat_inputbrowser:loadbrowser:session_refreshwindow.aiui.openSessionSearch()Playwright command output (2026-06-26)
Browser console (exact capture from Playwright, Chromium @ :8082)
(Same message repeated on each page reload during the E2E run.)
HTTP / API (unaffected)
REST chat APIs work independently (
POST /api/chat/send→ 200). This is a frontend-only initialization failure.WebSocket
Not applicable to this bug (API streaming verified separately).
Expected Result
buildDashboard()completes without throwing.initCommandPalette()runs; Ctrl+K opens.db-cmdk-overlay.#chat-inputtextarea after navigating to Chat page.[AIUI] Failed to load plugin "dashboard"in console.Impact Assessment
Root Cause Analysis
Architectural cause
buildDashboard()constructs the shell DOM in an order that violates the DOMinsertBefore(newNode, referenceNode)contract:referenceNodemust already be a child of the parent (root).When
renderSlot('shell:header', shellHeader)injects children, the code attempts to insert the header beforemain, butmainis only appended on the next line.Affected modules
templates/frontend/plugins/dashboard.jsbuildDashboard(),initCommandPalette(), slot renderingtemplates/frontend/plugins/plugin-loader.jstemplates/frontend/plugins/views/chat.js#chat-inputwhen plugin init failsWhy previous fixes did not prevent this
buildDashboard()success whenshell:headerhas content.Architecture Analysis
Current architecture (failure)
flowchart TB subgraph Browser PL[plugin-loader.js] --> INIT[dashboard.init] INIT --> BUILD[buildDashboard] BUILD --> SIDEBAR[appendChild sidebar] BUILD --> HEADER[renderSlot shell:header] HEADER --> INS[insertBefore header before main] INS --> FAIL[NotFoundError] FAIL --> ABORT[Plugin load failed] ABORT --> SKIP[initCommandPalette SKIPPED] ABORT --> CHAT[chat.js view SKIPPED] endSequence diagram (error flow)
Expected / corrected architecture
flowchart TD BUILD[buildDashboard] --> A[appendChild main to root FIRST] A --> B{shell:header has children?} B -->|yes| C[insertBefore shellHeader before main] B -->|no| D[skip header insert] C --> E[initCommandPalette] D --> E E --> F[selectPage + view modules] F --> G[chat.js mounts #chat-input]State diagram
API Analysis
GET /api/pagesPOST /api/chat/sendGET /api/chat/history/{id}/api/chat/wsNo API contract change required; fix is client-side DOM ordering.
UI Analysis
#chat-inputTables
Environment matrix
Browser matrix
Severity matrix
Risk matrix
Regression matrix
Affected modules
dashboard.js(primary)plugin-loader.js(error surfacing)views/chat.js(downstream)Validation evidence
Captured 2026-06-26 @ commit
0b62e7d. Source: Playwrightrun_browser_e2e.py/run_llm_browser_e2e.pystdout andconsole_errorsinbrowser-e2e/artifacts/e2e-results.json.Confidence: 100%
Suggested Fix
Primary fix (DOM ordering)
Alternative: insert header before sidebar or use
main.prepend()pattern — choose one consistent shell layout contract.Validation
insertBefore..db-cmdk-overlayvisible.#chat-inputvisible.State management
buildDashboard()in try/catch; setwindow.__AIUI_DASHBOARD_ERROR__for diagnostics.UI rendering
Error handling / logging
plugin-loader.js: surface init failure in UI toast, not console-only.Testing
15-dashboard-test+18-full-chatsmoke.Documentation
AGENTS.mdor dashboard plugin README.Performance / security
Acceptance Criteria
insertBeforeNotFoundError on dashboard load#chat-inputtextareabuildDashboardDOM order15-dashboard-testexamplePriority
High
Dashboard is the primary operator UI path for
style: dashboard. Plugin init failure blocks multiple shipped features (palette, chat compose).Severity
Major
Core navigation and chat UX broken in browser despite working APIs.
Suggested GitHub Labels
bug,regression,frontend,dashboard,ui,windows,needs-investigationWhy This Matters
Duplicate check