ulysses/static/js
Lucas Daniel f5d834b0c5
fix(cookbook): surface backend diagnosis when serve fails in background (#1636)
* refactor(cookbook): move _diagnose_serve_output to module level in cookbook_helpers

Extracts the nested _diagnose_serve_output function from inside
setup_cookbook_routes() and moves it to module level in cookbook_helpers.py,
alongside the other helper functions it logically belongs with.

No behaviour change — the function is now importable directly for testing
and by other callers without going through the route factory closure.

* fix(cookbook): surface backend diagnosis when serve fails in background

The background poll (_pollBackgroundStatus) already received `diagnosis`
and `cmd` from /api/cookbook/tasks/status but discarded both. When a serve
job died while the Cookbook modal was closed, reopening it showed only a
red error badge with no context.

- Persist live.diagnosis into task._backendDiagnosis in localStorage so it
  survives modal close/reopen and page refresh
- Persist live.cmd into task.payload._cmd for agent-spawned tasks so the
  crash report includes the actual command
- After _renderRunningTab(), walk rendered cards and call _showDiagnosis()
  for any that have a stored _backendDiagnosis but no panel yet
- In _renderTaskCard(), use _backendDiagnosis as a fallback when the
  client-side _terminalServeDiagnosis() finds nothing

* test(cookbook): add coverage for _diagnose_serve_output error patterns

10 tests verifying the 16 serve-failure patterns:
- CUDA OOM, port-in-use, vLLM missing, gated model
- Traceback fallback fires without startup success marker
- Traceback suppressed when server actually started
- Clean/empty output returns None
- trust-remote-code and no-GGUF patterns
2026-06-05 09:52:07 +01:00
..
calendar Ignore non-string calendar date inputs (#1649) 2026-06-03 14:16:58 +09:00
color fix: theme color parsing breaks on #rgb shorthand hex (#1213) 2026-06-03 00:30:03 +09:00
compare Isolate HTML popup openers (#2501) 2026-06-04 20:52:41 +02:00
editor fix: computeSnap throws when ctx.otherLayers is not an array (#1716) 2026-06-03 13:34:25 +09:00
emailLibrary Harden email HTML URL sanitization (#2496) 2026-06-04 20:47:47 +02: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 Whitelist research source links (#2499) 2026-06-04 20:41:35 +02: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 Settings polish: /setup provider subs, Add API defaults to api kind, picker shows offline endpoints, doc library tracks sub-tab 2026-06-05 14:41:54 +09:00
assistant.js Rename Character copy to Persona 2026-06-02 12:42:15 +09:00
calendar.js Calendar: cross-session delete sync — 404 = success, refetch on tab focus 2026-06-05 17:05:04 +09:00
censor.js Ignore censor preference storage errors (#1652) 2026-06-03 14:16:55 +09:00
chat.js feat: Add workspace: confine agent tools to a folder (#1103) 2026-06-05 00:06:37 +02:00
chatRenderer.js Harden chat streaming DOM sinks (#2498) 2026-06-04 20:49:37 +02:00
chatStream.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
codeRunner.js Isolate HTML popup openers (#2501) 2026-06-04 20:52:41 +02:00
colorPicker.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
cookbook-diagnosis.js cookbook agent debug loop: persistent log files, auto-adopt orphan tmux, Codex/Claude skill parity 2026-06-04 23:27:18 +09:00
cookbook-hwfit.js Cookbook polish: auto-reconnect, ctx slider fixes, scoring, lots of UI 2026-06-03 20:25:25 +09:00
cookbook.js cookbook agent debug loop: persistent log files, auto-adopt orphan tmux, Codex/Claude skill parity 2026-06-04 23:27:18 +09:00
cookbookDownload.js Cookbook polish: auto-reconnect, ctx slider fixes, scoring, lots of UI 2026-06-03 20:25:25 +09:00
cookbookProgressSignal.js Don't falsely declare a dependency build stale (#1568) (#1768) 2026-06-03 13:23:35 +09:00
cookbookRunning.js fix(cookbook): surface backend diagnosis when serve fails in background (#1636) 2026-06-05 09:52:07 +01:00
cookbookSchedule.js Cookbook scheduler + serve: schedule via Tasks, Stop verifies kill, Ollama auto port-pick 2026-06-05 14:41:43 +09:00
cookbookServe.js Cookbook scheduler + serve: schedule via Tasks, Stop verifies kill, Ollama auto port-pick 2026-06-05 14:41:43 +09:00
document.js Render emoji shortcodes as icons in chat (#345) (#629) 2026-06-05 02:28:42 +02:00
documentLibrary.js Settings polish: /setup provider subs, Add API defaults to api kind, picker shows offline endpoints, doc library tracks sub-tab 2026-06-05 14:41:54 +09:00
dragSort.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
emailInbox.js fix: reply-all Cc's the user's own other addresses (multi-account) (#672) 2026-06-02 11:42:20 +09:00
emailLibrary.js fix: guard sp.destroy() in _loadScheduled against null spinner (#1495) 2026-06-03 08:12:47 +09:00
emojiPicker.js Odysseus v1.0 2026-05-31 23:58:26 +09: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 feat(ui): allow expanding consolidated file chip regardless of count (#1849) (#2086) 2026-06-04 14:02:52 +01:00
gallery.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
galleryEditor.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
group.js Harden chat streaming DOM sinks (#2498) 2026-06-04 20:49:37 +02:00
init.js fix(ui): keep minimized windows above composer (#1197) 2026-06-02 23:31:09 +09:00
keyboard-shortcuts.js Ignore AltGr keystrokes in Ctrl+Alt keyboard shortcuts (#825) 2026-06-02 11:12:54 +09: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): avoid autolinking dotted imports (#2295) 2026-06-05 02:57:20 +02:00
memory.js feat: allow memory import without session (#493) 2026-06-01 22:32:17 +09:00
modalManager.js feat: Claude Agent integration + cookbook reconnect + UI polish 2026-06-04 08:27:26 +09:00
modalSnap.js Polish email and cookbook flows 2026-06-02 22:42:07 +09:00
modelPicker.js Settings polish: /setup provider subs, Add API defaults to api kind, picker shows offline endpoints, doc library tracks sub-tab 2026-06-05 14:41:54 +09:00
models.js fix(models): stabilize proxy endpoint refresh behavior 2026-06-04 04:56:11 +01:00
modelSort.js Ignore invalid model sort inputs (#1653) 2026-06-03 14:16:52 +09:00
MODULE_SUMMARY.md docs: fix stale documentation references (#1769) 2026-06-03 13:23:21 +09:00
notes.js Calendar overnight-event rendering + clickable [View note] link from chat 2026-06-05 14:41:48 +09: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 Keep presets loading with bad local state (#1417) 2026-06-03 04:09:28 +09:00
providers.js Show the serving provider in the model-info card (#2185) 2026-06-04 18:22:31 +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 Odysseus v1.0 2026-05-31 23:58:26 +09: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: live-resume chat stream on session re-entry (#2539) (#2561) 2026-06-04 17:56:15 +02:00
settings.js Merge remote-tracking branch 'origin/dev' 2026-06-05 12:14:34 +09:00
sidebar-layout.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
signature.js Guard image and QR DOM attributes (#2500) 2026-06-04 20:51:23 +02:00
skills.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
slashAutocomplete.js Cookbook: scoring fixes, UI polish, false-finished + stale-state bug fixes 2026-06-03 16:32:20 +09:00
slashCommands.js Settings polish: /setup provider subs, Add API defaults to api kind, picker shows offline endpoints, doc library tracks sub-tab 2026-06-05 14:41:54 +09:00
spinner.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
storage.js feat: Add workspace: confine agent tools to a folder (#1103) 2026-06-05 00:06:37 +02:00
tasks.js Cookbook scheduler + serve: schedule via Tasks, Stop verifies kill, Ollama auto port-pick 2026-06-05 14:41:43 +09:00
theme.js fix: theme color parsing breaks on #rgb shorthand hex (#1213) 2026-06-03 00:30:03 +09:00
tileManager.js Odysseus v1.0 2026-05-31 23:58:26 +09: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 Revert "fix(ui): allow manual prompt bar resize (#1201)" 2026-06-03 23:03:58 +09:00
voiceRecorder.js Odysseus v1.0 2026-05-31 23:58:26 +09:00
windowDrag.js fix(ui): modal drag + removed startDrag func (#2430) 2026-06-04 20:34:18 +02:00
windowResize.js Make tool windows resizable by dragging edges or corners 2026-06-01 19:49:23 +02:00
workspace.js feat: Add workspace: confine agent tools to a folder (#1103) 2026-06-05 00:06:37 +02:00