Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
10 KiB
Phase 11: Miscellaneous Bug Fixes
Standalone bug fixes that don't group neatly into other phases.
Parser Fixes
-
Review PR #835 (
fix: handle nested XML tags in parser extractField and extractArrayElementsby @Glucksberg). File:src/sdk/parser.ts. Nested XML tags break field extraction. Steps: (1)gh pr checkout 835(2) Review regex/parser changes — should handle<field><inner>content</inner></field>patterns (3) Runnpm run build(4) If correct:gh pr merge 835 --rebase --delete-branch- Merged. Clean regex fix:
[^<]*→[\s\S]*?(non-greedy) inextractField()andextractArrayElements(). Also adds empty element filtering. Greptile 5/5 confidence. Build failure is pre-existing (dompurify dep), not introduced by this PR. TypeScript compilation passes for parser.ts.
- Merged. Clean regex fix:
-
Review PR #862 (
fix: handle missing assistant messages gracefully in transcript parserby @DennisHartrampf). File:src/shared/transcript-parser.ts. Missing assistant messages cause parser crash. Steps: (1)gh pr checkout 862(2) Review — should skip or handle gracefully, not crash (3) Runnpm run build(4) If clean:gh pr merge 862 --rebase --delete-branch- Merged. One-line fix:
throw new Error(...)→return ''inextractLastMessage()when no message of requested role is found. Consistent with the function's existing behavior (already returns''at line 64 for found-but-empty cases). Fixes crash in summarize hook when user exits before assistant responds.
- Merged. One-line fix:
Gemini Model Name
- Review PR #831 (
fix: correct Gemini model name from gemini-3-flash to gemini-3-flash-previewby @Glucksberg). Files: 12 files including GeminiAgent.ts, docs, UI. Steps: (1)gh pr checkout 831(2) Verify the correct model name from Gemini docs (is itgemini-3-flash-previewor something else as of today?) (3) If model name is correct and changes are sound:gh pr merge 831 --rebase --delete-branch- Merged. Verified
gemini-3-flash-previewis the correct model ID per Google's official Gemini API docs —gemini-3-flashdoes not exist. Cherry-picked onto main (build artifact conflicts only, source merged cleanly). 9 files updated: type definition, RPM limits, model validation, settings, UI dropdown, docs, and tests. Greptile review noted a pre-existing unrelated naming mismatch in docs (CLAUDE_MEM_GEMINI_BILLING_ENABLEDvs actualCLAUDE_MEM_GEMINI_RATE_LIMITING_ENABLED).
- Merged. Verified
Config/Environment
-
Review PR #634 (
fix: respect CLAUDE_CONFIG_DIR for plugin paths (#626)by @Kuroakira). Files: 14 files across paths, hooks, and services. Steps: (1)gh pr checkout 634(2) Review — should useCLAUDE_CONFIG_DIRenv var instead of hardcoded~/.claude/path (3) Large changeset — verify it doesn't break default behavior when env var is not set (4) Runnpm run build(5) If clean:gh pr merge 634 --rebase --delete-branch- Cherry-picked onto main. PR had build artifact merge conflicts (plugin/scripts/* — minified bundles), but all 6 source changes applied cleanly. Adds
MARKETPLACE_ROOTconstant topaths.ts, updatesHealthMonitor.ts,worker-utils.ts,BranchManager.ts,CursorHooksInstaller.ts, andObservationCompiler.tsto use centralized constants instead of hardcodedhomedir() + '.claude'paths. Backwards compatible — defaults to~/.claudewhenCLAUDE_CONFIG_DIRis not set. TypeScript compilation passes for all modified files. Build failure is pre-existing (dompurify dep). Fixes #626.
- Cherry-picked onto main. PR had build artifact merge conflicts (plugin/scripts/* — minified bundles), but all 6 source changes applied cleanly. Adds
-
Review PR #712 (
Fix environment variablesby @cjpeterein). Files: SettingsDefaultsManager.ts + build artifacts + tests. Steps: (1)gh pr checkout 712(2) Review — what env var fix? Check the diff for specifics (3) Runnpm run build(4) If clean and focused:gh pr merge 712 --rebase --delete-branch- Cherry-picked onto main. Adds
applyEnvOverrides()method ensuring env vars take highest priority:env > file > defaults. Applied to all 3 return paths inloadFromFile()(missing file, normal load, error fallback). 6 test cases added and passing. Enables runtime configuration overrides for containerized deployments and CI/CD without modifying settings files. Build artifacts had merge conflicts (minified bundles) — source changes applied cleanly.
- Cherry-picked onto main. Adds
-
Review PR #524 (
fix: add minimum bun version check to smart-install.jsby @quicktime). File:plugin/scripts/smart-install.js. Steps: (1)gh pr checkout 524(2) Review version check logic — what minimum version? Is it still relevant? (3) If clean:gh pr merge 524 --rebase --delete-branch- Merged. Adds
MIN_BUN_VERSION = '1.1.14'check with auto-upgrade viabun upgrade. Clean semvercompareVersions()function,isBunVersionSufficient()check inserted between bun install and uv install steps. Minimum version is justified: bun 1.1.14+ required for.changesproperty on SQLite.run()and multi-statement SQL support (1.0.26+). Falls back gracefully with manual upgrade instructions if auto-upgrade fails. Fixes #519.
- Merged. Adds
-
Review PR #771 (
fix: handle stdin unavailability and timeout to prevent hook hangsby @rajivsinclair). File:src/cli/stdin-reader.ts. Steps: (1)gh pr checkout 771(2) Review — stdin may not be available in all environments (CI, some Windows configs) (3) Should add timeout and graceful fallback (4) Runnpm run build(5) If clean:gh pr merge 771 --rebase --delete-branch- Merged. Replaces naive
stdin.on('end')listener (which hangs when Claude Code doesn't close stdin) with JSON self-delimiting detection — triesJSON.parse()after each chunk and resolves immediately on valid JSON. AddsisStdinAvailable()guard for Bun EINVAL crash (#646), 30s safety timeout for malformed input, and graceful error handling (returnsundefinedinstead of crashing). Fixes #727, addresses #646. TypeScript compilation clean.
- Merged. Replaces naive
Cursor Integration
- Review PR #721 (
fix(cursor): use bun runtime and fix hooks directory detectionby @polux0). Files: 5 cursor-related files. Steps: (1)gh pr checkout 721(2) Review Cursor hook changes — should use bun-runner.js pattern (consistent with v9.0.17) (3) Runnpm run build(4) If compatible with current architecture:gh pr merge 721 --rebase --delete-branch- Cherry-picked onto main. Source changes from
CursorHooksInstaller.tsapplied cleanly (commit8030c44a). Fixes two Cursor standalone setup bugs: (1)findCursorHooksDir()now checks forhooks.jsonin unified CLI mode, not just legacy shell scripts — prevents "Could not find cursor-hooks directory" error for standalone Cursor users. (2) Hook commands now use bun instead of node, fixingbun:sqlitedependency crash. AddedfindBunPath()for cross-platform bun detection with PATH fallback. Build artifacts skipped (pre-existing dompurify dep issue). Dev log docs (CURSOR-SETUP-BUGS-AND-FIXES.md,CURSOR-STANDALONE-SETUP-LOG.md) not merged.
- Cherry-picked onto main. Source changes from
Database
-
Review PR #889 (
fix(db): prevent FK constraint failures on worker restartby @Et9797). File:src/services/sqlite/...(FK constraints). Steps: (1)gh pr checkout 889(2) Review — FK constraint failures on restart suggest orphaned references. Should the fix be proper cleanup or deferred FK checks? (3) Runnpm run build(4) If clean:gh pr merge 889 --rebase --delete-branch- Cherry-picked onto main. Comprehensive fix for FK constraint violations causing infinite retry loops and high CPU usage (#846). Core fix:
ensureMemorySessionIdRegistered()guard ensures parentsdk_sessionsrow has correctmemory_session_idbefore childobservationsINSERT. Schema migration 21 addsON UPDATE CASCADEto FK constraints so child rows follow parent updates. Also includes claim-confirm queue pattern (prevents message loss on crash), spawn deduplication (prevents duplicate generator starts), and unrecoverable error detection (breaks infinite restart loops). Build artifacts skipped (stale base), path fixes already merged via PR #634. All 838 tests passing, 4 new FK constraint tests + 8 zombie prevention tests added. 20 source/test files changed.
- Cherry-picked onto main. Comprehensive fix for FK constraint violations causing infinite retry loops and high CPU usage (#846). Core fix:
-
Review PR #833 (
fix: add PRAGMA foreign_keys to cleanup-duplicates.tsby @Glucksberg). Steps: (1)gh pr checkout 833(2) Check if the cleanup script context still exists and if PRAGMA foreign_keys is needed there (3) v8.5.6 fixed FK constraints — this may be stale. If so:gh pr close 833 --comment "FK constraint issues were addressed in v8.5.6. If a specific scenario remains, please describe and reopen. Thank you!"- Closed as stale. The PR references non-existent
observation_filesandobservation_conceptstables. In the current schema,observationsis a child ofsdk_sessionsand has no children of its own — soPRAGMA foreign_keys = ONbefore deleting observations has no CASCADE effect. FK constraint issues were comprehensively addressed in v8.5.6 (PR #889:ensureMemorySessionIdRegistered()guard,ON UPDATE CASCADEschema migration, claim-confirm queue pattern).
- Closed as stale. The PR references non-existent
Session Complete Hook
- Review PR #844 (
fix: add session-complete handler and hook to enable orphan reaper cleanupby @thusdigital). Steps: (1)gh pr checkout 844(2) Review — does the orphan reaper need a session-complete signal to work? Check if the 5-min reaper interval is sufficient without it. (3) If the hook adds meaningful cleanup triggers:gh pr merge 844 --rebase --delete-branch. If reaper already handles this: close.- Cherry-picked onto main. The orphan reaper was correctly implemented (5-min interval in ProcessRegistry.ts) but was ineffective because sessions were never removed from the active sessions map after summarize — so the reaper always saw all PIDs as "active" and never cleaned up. This caused zombie process accumulation (reported: 39+ processes, ~10GB on macOS after a single restart). PR adds session-complete as Stop phase 2 hook (after summarize, 30s timeout) that calls
POST /api/sessions/completeto remove sessions from the active map viaSessionCompletionHandler.completeByDbId(). 5 source files changed (new handler, handler registry, route, hooks.json, CLI help). Build artifacts skipped (stale base). 838 tests passing. Fixes #842.
- Cherry-picked onto main. The orphan reaper was correctly implemented (5-min interval in ProcessRegistry.ts) but was ineffective because sessions were never removed from the active sessions map after summarize — so the reaper always saw all PIDs as "active" and never cleaned up. This caused zombie process accumulation (reported: 39+ processes, ~10GB on macOS after a single restart). PR adds session-complete as Stop phase 2 hook (after summarize, 30s timeout) that calls