Make provider sampler params opt-in; drop escalation preset

Sampler parameters (temperature/top_p/presence_penalty/frequency_penalty)
now default to None and are omitted from the request payload when unset, so
the server's model/Modelfile default applies. The provider no longer guesses
values on the user's behalf; callers opt in via config or a per-chat override.

- provider.OpenAICompatClient / llm.LLMClient: default the four params to None
  and only include them in the payload when set (max_tokens/reasoning_effort
  already behaved this way).
- cli.build_scheduler: pass None when the config key is absent via _opt_float,
  instead of hardcoded numeric fallbacks.
- codegen: remove ESCALATED_SAMPLER and its use on retries (body, elicitation,
  testgen, regen). The retry ladder keeps the fresh short prompt but reuses the
  configured/omitted sampler; appropriate values can't be known in advance for
  arbitrary user models.
- console: no functional change; the hosted Console API now receives no sampler
  params by default.
- Tests cover omit-by-default, send-when-configured, per-call override, and the
  no-escalation retry.
- Docs: config.example.json comments, provider/llm/codegen/console docstrings,
  AGENTS.md.
This commit is contained in:
gabby committed 2026-10-02 13:00:50 +00:00
1 parent 8afb488dc4
commit 5747ad2fa6
11 files changed
+223 -105

No files matched your search

+5 -1
View File
@@ -12,7 +12,7 @@ import time
import pytest
from semif_agent.cli import build_scheduler, load_config
from semif_agent.cli import _opt_float, build_scheduler, load_config
from semif_agent.codegen import (
CodegenClient,
generate_skill_body,
@@ -306,6 +306,10 @@ def test_generate_skill_body_codegen(tmp_path):
model=codegen_cfg.get("model", "qwen38-iq3s"),
timeout=float(codegen_cfg.get("timeout", 1200.0)),
stream=True,
temperature=_opt_float(codegen_cfg.get("temperature")),
top_p=_opt_float(codegen_cfg.get("top_p")),
presence_penalty=_opt_float(codegen_cfg.get("presence_penalty")),
frequency_penalty=_opt_float(codegen_cfg.get("frequency_penalty")),
)
tree = build_tree(build_skills({"skills": {}}))
draft = SkillDraft(