can1357/oh-my-pi · error

Overall trial deadline exceeded (${Math.round(deadlineMs / 1

Error message

Overall trial deadline exceeded (${Math.round(deadlineMs / 1000)}s)

What it means

runTrial enforces an overall wall-clock deadline via a timer plus checkDeadline, called before each awaited stage. If the deadline timer fired or elapsed real time exceeds deadlineMs, further work is aborted with this error so a hung task cannot block the harness indefinitely.

Source

Thrown at packages/metaharness/src/tb/trial.ts:91

	let client: RpcClient | null = null;
	let deadlineExpired = false;
	let usage: TrialUsage = { ...EMPTY_USAGE };
	let finalMessage = "";
	let agentMs = 0;
	let verifierMs = 0;
	let agentTimedOut = false;

	const deadline = setTimeout(() => {
		deadlineExpired = true;
		void client?.stop().catch(() => {});
		void vm?.rm();
	}, deadlineMs);
	deadline.unref();

	const checkDeadline = () => {
		if (deadlineExpired || performance.now() - wallStartedAt >= deadlineMs) {
			deadlineExpired = true;
			throw new Error(`Overall trial deadline exceeded (${Math.round(deadlineMs / 1000)}s)`);
		}
	};
	const beforeDeadline = <T>(operation: Promise<T>): Promise<T> =>
		Promise.race([
			operation,
			new Promise<T>((_, reject) => {
				const remainingMs = deadlineMs - (performance.now() - wallStartedAt);
				if (remainingMs <= 0) {
					reject(new Error(`Overall trial deadline exceeded (${Math.round(deadlineMs / 1000)}s)`));
					return;
				}
				const timer = setTimeout(
					() => reject(new Error(`Overall trial deadline exceeded (${Math.round(deadlineMs / 1000)}s)`)),
					remainingMs,
				);
				timer.unref();
				void operation.finally(() => clearTimeout(timer)).catch(() => {});
			}),

View on GitHub (pinned to 9690622007)

Solutions

  1. Increase the deadline (--deadline / config deadlineMs) and rerun
  2. Investigate what hung: check vmond/microVM and gateway logs for the stalled stage
  3. Split the workload into smaller tasks or reduce task scope so it fits the budget

Example fix

// before
tb run --deadline 300   # heavy task needs ~20min
// after
tb run --deadline 1800
Defensive patterns

Strategy: try-catch

Validate before calling

// estimate per-task budget before submitting
const estMs = estimateTrialDuration(task);
if (estMs >= deadlineMs) throw new Error(`Task ${task.name} likely exceeds deadline ${deadlineMs}ms`);

Try / catch

try {
  await runTrial({ task, deadlineMs });
} catch (err) {
  if (String(err.message).startsWith("Overall trial deadline exceeded")) {
    logger.warn("Trial deadline exceeded; rerun with a larger --deadline or inspect for hangs", { task: task.name });
  } else throw err;
}

Prevention

When it happens

Trigger: checkDeadline (invoked from runTrial at stage boundaries via beforeDeadline) finds deadlineExpired true or performance.now() - wallStartedAt >= deadlineMs — i.e. the trial (agent session, microVM run, etc.) exceeded the configured --deadline/--timeout budget.

Common situations: Task genuinely too slow for the configured deadline; microVM or gateway hung causing beforeDeadline's race to lose; deadline set too low for large/long tasks; agent stuck retrying API calls.

Understand the failure class

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/23c4858c6584f80a. Report an issue: GitHub.