The following is one version of the Hamilton–Jacobi–Bellman (HJB) equation:

Suppose we have a Brownian motion $W$ and a counting process $N$ with a stochastic intensity $\lambda$ on a time interval $[0,T]$. We have a given set of admissible controls $\mathcal A$ which take values in a set $U\subset\mathbb R$ and we control the intensity $\lambda$. Let $X$ be a process on $[0,T]$ with dynamics

$$dX^u_s = \mu ds + \sigma dW_s + \gamma dN^u_s$$ $$X_t=x,$$

where $x,\mu,\sigma,\gamma\in\mathbb R$, $t\in [0,T]$, $u\in \mathcal A$.

Consider an optimization problem of the form

$$ V(t,x) = \sup_{u\in \mathcal A} E\left( g(X^u_T) +\int_t^T f(X^u_s,u_s)ds\right).$$

Under certain assumptions the previous value function is a (viscosity) solution of the HJB equation:

$$v_t + \mu v_x + \frac{1}{2}\sigma^2v_{xx} + \sup_{u\in U} \left\{\lambda^u(t)(v(t,x+\gamma) - v(t,x)) + f(x,u)\right\}=0$$

$$v(T,.) = g(.) $$

My question is: how would the previous equation (and its terminal condition) change if we were to change the terminal time $T$ for a stopping time $\tau\leq T$ in the definition of the value function. i.e.,

$$ V(t,x) = \sup_{u\in \mathcal A_t} E\left( g(X^u_{\tau}) +\int_t^{\tau} f(X^u_s,u_s)ds\right).$$

Can anything be said in this situation?

What if we added the hypothesis of $\tau$ being absorbent for $X$? i.e., $X$ is constant over $[\tau,T]$.

Any reference would be very much appreciated. Oksendal-Sulem's book entitled "Applied Stochastic Control of Jump Diffusions", for example, as comprehensive as it is, does not deal with value functions with time dependence.