odysseus/static/js
samy 6058be7088 fix: session URL hash lost when sending message mid-stream
Two independent bugs caused the session hash to disappear from the URL:

Bug 1 — ReferenceError in catch block silently killed error recovery
  In handleChatSubmit, two const variables (streamingTTS at line 1922 and
  abortCtrl at line 1741) were declared inside the try block but referenced
  in the catch block. Since const is block-scoped in JavaScript, they were
  undefined in catch, causing a ReferenceError that silently aborted the
  error handler. This prevented materializePendingSession() from ever being
  called, so no hash was written to the URL.
  Fix: Hoisted both as let declarations before the try { block.

Bug 2 — Dual sessions.js ES module instances with mismatched state
  app.js imported sessions.js with a version query string
  (?v=20260722ctxheader4) while every other module imported ./sessions.js
  without one. The browser treated them as different URLs, creating two
  separate module instances with independent _pendingChat and
  currentSessionId state. createDirectChat() set pending on one instance
  while handleChatSubmit() checked hasPendingChat() on the other — so the
  pending session never materialized.
  Fix: Removed the version query string from the sessions.js import in
  app.js and from the modulepreload + script tags in index.html. All
  modules now share a single sessions.js instance.

Bonus guard: _adoptOpenedSessionBeforeAutoCreate() now checks
hasPendingChat() before adopting a stale DOM-active session, preventing
the send path from landing in the wrong session when a New Chat is pending.
2026-08-01 23:04:22 -04:00
..
calendar fix(security): escape backslashes in calendar bg-image CSS url() (#4712) 2026-06-22 21:17:52 +02:00
color fix: theme color parsing breaks on #rgb shorthand hex (#1213) 2026-06-03 00:30:03 +09:00
compare Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
editor Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
emailLibrary Polish mobile UI and editor workflows 2026-06-27 13:05:44 +00:00
markdown Ignore non-string markdown table rows (#1648) 2026-06-03 14:17:02 +09:00
model fix: model cost/info matches first substring key (gpt-4o-mini billed as gpt-4o) (#1439) 2026-06-04 03:05:37 +01:00
research Show thumbnails on past research cards 2026-06-30 08:00:01 +00:00
util fix: monthly schedule label shows 21th/22th/31th (ordinal suffix for days >20) (#1577) 2026-06-03 08:57:47 +09:00
a11y.js Improve accessibility across core flows (#86) 2026-06-01 22:04:00 +02:00
admin.js Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
assistant.js refactor(tools): move model-interaction tools to the agent_tools registry (#4445) 2026-06-18 05:56:37 +00:00
calendar.js Merge dev into main for testing 2026-06-28 14:07:23 +00:00
censor.js Ignore censor preference storage errors (#1652) 2026-06-03 14:16:55 +09:00
chat.js fix: session URL hash lost when sending message mid-stream 2026-08-01 23:04:22 -04:00
chatRenderer.js Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
chatStream.js Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
codeRunner.js Fix/windows llama cpp serve and test upstream (#2669) 2026-06-05 14:53:33 +02:00
colorPicker.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
composerArrowUpRecall.js Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
cookbook-deps-recipes.js Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
cookbook-diagnosis.js Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
cookbook-hwfit.js Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
cookbook.js Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
cookbookDownload.js Checkpoint Odysseus local update 2026-07-07 00:50:07 +00:00
cookbookPorts.js fix(cookbook): only block model launch on real port collisions (#4760) 2026-06-24 19:44:09 +02:00
cookbookProgressSignal.js Don't falsely declare a dependency build stale (#1568) (#1768) 2026-06-03 13:23:35 +09:00
cookbookRunning.js Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
cookbookSchedule.js Cookbook UI: Ollama browser, advanced serve fold, API tokens form, diagnosis toolbar, polish 2026-06-09 09:46:19 +09:00
cookbookServe.js Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
document.js Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
documentLibrary.js Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
dragSort.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
emailInbox.js Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
emailLibrary.js Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
emailShared.js Polish mobile UI and editor workflows 2026-06-27 13:05:44 +00:00
emojiPicker.js fix(modal): keep body-portaled dropdowns above their tool modal at any stack depth (#4720) (#4724) 2026-06-23 10:24:31 +02:00
emojiShortcodes.js Render emoji shortcodes as icons in chat (#345) (#629) 2026-06-05 02:28:42 +02:00
escMenuStack.js fix: make transient dropdown/popup menus close on Escape 2026-06-01 14:23:22 -04:00
fileHandler.js Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
gallery.js Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
galleryEditor.js Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
group.js fix: group selection drop-downs recreation and repopulation logic (#3424) 2026-06-26 13:35:25 +01:00
init.js Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
keyboard-shortcuts.js fix: _matchesCombo crashes on non-string keybind from server (#2049) 2026-07-11 03:15:19 +01:00
langIcons.js fix: langIcon throws on an explicit null opts argument (#1740) 2026-06-03 13:29:21 +09:00
markdown.js fix(markdown): restore extracted blocks verbatim so $& and $$ survive (#5768) 2026-07-30 10:48:31 +01:00
memory.js Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
modalManager.js Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
modalSnap.js Merge remote-tracking branch 'origin/dev' into test-main-dev-merge-20260615 2026-06-15 21:20:15 +09:00
modelPicker.js Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
models.js Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
modelSort.js Ignore invalid model sort inputs (#1653) 2026-06-03 14:16:52 +09:00
MODULE_SUMMARY.md fix(cleanup): update MODULE_SUMMARY and remove dead MEMORY_DOC paths (#4411) (#5160) 2026-07-11 17:06:19 +01:00
notes.js Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
package.json Fix test suite: ESM module loading and stub isolation (#844) 2026-06-02 11:29:29 +09:00
platform.js Ignore AltGr keystrokes in Ctrl+Alt keyboard shortcuts (#825) 2026-06-02 11:12:54 +09:00
presets.js fix: group selection drop-downs recreation and repopulation logic (#3424) 2026-06-26 13:35:25 +01:00
providerDeviceFlow.js feat: add ChatGPT Subscription provider (#2876) 2026-06-08 10:19:18 +02:00
providers.js feat(discovery): detect llama.cpp servers and label local providers (#4729) 2026-06-23 23:39:56 +02:00
rag.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
researchSynapse.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
search-chat.js Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
search.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
section-management.js Fix Models section collapse dead pause and missing animation 2026-06-01 16:53:46 +02:00
sessions.js Fix: restore session URL hash writes (removed in cf4e240a) 2026-08-01 19:21:29 -04:00
settings.js fix(email): open settings after OAuth callback (#5803) 2026-07-30 14:57:07 +01:00
sidebar-layout.js Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
signature.js Constrain signature uploads to PNG data (#2844) 2026-06-05 13:17:43 +02:00
skills.js fix(ui): route tasks.js + skills.js dropdowns through topPortalZ() (#4768) 2026-06-24 22:29:36 +02:00
slashAutocomplete.js feat: add ChatGPT Subscription provider (#2876) 2026-06-08 10:19:18 +02:00
slashCommands.js Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
spinner.js Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
storage.js feat(a11y): add a Text size control and an OpenDyslexic font option (#4210) 2026-06-22 13:53:46 +02:00
streamingRenderer.js fix(chat): stop code-block button flicker during streaming (#3023) 2026-06-06 04:08:54 -06:00
streamingSegmenter.js fix(chat): stop code-block button flicker during streaming (#3023) 2026-06-06 04:08:54 -06:00
tasks.js Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
theme.js feat(a11y): add a Text size control and an OpenDyslexic font option (#4210) 2026-06-22 13:53:46 +02:00
tileManager.js fix(ui): restore all-edge modal snap zones (#2260) 2026-06-15 12:36:34 +02:00
toolWindowZOrder.js fix(modal): keep body-portaled dropdowns above their tool modal at any stack depth (#4720) (#4724) 2026-06-23 10:24:31 +02:00
tourAutoplay.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
tourHints.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
tts-ai.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
ui.js Merge verified Odysseus fixes 2026-07-23 14:49:02 +00:00
voiceRecorder.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
windowDrag.js fix(windowDrag): disable duplicate top-edge fullscreen snap (#3495) 2026-06-15 16:10:40 +09:00
windowResize.js Make tool windows resizable by dragging edges or corners 2026-06-01 19:49:23 +02:00
workspace.js feat(agent): confine agent file/shell tools to a selectable workspace (#3665) 2026-06-11 18:17:54 +02:00