I suspect the following should be well known, in some circles, under some name. Alas, I could not figure out how to prove it or where to look it up.
Recall that a recollement is a sequence of (triangulated) functors of triangulated categories
$\mathcal{D}' \xrightarrow{i_*} \mathcal{D} \xrightarrow{j^*} \mathcal{D}''$
satisfying certain conditions, see e.g. 1. I just want to recall that $j^*$ is also denoted $j^!$ and has a right adjoint $j_!$, that $i_*$ has a left adjoint $i^*$, that $i_*, j_!$ are fully faithful, that $j^* i_* = 0$ and that for $X \in \mathcal{D}$ there is a (unique, functorial) distinguished triangle $j_! j^! X \to X \to i_* i^* X \xrightarrow{w_X} j_! j^! X[1]$.
Now let us assume that we are in a sufficiently rich situation that there are mapping spectra $Map(X, Y) \in SH$ (the stable homotopy category) for any $X, Y \in \mathcal{D}$ satisfying "the usual" properties and that the functors $i_*$ etc are similarly enriched. I then suspect the following:
Given $X, Y \in \mathcal{D}$, there is a distinguished triangle
$Map(X, Y) \xrightarrow{i_*i^*, j_!j^!} Map(i_*i^* X, i_*i^* Y) \oplus Map(j_! j^! X, j_! j^! Y) \xrightarrow{p-q} Map(i_*i^* X, j_!j^! Y[1]).$
Here $p$ is just composition with the map $w_Y$, and $q$ is composition with $w_X$ and using $Map(j_!j^! X, j_!j^! Y) = Map(j_!j^! X[1], j_!j^! Y[1])$. You may wish to view this as a homotopy (bi)cartesian square of spectra as usual.
My question is: is this result established somewhere I can cite? Or alternatively what is a good way of proving it?
Some ideas on a proof
The main observation is that $Map(j_!j^! X, i_*i^* Y) \simeq 0$ because $i^*j_! = 0$ follows from the axioms. This begs to be combined with the gluing triangles, of course. From this I have tried to proceed in a few ways:
Using functoriality of mapping spectra and playing around with the octahedral axiom, I can show that there is a distinguished triangle with the vertices as claimed, but I do not know that the maps are correct (one of the inclusions and one of the projections are ok, the others I cannot control). As usual with the octahedral axiom the argument is a bit space intensive but I can reproduce it if you want.
The result is quite transparent if we pretend that we are allowed to build complexes out of the mapping spectra; one may then directly show that $Map(X, Y)$ is quasi-isomorphic to the complex the triangle predicts. I think this can be made rigorous using dg categories and twisted complexes.
Lurie explains in appendix A.8 of higher algebra that (more or less) all recollements come from a "left exact correspondence" between categories. It appears to me that one may be able to establish the desired homotopy cartesian square from this description; unfortunately I am not sufficiently skilled in the manipulation of infinity categories to be sure.