Repository navigation
fix: Flag evaluations agent normal exit leak - #234
Merged
dustinbyrne merged 4 commits intoOct 29, 2026
Merged
dustinbyrne merged 4 commits into
dustinbyrne merged 4 commits into
Conversation
Each Evaluations snapshot starts an Agent linked to the calling process to track accessed keys. A linked process that isn't trapping exits ignores a :normal exit signal, so whenever the caller exited normally (a finished request, Task or job) the Agent was orphaned and lived for the life of the node. Trap exits in the Agent so it stops when its parent exits for any reason. Document that a snapshot is only usable while the process that created it is alive.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7300476475
ℹ️ 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".
dustinbyrne
approved these changes
Oct 29, 2026
5 of 6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💡 Motivation and Context
Right now these Agent are only shut down if the linked process crashes. If it exits normally, they continue living on forever.
This traps exits from the linked process and shuts down the agent when the process shuts down.
💚 How did you test it?
There are tests here!
📝 Checklist
If releasing new changes
sampo addto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted) — or — Fully autonomous
(local only).
:normalcaller exit but dies on:shutdownor a crash.:atomics-backed tracker. It removes the per-snapshot process entirely and lets snapshots outlive their creator, but it changesthe struct and makes
accessed/1drop keys that were read but absent from the snapshot. We went with the minimal fix instead; happy to follow up with the atomics approach if maintainers prefer.evaluate-flagsspec; it doesn't cover how access tracking is stored or how long it lives, so there's no divergence to call out.