feat: Update local agent documentation to reflect changes in user_id and session_id handling; add marketing strategy document; update skills-lock.json with new Remotion best practices; update website subproject commit.

This commit is contained in:
Roberto Musso
2026-04-11 02:15:59 +02:00
parent bc2c76d2bb
commit 54eb863c52
84 changed files with 8825 additions and 59 deletions

View File

@@ -220,13 +220,22 @@ if lf:
**Pattern V3 corretto nel codice produzione (`agent_runner.py`, `deep_agent.py`, `agent_setup.py`):**
```python
# user_id e session_id vanno in metadata, NON come kwarg diretti
lf.start_as_current_observation(
# user_id e session_id propagati come attributi first-class Langfuse
# tramite langfuse_context() che wrappa propagate_attributes()
from app.core.langfuse_client import langfuse_context
_lf_ctx = langfuse_context(user_id=user_id, session_id=session_id)
_lf_ctx.__enter__()
# user_id viene hashato con SHA-256 prima dell'invio a Langfuse
# session_id arriva dal renderer (home/floating) o dal run_id (batch)
_span_ctx = lf.start_as_current_observation(
as_type="span",
name="my-span",
metadata={"user_id": user_id, "session_id": session_id},
input=...,
)
# NON mettere user_id/session_id in metadata — propagate_attributes li gestisce
```
### compile_prompt — non usare template.format() direttamente