docs(cli): say why the runtime snapshot deep-copies reasoning_config explicitly
Review flagged the key as emitted twice (by reference via _runtime_fields, then the explicit deepcopy). The override is intentional: _runtime_fields copies by reference and reasoning_config is a mutable dict, so dropping the explicit line would alias the snapshot to the live config. Comment only; no behaviour change.
This commit is contained in:
@@ -517,6 +517,7 @@ class CLIModelSwitchMixin:
|
||||
def _snapshot_model_runtime(self) -> dict:
|
||||
"""Capture current CLI and agent model runtime for one-turn restore."""
|
||||
agent = getattr(self, "agent", None)
|
||||
# ``reasoning_config`` is a mutable dict: deepcopy it so a later in-place edit cannot alias the snapshot.
|
||||
return {
|
||||
**_runtime_fields(self),
|
||||
"reasoning_config": copy.deepcopy(getattr(self, "reasoning_config", None)),
|
||||
|
||||
Reference in New Issue
Block a user