picoclaw/pkg/events
SiYue-ZO b292defd95 fix: add panic recovery to core-path goroutines
Add defer-recover to 11 goroutines across 4 files to prevent
ungoroutine panics from crashing the entire process:

- pkg/tools/toolloop.go: parallel tool execution
- pkg/channels/manager.go: HTTP server (x2), channel registration
- pkg/events/subscription.go: concurrent dispatch, timeout handler,
  watchContext
- pkg/tools/shell.go: cmd.Wait, PTY cmd.Wait, PTY read, pipe read

Key design decisions:
- Recover handlers send fallback values to channels (shell done,
  subscription done) to prevent deadlocks when the producer panics
- PTY cmd.Wait sets session.Status='error' on panic for consistency
- toolloop sets ErrorResult on panic so the LLM gets a meaningful
  response instead of a nil result
- subscription.go uses log.Printf to match existing invokeHandler style
- Other files use project logger (ErrorCF) with stack traces

Refs: FIX-PLAN-0.3.0 #2
2026-06-15 23:06:11 +08:00
..
bus.go fix(events): keep runtime observers non-blocking 2026-04-27 13:09:03 +08:00
channel.go feat(events): add runtime event bus 2026-04-26 15:36:03 +08:00
doc.go feat(events): add runtime event bus 2026-04-26 15:36:03 +08:00
events_test.go fix(events): keep runtime observers non-blocking 2026-04-27 13:09:03 +08:00
filter.go feat(events): add runtime event bus 2026-04-26 15:36:03 +08:00
filter_test.go feat(events): add runtime event bus 2026-04-26 15:36:03 +08:00
kind.go feat(bus): add backpressure drop budget for audio streams only 2026-06-11 13:55:56 +08:00
stats.go feat(events): add runtime event bus 2026-04-26 15:36:03 +08:00
subscription.go fix: add panic recovery to core-path goroutines 2026-06-15 23:06:11 +08:00
subscription_test.go fix(events): keep runtime observers non-blocking 2026-04-27 13:09:03 +08:00
types.go feat(events): add runtime event bus 2026-04-26 15:36:03 +08:00