Skip to content

Commit 88cc3cb

Browse files
committed
Apply ruff formatting to context-window changes
1 parent f980720 commit 88cc3cb

2 files changed

Lines changed: 4 additions & 12 deletions

File tree

‎python_agent_harness/client.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,7 @@ def context_window(self) -> int:
237237
the default for that access and recovers once the file is fixed.
238238
"""
239239
try:
240-
return config.get_context_window_for_model(
241-
self.model, config_path=self._config_path
242-
)
240+
return config.get_context_window_for_model(self.model, config_path=self._config_path)
243241
except Exception:
244242
# a malformed context_windows section must not break the
245243
# loop: use the safe default, retry on the next access

‎tests/test_session.py‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -818,13 +818,9 @@ def test_switch_model_re_resolves_context_window(self):
818818
p = os.path.join(d, "config.json")
819819
with open(p, "w", encoding="utf-8") as f:
820820
f.write('{"context_windows": {"deepseek-v4*": 1000000}}')
821-
client = Client(
822-
base_url="http://x/v1", api_key="k", model="gpt-5-mini", config_path=p
823-
)
821+
client = Client(base_url="http://x/v1", api_key="k", model="gpt-5-mini", config_path=p)
824822
self.addCleanup(client.close)
825-
session = RecordingSession(
826-
model_profiles={"deepseek": {"model": "deepseek-v4-flash"}}
827-
)
823+
session = RecordingSession(model_profiles={"deepseek": {"model": "deepseek-v4-flash"}})
828824
session.client = client
829825
self.assertEqual(client.context_window, 128_000)
830826
success, _ = session.switch_model("deepseek")
@@ -835,9 +831,7 @@ def test_switch_model_resets_calibrator(self):
835831
"""Switching models must drop the token-calibration factor: it
836832
was tuned to the previous model's tokenizer and would skew the
837833
first context estimates for the new model."""
838-
session = RecordingSession(
839-
model_profiles={"deepseek": {"model": "deepseek-v4-flash"}}
840-
)
834+
session = RecordingSession(model_profiles={"deepseek": {"model": "deepseek-v4-flash"}})
841835
session.calibrator.factor = 2.5
842836
session.calibrator.last_raw_estimate = 1234
843837
success, _ = session.switch_model("deepseek")

0 commit comments

Comments
 (0)