Skip to content

Support pausing criteria on external generation nodes (#5303) - #5303

Closed
ltiao wants to merge 1 commit into
meta:mainfrom
ltiao:export-D126124332
Closed

ltiao wants to merge 1 commit into
meta:mainfrom
ltiao:export-D126124332

Conversation

@ltiao

@ltiao ltiao commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

Why

External generators need the same generation limits as other generation nodes. Their constructor currently cannot accept the existing pausing criteria.

Changes

  • Accept optional pausing_criteria and pass them to GenerationNode. Existing callers keep their current behavior.
  • Test that a configured trial limit blocks the next external candidate.

Examples

Before

# In an ExternalGenerationNode subclass:
super().__init__(name="external", pausing_criteria=[MaxTrialsAwaitingData(threshold=1, not_in_statuses=[])])
# TypeError: unexpected keyword argument 'pausing_criteria'

After

super().__init__(name="external", pausing_criteria=[MaxTrialsAwaitingData(threshold=1, not_in_statuses=[])])
# One trial can be generated and attached. The next request raises DataRequiredError.

Reviewed By: saitcakmak

Differential Revision: D126124332

@meta-cla meta-cla Bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Oct 19, 2026
@meta-codesync

meta-codesync Bot commented Oct 19, 2026

Copy link
Copy Markdown

@ltiao has exported this pull request. If you are a Meta employee, you can view the originating Diff in D126124332.

@meta-codesync meta-codesync Bot changed the title Support pausing criteria on external generation nodes Support pausing criteria on external generation nodes (#5303) Oct 19, 2026
ltiao added a commit to ltiao/Ax that referenced this pull request Oct 19, 2026
Summary:

# Why

External generators need the same generation limits as other generation nodes. Their constructor currently cannot accept the existing pausing criteria.

# Changes

- Accept optional `pausing_criteria` and pass them to `GenerationNode`. Existing callers keep their current behavior.
- Test that a configured trial limit blocks the next external candidate.

# Examples

## Before

```python
# In an ExternalGenerationNode subclass:
super().__init__(name="external", pausing_criteria=[MaxTrialsAwaitingData(threshold=1, not_in_statuses=[])])
# TypeError: unexpected keyword argument 'pausing_criteria'
```

## After

```python
super().__init__(name="external", pausing_criteria=[MaxTrialsAwaitingData(threshold=1, not_in_statuses=[])])
# One trial can be generated and attached. The next request raises DataRequiredError.
```

Reviewed By: saitcakmak

Differential Revision: D126124332
@ltiao
ltiao force-pushed the export-D126124332 branch from 0d8e273 to c287a03 Compare October 19, 2026 20:03
ltiao added a commit to ltiao/Ax that referenced this pull request Oct 19, 2026
Summary:
Pull Request resolved: meta#5303

# Why

External generators need the same generation limits as other generation nodes. Their constructor currently cannot accept the existing pausing criteria.

# Changes

- Accept optional `pausing_criteria` and pass them to `GenerationNode`. Existing callers keep their current behavior.
- Test that a configured trial limit blocks the next external candidate.

# Examples

## Before

```python
# In an ExternalGenerationNode subclass:
super().__init__(name="external", pausing_criteria=[MaxTrialsAwaitingData(threshold=1, not_in_statuses=[])])
# TypeError: unexpected keyword argument 'pausing_criteria'
```

## After

```python
super().__init__(name="external", pausing_criteria=[MaxTrialsAwaitingData(threshold=1, not_in_statuses=[])])
# One trial can be generated and attached. The next request raises DataRequiredError.
```

Reviewed By: saitcakmak

Differential Revision: D126124332
@ltiao
ltiao force-pushed the export-D126124332 branch from c287a03 to 3740282 Compare October 19, 2026 20:07
Summary:
Pull Request resolved: meta#5303

# Why

External generators need the same generation limits as other generation nodes. Their constructor currently cannot accept the existing pausing criteria.

# Changes

- Accept optional `pausing_criteria` and pass them to `GenerationNode`. Existing callers keep their current behavior.
- Test that a configured trial limit blocks the next external candidate.

# Examples

## Before

```python
# In an ExternalGenerationNode subclass:
super().__init__(name="external", pausing_criteria=[MaxTrialsAwaitingData(threshold=1, not_in_statuses=[])])
# TypeError: unexpected keyword argument 'pausing_criteria'
```

## After

```python
super().__init__(name="external", pausing_criteria=[MaxTrialsAwaitingData(threshold=1, not_in_statuses=[])])
# One trial can be generated and attached. The next request raises DataRequiredError.
```

Reviewed By: saitcakmak

Differential Revision: D126124332
@ltiao
ltiao force-pushed the export-D126124332 branch from 3740282 to 01f5ea3 Compare October 19, 2026 20:12
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.60%. Comparing base (34f5ff6) to head (01f5ea3).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5303   +/-   ##
=======================================
  Coverage   96.59%   96.60%           
=======================================
  Files         621      621           
  Lines       71054    71064   +10     
=======================================
+ Hits        68638    68651   +13     
+ Misses       2416     2413    -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@meta-codesync meta-codesync Bot closed this in 80694ce Oct 19, 2026
@meta-codesync meta-codesync Bot added the Merged label Oct 19, 2026
@meta-codesync

meta-codesync Bot commented Oct 19, 2026

Copy link
Copy Markdown

This pull request has been merged in 80694ce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity. Merged meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants