How to refresh timeline after update to AnimationClip

I am working on some editor tools for recording object motion. In the editor, at playtime I have a script that generates new AnimationCurves for an Animation Clip thats on the timeline. The problem is that after I have updated it, changes are reflected in the timeline playback until after I exit playmode.

I have tried have the director rebuild the graph, as well as asking the asset database to save all changes. What do I need to do to get the timeline to update immediately?

You can do this in 2018.3 using a new API call: Unity - Scripting API: Timeline.TimelineEditor.Refresh.

Before that you could un-select and re-select the playable Director, which only works if the timeline window isn’t locked.