perf(mobile): skip model projection after discovery owner retires (#35540)

* perf(mobile): skip model projection for retired discovery owners

* test(mobile): drop spy-only model discovery projection test

Existing hook suite already covers stale-result exclusion; the new file only asserted a namespace spy call.

---------

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
This commit is contained in:
OrcaWin
2026-10-28 21:15:38 -07:00
committed by GitHub
co-authored by OrcaWin
parent 572e270116
commit c8f22c9dcb
@@ -68,8 +68,11 @@ export function useMobileNativeChatModelDiscovery(args: {
let cancelled = false
void runRpcOperation(client, discoverModels, { worktree: `id:${worktreeId}`, agentId: agent })
.then((discovery) => {
if (cancelled) {
return
}
const models = discovery ? catalogModelsFromModelDiscovery(agent, discovery) : null
if (!cancelled && models !== null) {
if (models !== null) {
setResult({ client, scope, models: mergeDiscoveredCatalogModels(agent, catalog, models) })
}
})