Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/pinky_daemon/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1307,6 +1307,20 @@ def _sse_headers() -> dict:
db_path = getattr(agent_registry, "_db_path", "")
if isinstance(db_path, str) and db_path:
stdio_env["PINKY_AGENTS_DB"] = db_path
# Memory embeddings: the pinky-memory stdio subprocess only reads
# OPENAI_API_KEY from its own environment (embeddings.py resolves
# api_key arg -> os.environ, and build_embedding_client() is called
# without an api_key in pinky_memory/__main__.py), so without this
# the key saved via set_setting() never reaches it and reflect()
# silently falls back to the NoOp embedder (embedded: false).
try:
openai_key = agent_registry.get_setting("OPENAI_API_KEY")
if isinstance(openai_key, str) and openai_key:
stdio_env["OPENAI_API_KEY"] = openai_key
except Exception:
pass
if stdio_env:
mcp_config["mcpServers"]["pinky-memory"]["env"] = dict(stdio_env)

# Pinky-self: heartbeat_ack, schedules, self-management
tool_gates = _get_agent_tool_gates(agent_name, skill_store)
Expand Down Expand Up @@ -4379,6 +4393,10 @@ async def _trigger_librarian() -> None:
"/auth/setup",
"/favicon.svg",
"/icons.svg",
# OpenClaw device WebSocket — external Android client connects here;
# auth is handled inside the WS handshake, not via session cookie.
"/openclaw/ws",
"/gateway/ws",
}
_public_prefixes = (
"/assets/", "/static/", "/p/", "/hooks/",
Expand Down Expand Up @@ -4468,6 +4486,12 @@ async def _trigger_librarian() -> None:
"/soul-templates", # soul template registry
"/sprints", # sprint management
"/triggers", # webhook/url trigger management
# OpenClaw/AIena/leads endpoints (commit 361e6dc) — agent/admin callers
# authenticate via internal auth headers or session cookie. The WS paths
# (/openclaw/ws, /gateway/ws) are carved out as public_exact above.
"/openclaw/", # /openclaw/device (agent→device REST invoke)
"/api/aiena/", # /api/aiena/approve-article (AIena admin action)
"/api/leads/", # /api/leads/promote (lead promotion)
)

# Single source of truth for the auth gate's route classification. Exposed
Expand Down
Loading