v1.3.112
v1.3.112
Bug Fixes
Fixed data race in IM emitter lastStatus and outputMode fields
The IMEmitter.lastStatus and IMEmitter.outputMode string fields were
accessed concurrently without synchronization:
lastStatuswritten fromEmitText/EmitUserTextExcept(agent stream
callback goroutine) and read/written fromEmitStatus(same goroutine), but
also reset from the TUI event loop goroutineoutputModewritten fromSetOutputMode(slash-command handler / TUI event
loop goroutine) and read fromOutputMode(agent stream callback goroutine)
Concurrent read/write of a Go string is undefined behavior — a string is a
(pointer, length) pair, so a concurrent reader can observe an inconsistent pair
that points to garbage memory. Added a sync.Mutex to protect both fields.