diff --git a/phoenix/backend.py b/phoenix/backend.py index 30bc80e..19832ef 100644 --- a/phoenix/backend.py +++ b/phoenix/backend.py @@ -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" @@ -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], diff --git a/phoenix/capture.py b/phoenix/capture.py index cbdd00b..139e9eb 100644 --- a/phoenix/capture.py +++ b/phoenix/capture.py @@ -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) @@ -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: diff --git a/phoenix/settings.py b/phoenix/settings.py index 548bb96..62171bf 100644 --- a/phoenix/settings.py +++ b/phoenix/settings.py @@ -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 = { @@ -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"), } @@ -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, diff --git a/phoenix/summary.py b/phoenix/summary.py index 8cc376a..d415da9 100644 --- a/phoenix/summary.py +++ b/phoenix/summary.py @@ -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"], @@ -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) diff --git a/phoenix/worker.py b/phoenix/worker.py index d2299e5..73287f6 100644 --- a/phoenix/worker.py +++ b/phoenix/worker.py @@ -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()) diff --git a/tests/test_repair.py b/tests/test_repair.py index 0ae3267..edc4d28 100644 --- a/tests/test_repair.py +++ b/tests/test_repair.py @@ -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, @@ -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"} @@ -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