fix(kimi): cover remaining fixed-temperature bypasses

This commit is contained in:
helix4u 2026-04-17 20:39:24 -06:00 committed by Teknium
parent 53e4a2f2c6
commit 148459716c
7 changed files with 145 additions and 20 deletions

View file

@ -542,12 +542,7 @@ def _smart_approve(command: str, description: str) -> str:
(openai/codex#13860).
"""
try:
from agent.auxiliary_client import get_text_auxiliary_client, auxiliary_max_tokens_param
client, model = get_text_auxiliary_client(task="approval")
if not client or not model:
logger.debug("Smart approvals: no aux client available, escalating")
return "escalate"
from agent.auxiliary_client import call_llm
prompt = f"""You are a security reviewer for an AI coding agent. A terminal command was flagged by pattern matching as potentially dangerous.
@ -563,11 +558,11 @@ Rules:
Respond with exactly one word: APPROVE, DENY, or ESCALATE"""
response = client.chat.completions.create(
model=model,
response = call_llm(
task="approval",
messages=[{"role": "user", "content": prompt}],
**auxiliary_max_tokens_param(16),
temperature=0,
max_tokens=16,
)
answer = (response.choices[0].message.content or "").strip().upper()