fix: add unsafe-eval to CSP for Alpine.js and Tailwind CDN#353
Merged
Conversation
Prompt improvements: - Add "never refuse without trying" to both task and chat mode rules (critical for autonomous execution — was lost in prior streamlining) - Add memory_search hint to task mode (was only in chat mode) - Clarify "blackboard for other agents only" wording - Add "read before updating — merge, don't overwrite" to self-evolution (prevents agents from clobbering their own workspace files) - Trim fleet context block from ~15 lines to 2 (blackboard/notify_user guidance already covered by operating rules) Template revisions (all 6): - Add notify_user step to all multi-agent workflows so users get results when agents work via pipelines or heartbeat - Add domain-specific quality guidance: - deep-research: memory_save step for source reuse across sessions - content: writing principles, audience matching, review checklist - devteam: engineering standards, review focus areas (security, tests) - sales: ICP reference from USER.md, what-to-capture checklist - monitor: what makes good monitoring targets, severity levels - Remove placeholder example lines from monitor heartbeat (replaced with actionable format the user fills in) - starter: add autonomous reporting guidance
Standalone agents (no project) no longer see blackboard tools or references. Changes: - SkillRegistry: add `exclude` param to list_skills/get_descriptions/ get_tool_definitions for filtering tools from LLM - AgentLoop: exclude blackboard tools (read/write/list_shared_state, publish/subscribe_event, watch_blackboard, claim_task) when mesh_client.is_standalone; omit blackboard references from operating rules in both task and chat modes; skip fleet roster fetch - workspace: standalone SYSTEM.md preamble without blackboard/pub-sub/ coordination sections - mesh_tool: remove blackboard mention from list_agents description Runtime _STANDALONE_ERROR checks in mesh_tool.py remain as defense-in- depth. All 1660 tests pass.
- Add runtime is_standalone guards on publish_event/subscribe_event - Conditional "promote" instruction in task mode (standalone omits it) - Include is_standalone in heartbeat context for conditional cron rules - Fix wait_for_subagent to read from task.result() first (works standalone) - Fix wait_for_subagent to catch task exceptions from asyncio.wait_for - Clean tool descriptions that mentioned blackboard visible to standalone - Fix _make_loop test helper to set is_standalone=False explicitly - Add 17 new tests covering all standalone isolation behavior
- _run_subagent: skip write_blackboard when mesh_client.is_standalone - wait_for_subagent: skip blackboard fallback for standalone agents - Set is_standalone=False on all mock mesh clients in subagent tests (MagicMock auto-attributes are truthy, causing silent wrong behavior)
…t-system # Conflicts: # src/agent/loop.py
When fetchSettings() is slow or fails, settingsData stays null and showOnboarding returned false, leaving the fleet tab completely blank (no loading skeleton, no onboarding, no empty state). Fall back to showing onboarding when agents are empty regardless of settings state.
PR #343 added Content-Security-Policy without 'unsafe-eval'. Both Alpine.js (expression evaluation via new Function()) and Tailwind CDN (JIT CSS generation) require eval/new Function to operate. Without it, Alpine directives (x-show, x-data, x-model) never evaluate, x-cloak never gets removed, and the dashboard appears blank. Also adds the CSP header to the SPA catchall route for consistency (was previously missing entirely).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Content-Security-Policywithout'unsafe-eval', breaking Alpine.js and Tailwind CDNnew Function()for expression evaluation (x-show,x-data,x-model, etc.)new Function()for JIT CSS generation'unsafe-eval', both libraries silently fail —[x-cloak]never gets removed, page appears blankWhy
'unsafe-eval'is neededAlpine.js standard CDN build (
alpinejs@3.14.8/dist/cdn.min.js) requireseval()/new Function()to evaluate directive expressions. The alternative is@alpinejs/cspwhich pre-compiles expressions, but requires significant template changes.'unsafe-eval'is the pragmatic fix.Test plan
http://localhost:8420/dashboard/— page renders correctly