- Add nil checks for session.TargetRef in all four execute*Action
handlers (Trader/Exchange/Model/Strategy) to prevent panic on
corrupted sessions; bulk-delete and query actions are excluded
- Add ensureHistory() helper and call it in runPlannedAgentWithContextMode
to prevent nil panic when history is not initialized
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add stopCh check in runPostResponseMaintenanceAsync to respect agent
shutdown, preventing goroutine leak on Agent.Stop()
- Replace bare context.Background() in handleTraderDiagnosisSkill with
a 30s timeout context for proper deadline propagation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>