Skip to content

Simplify Modal egress domain-list construction - #2587

Merged
xeophon merged 1 commit into
mainfrom
refactor/modal-egress-domains
Sep 11, 2026
Merged

Simplify Modal egress domain-list construction#2587
xeophon merged 1 commit into
mainfrom
refactor/modal-egress-domains

Conversation

@xeophon

@xeophon xeophon commented Sep 11, 2026

Copy link
Copy Markdown
Member

Simplify Modal's domain-list construction. This is a readability cleanup of the existing network-policy code.

Replace the nested expression with three statements that collect framework domains, append configured domains, and remove duplicates and loopback entries. Validation, domain ordering, and network-policy behavior stay the same.


Note

Low Risk
Readability-only refactor in egress allowlist assembly; network policy semantics are unchanged.

Overview
Refactors how prepare_execution builds the Modal outbound_domain_allowlist when routes is set: instead of one nested comprehension, it now collects framework route domains, extends with config.allow domains, then deduplicates while dropping None (loopback framework URLs).

No intended behavior change — validation still happens in _egress_domain, ordering is framework routes then allow rules, and the same RPC call still sends domain and CIDR lists for restricted sandboxes.

Reviewed by Cursor Bugbot for commit e7633d2. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Simplify Modal egress domain-list construction

Refactors the outbound domain allowlist in modal.py from a nested comprehension into explicit route collection, allow-rule extension, filtering, and order-preserving deduplication. The resulting domain ordering and omission of null domains stay equivalent to the prior implementation.

Macroscope summarized e7633d2.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@xeophon
xeophon requested a review from snimu September 11, 2026 11:04
@macroscopeapp

macroscopeapp Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at e7633d2

Macroscope's review found this PR approvable — This is a small, self-contained readability refactor of Modal egress-list construction. Input evaluation order, filtering, deduplication, and network-policy behavior remain unchanged.

You can add or adjust custom eligibility rules. Learn more.

@xeophon
xeophon merged commit eed55cf into main Sep 11, 2026
14 checks passed
@xeophon
xeophon deleted the refactor/modal-egress-domains branch September 11, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant