Skip to content

v1.3.112

Choose a tag to compare

@topcheer topcheer released this 03 Jul 20:01
· 4020 commits to main since this release

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:

  • lastStatus written from EmitText/EmitUserTextExcept (agent stream
    callback goroutine) and read/written from EmitStatus (same goroutine), but
    also reset from the TUI event loop goroutine
  • outputMode written from SetOutputMode (slash-command handler / TUI event
    loop goroutine) and read from OutputMode (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.