Repository navigation
Conversation
|
| ) | ||
| ): | ||
| self._temperature_unsupported = True | ||
| LLMClient._temperature_unsupported_models.add(self.model) |
There was a problem hiding this comment.
Temperature settings cross endpoints
The shared cache uses only self.model. If one endpoint rejects temperature, another endpoint using the same model name will also stop receiving the client's configured temperature. The TUI lets users switch providers and models without restarting, so this state can carry across those switches. Key the cache by endpoint and model, or keep it on the client.
Prompt To Fix With AI
This is a comment left during a code review.
Path: openhack/agents/llm.py
Line: 790
Comment:
**Temperature settings cross endpoints**
The shared cache uses only `self.model`. If one endpoint rejects temperature, another endpoint using the same model name will also stop receiving the client's configured temperature. The TUI lets users switch providers and models without restarting, so this state can carry across those switches. Key the cache by endpoint and model, or keep it on the client.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| self._status(f"model '{self.model}' rejected temperature — retrying without it") | ||
| continue |
There was a problem hiding this comment.
The temperature retry notice stays set when the retry succeeds on its first attempt. Each call to _chat starts its attempt count over, but _status("") runs only when attempt > 0. The TUI keeps showing “retrying without it” during later work until the scan ends. Clear the notice when this retry recovers.
Prompt To Fix With AI
This is a comment left during a code review.
Path: openhack/agents/llm.py
Line: 794-795
Comment:
**Retry warning stays visible**
The temperature retry notice stays set when the retry succeeds on its first attempt. Each call to `_chat` starts its attempt count over, but `_status("")` runs only when `attempt > 0`. The TUI keeps showing “retrying without it” during later work until the scan ends. Clear the notice when this retry recovers.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| LLMClient._temperature_unsupported_models.clear() | ||
| LLMClient._cache_key_unsupported = False |
There was a problem hiding this comment.
Tests leave shared flags changed
The new tests change shared state without restoring it. The combined test leaves _cache_key_unsupported true and the model in _temperature_unsupported_models. Later tests inherit those settings and may skip sending the parameters they are meant to check. Use a fixture with monkeypatch.setattr to give each test fresh flags and restore them afterward.
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/test_llm_retry.py
Line: 153-154
Comment:
**Tests leave shared flags changed**
The new tests change shared state without restoring it. The combined test leaves `_cache_key_unsupported` true and the model in `_temperature_unsupported_models`. Later tests inherit those settings and may skip sending the parameters they are meant to check. Use a fixture with `monkeypatch.setattr` to give each test fresh flags and restore them afterward.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Summary
Fixes #23.
Modern OpenAI models (
gpt-5.6-sol,gpt-5.6-luna,gpt-6.*) and OpenAI-compatible gateways reject requests specifyingtemperatureortemperature: 0.0, resulting in a 400 Bad Request error. Becausegpt-5.6-solis the default model for theopenaiprovider in OpenHack, out-of-the-box requests to OpenAI currently fail.Changes
LLMClient.chat(), catch 400 errors wheretemperatureis rejected as unsupported, mark the model inLLMClient._temperature_unsupported_models, log a warning, notify the UI status hook, and retry withouttemperature.LLMClient._chat(), omittemperaturefrom request parameters when marked unsupported for the model.prompt_cache_keyandtemperatureare rejected.tests/test_llm_retry.pycovering unsupported temperature values, unsupported temperature parameters, unhandled 400 errors, and combined prompt-cache + temperature rejection.