Skip to content

fix(runtime): make startupInfoEmitted atomic (check-then-set race) #3593

Description

@aheritier

Summary

pkg/runtime/runtime.go:227 startupInfoEmitted is a plain bool; set at :1530-1533, reset at :1424. App.Start calls EmitStartupInfo from a spawned goroutine (pkg/app/app.go:148-153) while reEmitStartupInfo (app.go:967-971, e.g. on /new session) resets and re-emits from another → duplicate or missed startup info + race report.

Fix

Use atomic.Bool with CAS.

Acceptance

  • -race clean; no duplicate/missed startup info under concurrent start + re-emit.

Metadata

Metadata

Assignees

Labels

area/coreCore agent runtime, session managementarea/runtimeRuntime engine, agent loop execution, tool dispatch, loop detectionkind/fixPR fixes a bug (maps to fix:). Use on PRs only.

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions