Let $L/K$ be an extension of number fields. Suppose $\theta\in \mathcal{O}_L$ is a primitive element of this extension with $f(X)\in\mathcal{O}_K[X]$ its minimal polynomial over $K$. Let $\mathfrak{p}$ be a (nonzero) prime ideal of $\mathcal{O}_K$. Let $\bar{f}(X)=f(X)\bmod \mathfrak{p}\in (\mathcal{O}_K/\mathfrak{p})[X]$ be the reduced polynomial over the finite field $\mathcal{O}_K/\mathfrak{p}$.
A classical theorem of Dedekind states that under some technical condition, if $\bar{f}$ factorizes into irreducible factors $$ \bar{f}=\prod_{i=1}^k \bar{f}_i^{m_i} $$ over $\mathcal{O}_K/\mathfrak{p}$, where $f_i$ are distinct and $\deg(f_i)=d_i$. Then $\mathfrak{p}\mathcal{O}_L$ splits into prime ideals $$ \mathfrak{p}\mathcal{O}_L=\prod_{i=1}^k \mathfrak{P}_i^{e(\mathfrak{P}_i/\mathfrak{p})} $$ with the ramification indices $e(\mathfrak{P}_i/\mathfrak{p})=m_i$ and the inertia degrees $f(\mathfrak{P}_i/\mathfrak{p}):=[\mathcal{O}_L/\mathfrak{P}_i: \mathcal{O}_K/\mathfrak{p}_i]=d_i$. Furthermore $\mathfrak{P}_i=\mathfrak{p}\mathcal{O}_L+f_i(\theta)\mathcal{O}_L$ where $f_i(X)\in\mathcal{O}_K[X]$ lifts $\bar{f}_i(X)$.
The technical condition is used to guarantee that the map $\mathcal{O}_K[\theta]/\mathfrak{p}\mathcal{O}_K[\theta]\to \mathcal{O}_L/\mathfrak{p}\mathcal{O}_L$ induced from the inclusion $\mathcal{O}_K[\theta]\hookrightarrow \mathcal{O}_L$ is an isomorphism. See Proposition (8.3), Chapter 1 in Neukirch's Algebraic Number Theory. Also see this MO post and Keith Conrad's note.
My question is what we can say when the map $\mathcal{O}_K[\theta]/\mathfrak{p}\mathcal{O}_K[\theta]\to\mathcal{O}_L/\mathfrak{p}\mathcal{O}_L$ is not an isomoprhism.
For an irreducible factor $\bar{f}_i$ of $\bar{f}$, the ideal $\mathfrak{p}_i:=\mathfrak{p}\mathcal{O}_K[\theta]+f_i(\theta)\mathcal{O}_K[\theta]$ of $\mathcal{O}_K[\theta]$ is a prime (and maximal) ideal of $\mathcal{O}_K[\theta]$ since $$ \mathcal{O}_K[\theta]/\mathfrak{p}_i\cong (\mathcal{O}_K/\mathfrak{p})[X]/(\bar{f}_i(X)) $$ is an extension of $\mathcal{O}_K/\mathfrak{p}$. Indeed it is easy to see that $\mathfrak{p}_1,\dots,\mathfrak{p}_k$ are precisely the prime ideals of $\mathcal{O}_K[\theta]$ that contains $\mathfrak{p}$. Then for every prime ideal $\mathfrak{P}$ of $\mathcal{O}_L$ lying over $p$, the ideal $\mathfrak{P}\cap \mathcal{O}_K[\theta]$ is some $\mathfrak{p}_i$. Denote by $I_i$ the set of prime ideals $\mathfrak{P}$ of $\mathcal{O}_L$ lying over $\mathfrak{p}$ satisfying $\mathfrak{P}\cap \mathcal{O}_K[\theta]=\mathfrak{p}_i$.
It is easy to see that $d_i$ divides $f(\mathfrak{P}/\mathfrak{p})$ for all $\mathfrak{P}\in I_i$ since $d_i=[\mathcal{O}_K[\theta]/\mathfrak{p}_i: \mathcal{O}_K/\mathfrak{p}]$ and the map $\mathcal{O}_K[\theta]/\mathfrak{p}_i\to \mathcal{O}_L/\mathfrak{P}$ is injective. What else can we say?
It seems to me that we should still have $$ m_i d_i=\sum_{\mathfrak{P}\in I_i} e(\mathfrak{P}/\mathfrak{p})f(\mathfrak{P}/\mathfrak{p}) $$ Is this true? Is there a reference for such a result? Thanks.
(Originally I conjectured $m_i=\sum_{\mathfrak{P}\in I_i} e(\mathfrak{P}/\mathfrak{p})$ but it is apparently false, as can be seen by considering the splitting of $2$ in $\mathbb{Q}(\sqrt{5})$.)