fix: harden debug logging and LLM endpoint validation - #57
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1b9b94f919
ℹ️ 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".
| except ValueError: | ||
| self._data["llm_base_url"] = "" | ||
| self._has_unsafe_llm_base_url = True |
There was a problem hiding this comment.
Block migrated endpoints instead of defaulting to OpenAI
When a legacy custom or openrouter configuration contains a public HTTP URL and an API key is set, clearing only llm_base_url leaves the non-OpenAI provider selected. _build_llm_service() then passes the empty URL to LLMService, which converts it to base_url=None; the OpenAI SDK consequently uses its default OpenAI endpoint. An LLM workflow can therefore send the transcript and custom-provider credential to OpenAI before the user ever sees the settings warning. Preserve an explicit blocked state or otherwise prevent requests until the user supplies a valid endpoint.
Useful? React with 👍 / 👎.
| try: | ||
| address = ipaddress.ip_address(hostname) | ||
| except ValueError as exc: | ||
| raise ValueError("LLM base URL requires HTTPS for non-local endpoints") from exc |
There was a problem hiding this comment.
Validate the endpoint before mutating the live configuration
When a user enters a public HTTP endpoint, this new exception is raised only after SettingsDialog.save_settings() has already assigned the model, backend, language, hotkey, API-key environment, and provider to the shared config object. The error dialog prevents saving and acceptance, but it does not roll those assignments back; cancelling afterward leaves partial settings active in memory, and a later preset change calls config.save() and persists them. Validate the URL before any assignments or stage changes in a copy until all validation succeeds.
Useful? React with 👍 / 👎.
Security fixes
Verification
571 passed, 2 skipped, 0 failedgit diff --checkcleanNo secrets, raw logs, or sensitive input are included.