You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up to #115 / #116. After the WeakMap originals cache, ask still self-cancels in ~30ms on a TUI session with no user dismiss. #116 stores pristineUiMap as a moduleWeakMap. Jiti module-cache invalidation (already called out for BRIDGE_KEY on process in bridge.ts) creates a new empty map, then getOrCreatePristineOriginals recaptures PromptBus wrappers as "natives".
The TUI adapter re-enters the bus. selectWrapper maps { cancelled: false, error } / missing answer to undefined. Dashboard ask-tool.ts treats any undefined as a user cancel (User cancelled ask.).
Observed 2026-08-13 on live ~/.omp-dashboard 0.5.4 with #116 already present, OMP 17.3.0, session source: tui.
Tool result text is unique to packages/extension/src/ask-tool.ts (User cancelled ask.\nsample: []). Core OMP AskTool says User cancelled the selection.
Not the 300s PromptBus timeout. User did not dismiss.
Mechanism
ctx-ui-originals.tsconst pristineUiMap = new WeakMap(...) dies on jiti reload.
Next session_start cache-misses and binds current ctx.ui.select (already __isPromptBusWrapper).
vi.resetModules() then re-import getOrCreatePristineOriginals and recapture the same ctx.ui after patching. Current main recaptures the wrapper (native select call count 0).
Suggested fix
Store the WeakMap on process (same pattern as BRIDGE_KEY / __pi_dashboard_bridge__), e.g. __pi_dashboard_pristine_ui__.
Also stop mapping adapter error / missing answer to user cancel in selectWrapper / ask-tool.ts.
Worktree with the process-map + failing-then-passing jiti test: ~/code/zge-workspace/worktrees/omp-dashboard/ask-prompt-jiti-originals (fix/ask-prompt-jiti-originals). Not shipped to ~/.omp-dashboard yet.
Summary
Follow-up to #115 / #116. After the WeakMap originals cache,
askstill self-cancels in ~30ms on a TUI session with no user dismiss. #116 storespristineUiMapas a moduleWeakMap. Jiti module-cache invalidation (already called out forBRIDGE_KEYonprocessinbridge.ts) creates a new empty map, thengetOrCreatePristineOriginalsrecaptures PromptBus wrappers as "natives".The TUI adapter re-enters the bus.
selectWrappermaps{ cancelled: false, error }/ missinganswertoundefined. Dashboardask-tool.tstreats anyundefinedas a user cancel (User cancelled ask.).Observed 2026-08-13 on live
~/.omp-dashboard0.5.4 with #116 already present, OMP 17.3.0, sessionsource: tui.Evidence (this session)
Session:
~/.omp/agent/sessions/-code-zge-workspace/2026-08-13T21-52-14-327Z_019ffd1c-8bf7-7000-9129-177229e74139.jsonlTool result text is unique to
packages/extension/src/ask-tool.ts(User cancelled ask.\nsample: []). Core OMP AskTool saysUser cancelled the selection.Not the 300s PromptBus timeout. User did not dismiss.
Mechanism
ctx-ui-originals.tsconst pristineUiMap = new WeakMap(...)dies on jiti reload.session_startcache-misses and binds currentctx.ui.select(already__isPromptBusWrapper).originals.select→ wrapper →bus.request→ TUI adapter → recurse.cancelled: false, error: ...) is still rendered as user cancel:selectWrapper:r.cancelled ? undefined : r.answerselectedFromAnswer(undefined)→cancelled: trueRepro (unit)
vi.resetModules()then re-importgetOrCreatePristineOriginalsand recapture the samectx.uiafter patching. Current main recaptures the wrapper (native select call count 0).Suggested fix
Store the WeakMap on
process(same pattern asBRIDGE_KEY/__pi_dashboard_bridge__), e.g.__pi_dashboard_pristine_ui__.Also stop mapping adapter
error/ missing answer to user cancel inselectWrapper/ask-tool.ts.Worktree with the process-map + failing-then-passing jiti test:
~/code/zge-workspace/worktrees/omp-dashboard/ask-prompt-jiti-originals(fix/ask-prompt-jiti-originals). Not shipped to~/.omp-dashboardyet.Related