Repository navigation
chore(benchmark): compose optional native collaboration parity #8230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
huangruiteng
wants to merge
2
commits into
codex/edgebench-integration-r33-20261107
from
codex/edgebench-integration-r34-20261107
+299
−12
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,7 @@ | |
| from benchmark.edgebench.feedback import FEEDBACK_MODES | ||
| from benchmark.edgebench.feedback_hook import FEEDBACK_PAYLOAD | ||
|
|
||
| from .codex import DEFAULT_REPLAN_AFTER_TURNS, Execution, codex_settings, prepare_codex_home | ||
| from .codex import DEFAULT_REPLAN_AFTER_TURNS, Execution, codex_settings, native_child_instructions, prepare_codex_home | ||
| from .codex_offline import CodexOffline, MODEL_CATALOG_REMOTE, stage_portable_python | ||
| from .harbor import ( | ||
| BenchmarkCodex, _CONTROL, _CODEX_HOME, _PYTHON, _SCHEDULER_STATE, _SRC, | ||
|
|
@@ -93,6 +93,7 @@ def __init__(self, config, *, profile: str, cwd: str, | |
| task_entry: str | None = None, | ||
| turn_envelope: bool = False, | ||
| context_delivery: str | None = None, | ||
| native_child_limit: int | None = None, | ||
| provider_request_admission: bool = False, | ||
| native_goal_continue: bool = False, | ||
| replan_after_turns: int | None = None, | ||
|
|
@@ -110,6 +111,13 @@ def __init__(self, config, *, profile: str, cwd: str, | |
| ): | ||
| raise ValueError("turn_envelope requires a heartbeat worker") | ||
| self.turn_envelope = turn_envelope | ||
| self.native_child_limit = Execution(mode="plain", native_child_limit=native_child_limit).native_child_limit | ||
| if native_child_limit is not None: | ||
| if not feedback_prompt or not workspace_instructions: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] 请先校验原始工作区说明与任务包装,再拼接授权。实际 SForgeWorker 对只含空白的原说明在省略选项时拒绝,显式上限 3 时接受。新增前缀替原始输入通过了非空校验。把现有 native feedback、非空和前缀校验移到拼接之前,并覆盖空白反例。 |
||
| raise ValueError("Native child authorization requires the explicit task prompt and workspace instructions") | ||
| authorization = native_child_instructions(native_child_limit) | ||
| feedback_prompt = authorization + feedback_prompt | ||
| workspace_instructions = authorization + workspace_instructions | ||
| self.context_delivery = Execution( | ||
| mode="heartbeat" if profile.startswith("heartbeat-") else "plain", | ||
| context_delivery=context_delivery, | ||
|
|
@@ -305,7 +313,7 @@ def _install_worker(self, backend, handle, log_dir, logger): | |
| shutil.copyfile(os.environ["CODEX_AUTH_JSON_PATH"], home / "auth.json") | ||
| (home / "auth.json").chmod(0o600) | ||
| prepare_codex_home( | ||
| home, execution=Execution(mode="plain"), workspace=Path(self.cwd), | ||
| home, execution=Execution(mode="plain", native_child_limit=self.native_child_limit), workspace=Path(self.cwd), | ||
| model=self._config.agent_model, effort=effort, | ||
| base_url=runtime_base_url or "", | ||
| api_key=runtime_api_key or "", wire_api="responses", skills=None, | ||
|
|
@@ -336,6 +344,7 @@ def _install_worker(self, backend, handle, log_dir, logger): | |
| task_entry=self.task_entry, | ||
| turn_envelope=self.turn_envelope, | ||
| context_delivery=self.context_delivery, | ||
| native_child_limit=self.native_child_limit, | ||
| **({"provider_request_admission": True} if self.provider_request_admission else {}), | ||
| native_goal_continue=self.native_goal_continue, | ||
| replan_after_turns=self.replan_after_turns, | ||
|
|
@@ -428,6 +437,8 @@ def _install_worker(self, backend, handle, log_dir, logger): | |
| **({"planning_timeout_seconds": None} | ||
| if self.task_entry == "loopx-planned" else {}), | ||
| "stop_hook": self.profile == "official", | ||
| **({"native_child_limit": self.native_child_limit} | ||
| if self.native_child_limit is not None else {}), | ||
| **(self.runtime._turn_envelope_receipt() if self.runtime is not None else {}), | ||
| **({"provider_request_admission": "on"} if self.provider_request_admission else {}), | ||
| **({"native_goal_continue": True} if self.native_goal_continue else {}), | ||
|
|
@@ -482,8 +493,11 @@ def format_run_cmd(self, prompt_path, *, model=None, cwd="", internet=True, resu | |
| # The sealed Goal, task graph, review counters and strategy | ||
| # are the continuing state. Do not bootstrap, seed another | ||
| # task, or reset an existing configuration during restore. | ||
| if self.native_child_limit is not None: | ||
| asyncio.run(self.runtime._verify_phase_configuration(self.environment, cwd=self.cwd)) | ||
| asyncio.run(self.runtime._write_task_document(self.environment, result.stdout)) | ||
| asyncio.run(self.runtime._verify_phase_configuration(self.environment, cwd=self.cwd)) | ||
| if self.native_child_limit is None: | ||
| asyncio.run(self.runtime._verify_phase_configuration(self.environment, cwd=self.cwd)) | ||
| else: | ||
| asyncio.run(self.runtime._prepare_phase(self.environment, result.stdout, cwd=self.cwd)) | ||
| if self.profile == "heartbeat-explore" and self.warm_start is None: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P1] 请在原生激活前比对请求上限与已验证的封存配置。实际 CLI 从封存 3 恢复时漏传或传 2,以及从省略恢复时传 3,三项都到达 checkpoint_controller.restore。成功激活会建立目的地及其剩余时间,后续 worker 一致性检查已经太晚。请在当前 WarmStart/config owner 比较可选值,测试两项合法匹配能通过、三项不匹配在激活前拒绝。