Repository navigation
fix: SessionEnd hook crash when script outputs no JSON - #10
Merged
Merged
Conversation
When a SessionEnd hook script exits 0 with no JSON stdout, parseHookOutput returns json=null. Accessing .hookSpecificOutput on null crashed with 'undefined is not an object'. Fixes #9 Co-Authored-By: Claude <[email protected]>
dahai80
added a commit
that referenced
this pull request
Jul 30, 2026
….4.1) (#16) - Add WebSocket /ws/chat to projectApiServer for streaming chat (subprocess mode: fusion-code --output-format=stream-json) - Protocol: chat.stream/chat.cancel → chat_event/chat_done NDJSON (compatible with StreamingBridge) - Add start.sh for UpstreamServiceManager auto-start - Update README with WS endpoint docs - Bump version to 0.4.1 Fusion-Studio issues filed: - #9 Layer 1: upstream service registration - #10 Layer 2: FusionCodeAPIClient - #11 Layer 3: StreamingBridge WS integration - PR #12: Layer 1+2 implementation 🤖 Generated with [Claude Code](https://claude.com/claude-code)
dahai80
added a commit
that referenced
this pull request
Jul 31, 2026
….4.1) - Add WebSocket /ws/chat to projectApiServer for streaming chat (subprocess mode: fusion-code --output-format=stream-json) - Protocol: chat.stream/chat.cancel → chat_event/chat_done NDJSON (compatible with StreamingBridge) - Add start.sh for UpstreamServiceManager auto-start - Update README with WS endpoint docs - Bump version to 0.4.1 Fusion-Studio issues filed: - #9 Layer 1: upstream service registration - #10 Layer 2: FusionCodeAPIClient - #11 Layer 3: StreamingBridge WS integration - PR #12: Layer 1+2 implementation 🤖 Generated with [Claude Code](https://claude.com/claude-code)
dahai80
added a commit
that referenced
this pull request
Aug 20, 2026
enhance-0819.md §P4.2 定 7 项 /doctor 本地健康检查。审计 (iter #9/#10): - ✅ #5 CLAUDE.md 裁剪 (已覆盖) - ✅ #6 配置冲突 (PR #90) - ⏳ #4 OOM/内存 (跨仓: MLX 无 memory 端点, 仅 POST /api/v1/gc mutating) - ⏳ #7 一键修复 (远期) - **真 gap = #1 MLX 网关连通 + #3 模型加载状态** — /doctor 此前完全不探 MLX 落地 detectMlxHealth(): 复用 model-status.ts 的 fetchMlxStatus (/api/tags) + fetchMlxPs (/api/ps), 3s timeout。Gating: 仅当 shouldAutoUseFusionMlx() (MLX 配置 provider) — cloud-active 时跳过 避免 3s 浪费 + 噪音。两 warning: 不可达 (含 URL + 起服命令) / 已连通 但无模型 loaded (含可用模型名截断 + load 命令)。 不改 Doctor.tsx — diagnostic.warnings 已数据驱动渲染。#4 OOM 跨仓 延后 (fusion-mlx 需加 status 端点, 遵循 "上游问题先提 issue")。 验证: typecheck 0, 6 单测 pass, 122 全测 pass 无回归, build + build:dev:full pass, git diff -w +62/-0 纯插入零 churn。 Co-authored-by: Claude Fable 5 <[email protected]>
dahai80
added a commit
that referenced
this pull request
Aug 28, 2026
…into rewindMessageState (audit 1.1.1) (#180) Slice #10 of the REPL.tsx god-module split (audit §1.1.1). Extract the rewindConversationTo + restoreMessageSync useCallback bodies (~90 LOC) into a pure-helper bundle at src/utils/rewindMessageState.ts. No React, no JSX, no hooks — calls only passed setters + direct pure-fn imports. REPL keeps thin useCallback wrappers (deps arrays verbatim, ref-assign preserved) so downstream reads the same const names → byte-identical. setConversationId wrapped with a lambda to satisfy Dispatch<SetStateAction> contravariance (useState(randomUUID()) infers a template-literal UUID type; helper param typed ReturnType<typeof randomUUID>). feature("CONTEXT_COLLAPSE") dynamic require relocates verbatim (bun:bundle macro, string-literal arg, cross-file DCE safe). Removed two now-unused REPL imports (resetMicrocompactState, ImageBlockParam). Gates: typecheck 0 / 842 tests pass (+12 new helper tests) / lint clean / build:dev ok. REPL 6628 → 6565 (−63). Co-authored-by: Claude Fable 5 <[email protected]>
dahai80
added a commit
that referenced
this pull request
Aug 28, 2026
…it slice #11) (#181) audit §1.1.1 god-module split. Extract the 35-LOC spinner-tip pick useCallback body from REPL.tsx into src/utils/spinnerTipPicker.ts as a pure-helper bundle (no React, no JSX, no hooks). REPL keeps a thin useCallback wrapper (deps array [setAppState, theme] unchanged verbatim) that passes refs + setters via a typed SpinnerTipPickerSetters object; downstream reads the same const name (byte-identical). Also fixes 3 pre-existing typecheck errors in the slice #10 test file rewindMessageState.test.ts (committed in PR #180), per the rule that any failing case must be located+fixed regardless of relation to the current change: - makeSetters messagesRef typed {current: Message[]} not {current: unknown[]} - promptSuggestion toEqual cast to Record<string, unknown> (prev literal narrowed the type, excess-prop check on the 5-field literal failed) - spyOn logSpy dropped 'as never' so .mockRestore() is not on 'never' REPL 6565 → 6538 (−27); cumulative off 7096 now −558. Gates: typecheck 0 / test 842 pass / lint clean / build:dev pass. Co-authored-by: Claude Fable 5 <[email protected]>
dahai80
added a commit
that referenced
this pull request
Dec 1, 2026
Method sections final (pin route, watcher modes, cost metrics); results/forensics/ADAPT sections fill after the 20:00 CST run. Co-authored-by: Claude Code <[email protected]>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #9
When exiting fusion-code, if a SessionEnd hook script exits with code 0 but produces no JSON on stdout, the hook framework crashes with:
Root Cause
src/utils/hooks.tsline 3388 inexecuteHooksOutsideREPL:parseHookOutputreturnsjson = nullwhen hook stdout is not valid JSON. Accessing.hookSpecificOutputonnullthrows TypeError.Fix
Add null guard so
hso2isundefinedwhenjsonis null:Also includes a minor format fix in
src/Tool.ts(line break in TOOL_DEFAULTS.renderToolUseMessage).Testing
bun run typecheck— 0 errorsbun run build:dev— passes🤖 Generated with Claude Code