feat: remove openai tts params check - #2288
Conversation
|
Review of Thanks for this. The direction — free-form 1. if "url" in self.params:
value = self.params["url"]
self.url = value if isinstance(value, str) else None
self.params.pop("url", None)
else:
base_url = self.params.get("base_url", "https://api.openai.com/v1")
if not isinstance(base_url, str):
base_url = "https://api.openai.com/v1" # <-- falls backThe two branches are inconsistent.
Suggestion: fall through to the 2. Silent coercion with no diagnostics All three guards swallow bad input silently. Per 3.
A range check collapses all of these into one guard and is cheap: speed = _safe_float(self.params.get("speed", 1.0), 1.0)
self.params["speed"] = speed if 0.25 <= speed <= 4.0 else 1.0
4. Verify the schema loader reading of empty
5. Convention drift Of 12 TTS extensions I sampled, 11 enumerate their Could you add a description covering the motivation? I suspect it is env-var expansion: an expression like 6. No test coverage for the new branches Three new guards, zero tests. Existing tests only pass well-typed values, so every fallback path is uncovered.
Since the removal of the manifest schema is the crux, a test that loads a Existing assertions on Minor
Verification note I reviewed this statically. I could not execute the test suite — Nothing here is a security concern: |
e2ce09a to
1cd4021
Compare
|
Review of "feat: remove openai tts params check" The motivation makes sense: declaring a fixed The concern is that removing schema validation makes 1. Non-string if "url" in self.params:
value = self.params["url"]
self.url = value if isinstance(value, str) else None
self.params.pop("url", None)When async with self.client.stream("POST", self.config.url, headers=self.headers, json=payload)Calling 2. Coercing a bad if "api_key" in self.params and not isinstance(self.params["api_key"], str):
self.params["api_key"] = ""
3. Type guards are now inconsistent across params
4. It only catches
Rejecting 5. No tests for any of the new behavior This is the gap I would most want closed before merge. The purpose of the PR is relaxing validation, which shifts responsibility onto these coercion paths, and Minor points:
Issue 1 is the one I would treat as blocking; the rest are judgment calls. Good to see the version bump handled in both files, which is easy to miss. |
|
Review: feat: remove openai tts params check The core idea — stop declaring vendor params in the manifest and defend in code instead — is sound, and Verification note. 1. The new URL check in def validate(self) -> None:
if not isinstance(self.url, str) or not self.url.strip():
raise ValueError("URL is required for OpenAI TTS")
The new test does not distinguish these cases, because it manufactures state that cannot occur naturally: config.update_params()
config.url = "" # <-- re-blanked by hand
config.validate()Could you confirm the order 2. Out-of-range if not math.isfinite(converted) or not 0.25 <= converted <= 4.0:
return defaultSilent 1.0 on out-of-range. A user asking for The range contradicts the premise. This PR removes manifest-level validation so params can pass through freely — and Naming. Minor: 3. Leftover
payload = {**self.config.params}
payload.pop("api_key", None)
payload.pop("base_url", None) # note: no pop("url")so 4. Security: the new test codifies an unencrypted
"api_key": _mask_metadata_secret(self.config.params.get("api_key", "")),
"authorization": authorization, # <-- not masked
assert metadata["authorization"] == "Bearer header-secret"Per L1 08_security and the sensitive-logging convention, I would route it through 5. from ..config import OpenAITTSConfig
from ..extension import OpenAITTSExtensionAll 12 other import sites in Also in that file:
6. Coverage gaps The speed tests only assert the fallback path. An implementation that unconditionally returned
Style: 7. Manifest: empty I read a sample of peer manifests —
Minor: removing declared schema fields is arguably a minor bump rather than Before merge. Per L1 04_conventions, CI runs both sudo docker exec ten_agent_dev bash -c "cd /app && task format && task check && task lint"Blocking for me: 1 (confirm the |
Review:
|
No description provided.