diff --git a/bin/hermes-provision b/bin/hermes-provision index 1cf4ffe89..7e0c42b7f 100755 --- a/bin/hermes-provision +++ b/bin/hermes-provision @@ -266,15 +266,35 @@ if [[ -f "$TEMPLATE_PROFILE/config.yaml" ]]; then done fi -# Patch config.yaml: port + X-Captain-Assistant-Id +# Patch config.yaml: port + X-Captain-Assistant-Id + DESLIGA memória +# (Hermes-level memory_enabled e user_profile_enabled vazam contexto entre +# agentes que compartilham OAuth Codex; manter desligado pra evitar +# contaminação cross-unit). MCP_ASSISTANT_ID="${PARENT_ASSISTANT_ID:-$ASSISTANT_ID}" sed -i "s/port: 8645/port: $PORT/" "$PROFILES_DIR/$SLUG/config.yaml" sed -i "s/X-Captain-Assistant-Id: '6'/X-Captain-Assistant-Id: '$MCP_ASSISTANT_ID'/" "$PROFILES_DIR/$SLUG/config.yaml" +sed -i 's/ memory_enabled: true/ memory_enabled: false/' "$PROFILES_DIR/$SLUG/config.yaml" +sed -i 's/ user_profile_enabled: true/ user_profile_enabled: false/' "$PROFILES_DIR/$SLUG/config.yaml" # Write SOUL.md and SKILL.md from spec echo "$SPEC" | jq -r '.soul_md' > "$PROFILES_DIR/$SLUG/SOUL.md" echo "$SPEC" | jq -r '.skill_md' > "$PROFILES_DIR/$SLUG/skills/$SKILL_NAME/SKILL.md" +# Adiciona anti-leak guard no fim do SOUL.md (defesa contra contaminação +# de outras unidades via memória persistente do Codex/ChatGPT). +SKILL_PATH="$PROFILES_DIR/$SLUG/skills/$SKILL_NAME/SKILL.md" +CATEGORIAS_LISTA=$(echo "$SPEC" | jq -r '.categories | map(.key) | join(", ")') +cat >> "$PROFILES_DIR/$SLUG/SOUL.md" < "$PROFILES_DIR/$SLUG/webhook_subscriptions.json" <