Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions phoenix/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def _read_attempt(self, request, attempt, rc, timed_out):
limit = self.profile["environment_start_retries"]
if not patch and (timed_out or reason or rc != 0):
capture = capture_checkout(request, self.env, attempt,
official=self.settings["model"] != "kimi-k2.7-code" and self.settings["method"] not in REPAIR_METHODS and timed_out,
official=self.settings["method"] not in REPAIR_METHODS and timed_out,
timeout=request.get("capture_reserve", 60) or 60)
if capture["status"] == "captured":
patch = attempt / "captured.patch"
Expand Down Expand Up @@ -290,7 +290,7 @@ def generate(self, task, stage, *, allowance, final_stage, candidate=None, summa
history_path = (state.get("recovery") or {}).get("trajectory")
offset = state["steps"] - (len(read(history_path).get("trajectory", [])) if history_path else 0)
reserve = 0
if self.settings["method"] == SINGLE_METHOD and self.settings["model"] != "kimi-k2.7-code":
if self.settings["method"] == SINGLE_METHOD:
reserve = min(60, remaining / 2)
request = dict(task=task, settings=self.settings, stage_dir=str(attempt), base_agent=self.base,
run_id=self.run_id, job_id=fingerprint([str(stage), state["attempts"]])[:24],
Expand Down
5 changes: 1 addition & 4 deletions phoenix/capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ def execute(*args, limit=timeout):
target = "/root/phoenix_captured.patch"
if official:
command = staged_diff_command(repo, target)
elif request["settings"]["model"] == "kimi-k2.7-code":
command = ("cd " + shlex.quote(repo) + " && git add -N . && "
"git diff --binary --no-ext-diff HEAD > " + target)
else:
command = ("cd " + shlex.quote(repo) + " && git add -A && "
"git diff --binary --no-ext-diff HEAD > " + target)
Expand All @@ -118,7 +115,7 @@ def execute(*args, limit=timeout):
(attempt / "captured.patch").write_bytes(patch)
audit.update(status="captured", patch_sha256=digest(attempt / "captured.patch"),
patch_bytes=len(patch), snapshot_commit=head, image_id=record["Image"])
if not official and request["settings"]["model"] != "kimi-k2.7-code":
if not official:
audit["patched_tree"] = execute("git", "-C", repo, "write-tree").decode().strip()
return audit
except Exception as exc:
Expand Down
9 changes: 4 additions & 5 deletions phoenix/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@


def profile(api_model, temperature, top_p, context, output, thinking, *, extra=None,
timeout=240, tool_choice="auto", task_timeout=7200, release=None):
timeout=240, tool_choice="auto", release=None):
return dict(api_model=api_model, temperature=temperature, top_p=top_p,
max_input_tokens=context, max_tokens=output, thinking=thinking,
extra_body=extra if extra is not None else {"enable_thinking": thinking},
timeout=timeout, tool_choice=tool_choice, task_timeout=task_timeout, release=release)
timeout=timeout, tool_choice=tool_choice, task_timeout=7200, release=release)


PROFILES = {
Expand All @@ -40,8 +40,7 @@ def profile(api_model, temperature, top_p, context, output, thinking, *, extra=N
"qwen3.7-plus-thinking": profile("qwen3.7-plus", 1.0, 0.95, 1000000, 131072, True, timeout=600),
"qwen-3.8-max": profile("qwen-3.8-max", 1.0, 0.95, 1000000, 131072, False, timeout=600),
# Additional supported models outside the reported experiments.
"kimi-k2.7-code": profile("kimi-k2.7-code", 0.0, 1.0, 131072, 32768, True, task_timeout=3000,
extra={"enable_thinking": True, "preserve_thinking": True}),
"kimi-k2.7-code": profile("kimi-k2.7-code", 0.0, 1.0, 131072, 32768, True),
"deepseek-v4.1-flash": profile("deepseek-v4.1-flash", 0.0, 1.0, 131072, 32768, False, tool_choice="required"),
}

Expand Down Expand Up @@ -237,7 +236,7 @@ def localization_config(settings):
limit = settings.get("max_input_tokens", PROFILES[model]["max_input_tokens"])
data["localization_runtime"] = {
"inference": inference_fields(model),
"api_timeout": 240 if model == "kimi-k2.7-code" else 600,
"api_timeout": 600,
"tool_choice": "auto", "task_timeout": settings.get("localization_timeout"),
"action_repeat_limit": 10, "max_compacted_tokens": limit * 110000 // 131072,
"context_compaction_threshold": limit * 100000 // 131072,
Expand Down
6 changes: 1 addition & 5 deletions phoenix/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def summarize(task, candidates, settings, directory, key):
prompt += SUMMARY_GUIDANCE
(directory / "prompt.txt").write_text(prompt)
write_json(directory / "inputs.json", [{k: v for k, v in row.items() if k != "submission"} for row in inputs])
kimi = settings["model"] == "kimi-k2.7-code"
payload = dict(inference_fields(settings["model"]), messages=[{"role": "user", "content": prompt}])
timeout = (30, PROFILES[settings["model"]]["timeout"])
bind(directory / "identity.json", {"payload": payload, "api_base": settings["api_base"],
Expand Down Expand Up @@ -129,10 +128,7 @@ def transport_failure():
except (ValueError, KeyError, IndexError, TypeError, AttributeError):
transport_failure()
continue
valid = bool(answer.strip())
if kimi and choice.get("finish_reason") == "length":
valid = False
if valid:
if answer.strip():
if trajectory_path is not None:
publish_trajectory(response)
(directory / "summary.txt").write_text(answer)
Expand Down
3 changes: 1 addition & 2 deletions phoenix/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,7 @@ def watchdog():
from phoenix.capture import capture_checkout
try:
capture_checkout(request, os.environ.copy(), stage,
official=request["settings"]["method"] not in REPAIR_METHODS
and request["settings"]["model"] != "kimi-k2.7-code",
official=request["settings"]["method"] not in REPAIR_METHODS,
timeout=request.get("capture_reserve", 60))
finally:
current = process_identity(os.getpid())
Expand Down
7 changes: 5 additions & 2 deletions tests/test_repair.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def test_frozen_location_identity_and_complete_coverage(tmp_path, task, candidat
("qwen3.7-plus", "qwen3.7-plus", 1.0, 0.95, 1000000, 131072, False),
("qwen3.7-plus-thinking", "qwen3.7-plus", 1.0, 0.95, 1000000, 131072, True),
("qwen-3.8-max", "qwen-3.8-max", 1.0, 0.95, 1000000, 131072, False),
("kimi-k2.7-code", "kimi-k2.7-code", 0.0, 1.0, 131072, 32768, True),
])
@pytest.mark.parametrize("candidate_count", [1, 2])
def test_complete_localization_to_final_patch(monkeypatch, tmp_path, task, candidate, settings, model, candidate_count,
Expand All @@ -110,7 +111,8 @@ def check_request(payload):
assert "max_tokens" not in payload
else:
assert payload["max_tokens"] == output
if model in {"glm-5.2", "qwen3.7-plus", "qwen3.7-plus-thinking", "qwen-3.8-max"}:
assert "preserve_thinking" not in payload
if model in {"glm-5.2", "qwen3.7-plus", "qwen3.7-plus-thinking", "qwen-3.8-max", "kimi-k2.7-code"}:
assert payload["enable_thinking"] is thinking
elif model == "glm-4.7":
assert payload["thinking"] == {"type": "enabled"}
Expand Down Expand Up @@ -156,7 +158,8 @@ def post(self, url, **kwargs):
class Response:
ok = True
def json(self):
return dict(choices=[dict(message=dict(content="Implement the required constant and verify callers."))])
return dict(choices=[dict(finish_reason="length", message=dict(
content="Implement the required constant and verify callers."))])
return Response()
def close(self):
pass
Expand Down
Loading