Integrate M4-LLM error handling into develop #349

Merged
jason.woltje merged 4 commits from feature/m4-llm-integration into develop 2026-02-07 02:38:21 +00:00
Owner

Summary

  • Port high-value error handling features from branch into develop's security-hardened codebase
  • Separate LLM vs persistence error handling in useChat (assistant response still visible when save fails)
  • Add structured error context logging (errorType, messagePreview, messageCount) for debugging
  • Enforce state invariant: chat overlay cannot be minimized when closed
  • Add onStorageError callback with user-friendly messages and per-error-type deduplication
  • Add error logging to Chat imperative handle methods
  • Create Chat.test.tsx with loadConversation failure mode coverage

What was skipped (superseded by develop)

  • AbortSignal/timeout (develop has centralized client timeout + CSRF)
  • Custom toast system (duplicates @mosaic/ui toast)
  • ErrorBoundary (develop has its own)
  • WebSocket typed events (develop's ref-based pattern prevents stale closures)
  • Scratchpad files (working documents)

Test plan

  • All 806 web tests pass (73 test files, 23 skipped)
  • Lint clean ()
  • TypeScript compiles with no errors
  • Pre-commit hooks pass (prettier, eslint, typecheck, git-secrets)
  • State rejected by isChatOverlayState

Generated with Claude Code

## Summary - Port high-value error handling features from branch into develop's security-hardened codebase - Separate LLM vs persistence error handling in useChat (assistant response still visible when save fails) - Add structured error context logging (errorType, messagePreview, messageCount) for debugging - Enforce state invariant: chat overlay cannot be minimized when closed - Add onStorageError callback with user-friendly messages and per-error-type deduplication - Add error logging to Chat imperative handle methods - Create Chat.test.tsx with loadConversation failure mode coverage ## What was skipped (superseded by develop) - AbortSignal/timeout (develop has centralized client timeout + CSRF) - Custom toast system (duplicates @mosaic/ui toast) - ErrorBoundary (develop has its own) - WebSocket typed events (develop's ref-based pattern prevents stale closures) - Scratchpad files (working documents) ## Test plan - [x] All 806 web tests pass (73 test files, 23 skipped) - [x] Lint clean () - [x] TypeScript compiles with no errors - [x] Pre-commit hooks pass (prettier, eslint, typecheck, git-secrets) - [x] State rejected by isChatOverlayState Generated with [Claude Code](https://claude.com/claude-code)
jason.woltje added 1 commit 2026-02-07 02:05:58 +00:00
feat(web): Integrate M4-LLM error handling improvements
Some checks failed
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline failed
893a139087
Port high-value features from work/m4-llm branch into develop's
security-hardened codebase:

- Separate LLM vs persistence error handling in useChat (shows
  assistant response even when save fails)
- Add structured error context logging with errorType, messagePreview,
  messageCount fields for debugging
- Enforce state invariant in useChatOverlay: cannot be minimized when
  closed
- Add onStorageError callback with user-friendly messages and
  per-error-type deduplication
- Add error logging to Chat imperative handle methods
- Create Chat.test.tsx with loadConversation failure mode tests

Skipped from work/m4-llm (superseded by develop):
- AbortSignal timeout (develop has centralized client timeout)
- Custom toast system (duplicates @mosaic/ui)
- ErrorBoundary (develop has its own)
- WebSocket typed events (develop's ref-based pattern is superior)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jason.woltje added 2 commits 2026-02-07 02:25:57 +00:00
Add sprint archival instructions so completed tasks.md files are
retained in docs/tasks/ for post-mortem reference. Includes recovery
behavior when an orchestrator finds no active tasks.md.

Archive M6-AgentOrchestration-Fixes: 88/90 done, 2 deferred.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix(web): Address review findings for M4-LLM integration
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/pr/woodpecker Pipeline was successful
f64ca3871d
- Sanitize user-facing error messages (no raw API/DB errors)
- Remove dead try/catch from Chat.tsx handleSendMessage
- Add onError callback for persistence errors in useChat
- Add console.error logging to loadConversation
- Guard minimize/toggleMinimize against closed overlay state
- Improve error dedup bucketing for non-DOMException errors
- Add tests: non-Error throws, updateConversation failure,
  minimize/toggleMinimize guards

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jason.woltje added 1 commit 2026-02-07 02:34:45 +00:00
fix(web): Remove re-throw from loadConversation to prevent unhandled rejections
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/pr/woodpecker Pipeline failed
69cc3f8e1e
- Make loadConversation fully self-contained like sendMessage (handle
  errors internally via state, onError callback, and structured logging)
- Remove duplicate try/catch+log from Chat.tsx imperative handle
- Replace re-throw tests with delegation and no-throw tests
- Add hook-level loadConversation error path tests (getIdea rejection)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jason.woltje merged commit 65e56cac5e into develop 2026-02-07 02:38:21 +00:00
jason.woltje deleted branch feature/m4-llm-integration 2026-02-07 02:38:22 +00:00
Sign in to join this conversation.