Skip to content

fix: enable privacy shield toggle via host agent, surface errors#850

Open
yasinBursali wants to merge 2 commits intoLight-Heart-Labs:mainfrom
yasinBursali:fix/privacy-shield-toggle
Open

fix: enable privacy shield toggle via host agent, surface errors#850
yasinBursali wants to merge 2 commits intoLight-Heart-Labs:mainfrom
yasinBursali:fix/privacy-shield-toggle

Conversation

@yasinBursali
Copy link
Copy Markdown
Contributor

What

  • Allow privacy-shield to be toggled via the host agent extension API
  • Surface actual error messages instead of misleading "Host agent not reachable"
  • Pass DREAM_AGENT_KEY to dashboard-api container for auth alignment

Why

The privacy toggle called /v1/extension/start|stop which blocks core services. Privacy-shield is in CORE_SERVICE_IDS. The 403 error was caught as a generic URLError and replaced with "Host agent not reachable" — misleading since the agent was running and deliberately rejecting the request.

How

  • Added TOGGLABLE_CORE_SERVICES = {"privacy-shield"} in dream-host-agent.py — exempts privacy-shield from the core service gate while preserving its core status everywhere else (dashboard-api still blocks install/uninstall)
  • For togglable core services, validate_service_id() also checks INSTALL_DIR/extensions/services/ (core extensions live there, not in data/user-extensions/)
  • Added urllib.error.HTTPError catch before URLError in privacy.py to surface actual error details
  • Passed DREAM_AGENT_KEY to dashboard-api container in docker-compose.base.yml for auth key alignment

Testing

  • Python syntax verified
  • Live tested on WSL2: toggle now succeeds after both auth and directory fixes

Platform Impact

  • All platforms: Fixed — privacy toggle works when host agent is running
  • macOS note: privacy-shield may be filtered from compose stack if gpu_backends doesn't include apple (pre-existing, separate issue)

yasinBursali and others added 2 commits April 8, 2026 05:02
Add TOGGLABLE_CORE_SERVICES exception so the host agent permits
start/stop of privacy-shield while keeping it protected from
install/uninstall as a core service.

Catch urllib.error.HTTPError before URLError in privacy.py so
403/500 responses are reported with their actual status code
instead of the misleading "host agent not reachable" message.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1. Auth mismatch: dashboard-api container didn't receive DREAM_AGENT_KEY
   env var, fell back to DASHBOARD_API_KEY. Host agent expected
   DREAM_AGENT_KEY when set in .env. Fix: pass DREAM_AGENT_KEY to
   the dashboard-api container in docker-compose.base.yml.

2. Directory check: validate_service_id only checked USER_EXTENSIONS_DIR
   (data/user-extensions/) for manifest. Core togglable services like
   privacy-shield live in extensions/services/. Fix: for services in
   TOGGLABLE_CORE_SERVICES, also check INSTALL_DIR/extensions/services/.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant