fix(memory): allow base session settings overrides for subclasses - #4842
fix(memory): allow base session settings overrides for subclasses#4842Hughhhhcoder wants to merge 2 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
sylvesterkaczmarek
left a comment
There was a problem hiding this comment.
Accepting any SessionSettings instance also accepts an incompatible sibling subclass. ASettings.resolve(BSettings(...)) will now apply common fields and silently discard B-only fields instead of rejecting the mismatch. Could this allow only base SessionSettings or instances compatible with type(self), and add a sibling-subclass regression?
|
Addressed in commit |
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
Thanks for catching this. Commit |
Fixes #4819
Bug
A session configured with a
SessionSettingssubclass cannot be used with aRunConfigsession-settings override. The run fails with aTypeErrorwhenRunConfigprovides a baseSessionSettingsinstance (including the dict form, whichRunConfignormalizes to the base type).Root cause
SessionSettings.resolve()coerced every non-dict override totype(self), rejecting a valid baseSessionSettingsinstance. It also read subclass-only fields without a default, so a base override could not be overlaid onto a subclass.Fix
SessionSettingsinstance when resolving an override, matching the existingModelSettingsbehavior.Nonedefault so base settings can be applied while preserving subclass-specific values.RunConfig-normalized base override.Validation
pytest -q tests/memory(204 passed)pytest -q tests/memory/test_session.py tests/test_run_config.py tests/memory/test_session_limit.py tests/memory/test_openai_conversations_session.py(154 passed)Runner.runreproduction completed successfully with the subclass settings preserved.