@@ -164,6 +164,10 @@ class _HarborEvaluationFields(StrictModel):
164164 expose_attempt_detail: Report per-attempt detail, not just the aggregate.
165165 extra_harbor_args: Extra flags for the evaluation sub-run. Rejected if
166166 they override a flag the compiler controls.
167+ optimizer_harbor_args: Extra flags for the outer harbor run that hosts
168+ the optimizer trial. Distinct from extra_harbor_args, which tunes
169+ the nested evaluation sub-run. Rejected if they override a flag
170+ `vero harbor run` controls.
167171 task_agent_timeout_seconds: Wall clock declared for the target agent.
168172 Grouped here rather than with the other timeouts because it bounds
169173 the target, which only a Harbor backend runs.
@@ -198,6 +202,13 @@ class _HarborEvaluationFields(StrictModel):
198202 feedback_max_bytes : int = Field (default = 3000 , ge = 0 )
199203 expose_attempt_detail : bool = False
200204 extra_harbor_args : list [str ] = Field (default_factory = list )
205+ # Extra flags for the OUTER `harbor run` that hosts the optimizer trial
206+ # (`vero harbor run`). Distinct from `extra_harbor_args`: that one tunes the
207+ # nested eval sub-run, this one tunes the environment the optimizer itself
208+ # lives in. A build declares here what its optimizer trial needs to survive,
209+ # e.g. `--ek modal_vm_runtime=true` for a long trial whose teardown keeps
210+ # losing the DinD gRPC stream.
211+ optimizer_harbor_args : list [str ] = Field (default_factory = list )
201212 task_agent_timeout_seconds : float = Field (default = 600.0 , gt = 0 )
202213 task_environment : dict [str , str ] = Field (default_factory = dict )
203214 task_services_use_upstream : bool = False
@@ -239,6 +250,22 @@ def validate_extra_harbor_args(cls, value: list[str]) -> list[str]:
239250 )
240251 return value
241252
253+ @field_validator ("optimizer_harbor_args" )
254+ @classmethod
255+ def validate_optimizer_harbor_args (cls , value : list [str ]) -> list [str ]:
256+ # `vero harbor run` owns the outer command's task, agent, environment and
257+ # model; a build must not fight the CLI over them.
258+ controlled = {"-a" , "-e" , "-m" , "-p" }
259+ conflicts = [
260+ argument for argument in value if argument .split ("=" , 1 )[0 ] in controlled
261+ ]
262+ if conflicts :
263+ raise ValueError (
264+ "optimizer_harbor_args override controlled flags: "
265+ + ", " .join (conflicts )
266+ )
267+ return value
268+
242269
243270# The fields a command build must not set, derived from the class above so the
244271# two cannot drift. Setting one is a mistake worth reporting: it would be
0 commit comments