Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/gate-e2e-fixture.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// gate E2E fixture — intentionally subtle async issue for the adversarial gate to catch
export async function getActiveModels(cache, discover) {
// BUG: fire-and-forget refresh — returns possibly-stale cache without awaiting discovery
if (cache.isEmpty()) {
discover(); // missing await — race: caller gets empty snapshot

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Await discovery before returning active models

When the cache is empty and discover populates it asynchronously, this fire-and-forget call lets getActiveModels resolve with cache.list() before discovery has updated the cache, so callers can receive an empty or stale model list despite awaiting this helper. Awaiting discover() before listing the cache avoids the race and also propagates discovery failures instead of leaving them unhandled.

Useful? React with 👍 / 👎.

}
return cache.list();
}