opentui(v6): fix popup-boot latency regression (model.options prefetch blocked the gateway dispatcher)

The native TUI prefetches model.options right after session.create (91df32545,
picker instant-open). The handler is network-bound (~3.7s: pricing fetch + Nous
tier check in build_models_payload) and ran on the gateway's main dispatcher
thread, so every fast-path RPC issued in the first seconds after launch —
complete.slash for the '/' dropdown, session.list, config.get — sat unread
behind it. Measured: first '/' dropdown 1718ms at HEAD vs 53ms at 394f45a3d
(pre-prefetch baseline); 52ms after routing model.options onto the existing
RPC thread pool (_LONG_HANDLERS). The /model picker keeps its 29ms cached open.
This commit is contained in:
alt-glitch 2026-06-10 22:20:09 +05:30
parent fb30ff218d
commit 0bb58b65ec

View file

@ -175,6 +175,12 @@ _LONG_HANDLERS = frozenset(
{
"browser.manage",
"cli.exec",
# model.options is network-bound (pricing fetch + Nous tier check via
# build_models_payload, ~seconds). The native TUI prefetches it right
# after session.create; on the main thread that stalls every fast-path
# RPC — notably complete.slash, so the first `/` dropdown after launch
# took seconds to paint.
"model.options",
"session.branch",
"session.compress",
"session.resume",