feat: add custom exceptions, runconfig, eventtype enum and async work…#17
feat: add custom exceptions, runconfig, eventtype enum and async work…#17jolovicdev merged 3 commits intomasterfrom
Conversation
|
@codex check this experimental PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c0ac66fde6
ℹ️ 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".
| current = {**self.__dict__} | ||
| current.update(kwargs) | ||
| return RunConfig(**current) |
There was a problem hiding this comment.
Deep-copy mutable fields when cloning RunConfig
with_overrides() copies self.__dict__ shallowly, so mutable fields (notably events, and also dicts like stream_options) are shared between the original and derived configs. When a caller reuses a base config and creates per-run overrides, one run mutates the same events list used by the other, which can mix event histories and produce incorrect report data (especially under concurrent runs).
Useful? React with 👍 / 👎.
|
@codex check both commits again. with_overrides() copies self.dict shallowly, so mutable fields (notably events, and also dicts like stream_options) are shared between the original and derived configs. When a caller reuses a base config and creates per-run overrides, one run mutates the same events list used by the other, which can mix event histories and produce incorrect report data (especially under concurrent runs). this is fixed. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bfe22b01fa
ℹ️ 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".
| default_model: str | None = None | ||
|
|
||
| def with_overrides(self, **kwargs: Any) -> "RunConfig": | ||
| current = copy.deepcopy(self.__dict__) |
There was a problem hiding this comment.
Avoid deep-copying adapter when applying config overrides
with_overrides now deep-copies the entire RunConfig.__dict__, so it also deep-copies adapter and emit instead of just mutable config containers; this breaks common custom adapters that hold non-picklable runtime state (for example, an adapter with a threading.Lock raises TypeError: cannot pickle '_thread.lock' object when with_overrides(...) is called). As a result, per-run override flows can fail at runtime even when only changing scalar fields, so the copy should be limited to mutable fields like events/stream_options rather than deep-copying the whole object graph.
Useful? React with 👍 / 👎.
…flow nodes