You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: don't refuse warm-machine commands in CI or advertise absent Lab (#8342)
The resource-policy warm-machine guard refused non-interactive commands
inside GitHub Actions, failing otherwise-good PR checks with no human to
rerun and no Lab runner to route to (#7735). Bypass the non-interactive
refusal when GITHUB_ACTIONS=true via a new is_ci_execution() helper.
The same guard also recommended connecting/using a Lab runner even on
hosts with no Lab configured, steering agents toward nonexistent
infrastructure (#7749). Make the no-runner portable warning and refusal
state honestly that Lab offload is unavailable and offer only applicable
actions (defer to CI, connect a runner, explicit local). Refactor
primary_action to branch on runner/portability facts instead of fragile
message substring matching.
Fixes#7735Fixes#7749
return"No eligible Homeboy Lab runner was found. Connect a runner or pass --runner <id> to offload this portable command; use the local-hot rerun command only as a last resort.".to_string();
273
-
}
276
+
// A portable command's warning names either a concrete default runner
277
+
// ("Lab runner `<id>`") or, when none is configured, states Lab offload is
278
+
// unavailable. Local-only commands say neither. Branch on those facts rather
279
+
// than inferring Lab availability from placeholder substrings.
274
280
ifletSome(runner_id) = default_runner {
275
-
if warning.message.contains("--runner"){
281
+
if warning.message.contains(&format!("`{runner_id}`")){
276
282
returnformat!(
277
283
"Homeboy found Lab runner `{runner_id}`; rerun with --runner {runner_id} or let automatic Lab routing handle this portable command."
278
284
);
279
285
}
280
286
}
287
+
if warning
288
+
.message
289
+
.contains("Lab offload is not currently available")
290
+
{
291
+
// Portable command, but no Lab runner is configured on this host (#7749):
292
+
// do not point the operator at nonexistent Lab infrastructure.
293
+
return"No Homeboy Lab runner is configured on this host, so Lab offload is not available. Defer verification to CI, connect a runner with `homeboy runner connect`, or use the local-hot rerun command only if local execution is explicitly authorized.".to_string();
294
+
}
281
295
if warning.message.contains("--runner"){
282
296
"Pass --runner <id> when Lab offload supports this mode.".to_string()
283
297
}else{
@@ -301,7 +315,7 @@ fn warning_message(
301
315
);
302
316
}
303
317
returnformat!(
304
-
"Resource policy warning: machine is {severity}; starting `{}` may skew results or add pressure. {reason} Connect a default Homeboy Lab runner or use --runner <id> to route this portable command through Lab offload, or use --placement local to run locally without this warning.",
318
+
"Resource policy warning: machine is {severity}; starting `{}` may skew results or add pressure. {reason} No Homeboy Lab runner is configured on this host, so Lab offload is not currently available; connect a runner (`homeboy runner connect`) to enable it, defer verification to CI, or use --placement local to run locally without this warning.",
0 commit comments