fix(flex): keep execution internals replaceable - #73
Draft
isaacbmiller wants to merge 1 commit into
Draft
Conversation
Exclude the private bridge from whole-program persistence and rebuild it from canonical source after loading. Clarify interpreter and predictor-budget contracts so future source lowering and alternate CodeInterpreter implementations remain compatible.
| return state | ||
|
|
||
| def __setstate__(self, state: dict[str, Any]) -> None: | ||
| state.pop("_bridge", None) # Ignore bridges persisted by prerelease versions. |
Member
There was a problem hiding this comment.
Do we need this? There are no old Flex pickles out there anyway
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.
Summary
BridgeRuntimefrom whole-program pickles and rebuild it from canonicalmodule_srcafter loadinginterpreter_factorycreates sandbox sessions while Flex may validate/lower source and install its guest shimmax_predictor_callsaccounting unit and interpreter-dependent Python/library availabilityCodeInterpreter.toolswith the non-string JSON-compatible values Flex already bridgesThis draft is based on an exact mirror of Michael’s
michaelisaac-dev/dspy:feature/dspy-flexhead atb27168a(stanfordnlp/dspy#10047). GitHub’s integration does not have PR-write access to Michael’s fork, so the clean stacked diff is hosted incmpnd-ai/dspyfor review and can be applied directly to Michael’s branch.The change preserves
interpreter_factoryas the public execution hook without adding a premature backend/runtime abstraction, while avoiding persistence and documentation contracts that would block a later Monty-compatible source compiler and shim.Verification
172 passed, 165 skipped(Deno is not installed in the orb)CodeInterpreter, GEPA Flex integration, and Flex testsgit diff --checkpassedPrepared by Isaac Miller.