Register scratch coroutine threads from coroutine units#320
Conversation
There was a problem hiding this comment.
💡 Codex Review
The new EnsureScratchThreadRegistered returns immediately when a thread ID is already present in flow.variables, so any later coroutine in the same script keeps using the first coroutine handle registered. In graphs that run multiple coroutine-based units sequentially (e.g., WaitSeconds then another WaitSeconds or a timed speech unit), StartScratchCoroutine will skip re-registration, leaving the thread manager pointing at an old coroutine. Stop blocks such as StopThisScript or StopOtherScratchThreadsOfActor will then stop the stale coroutine and leave the currently running one alive, so scripts cannot be reliably halted after the first coroutine unit executes. Consider updating the registered coroutine even when a thread ID already exists.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
Testing
Codex Task