diegosouzapw/OmniRoute · error

Unknown stage: ${stage}

Error message

Unknown stage: ${stage}

What it means

Error "Unknown stage: ${stage}" thrown in diegosouzapw/OmniRoute.

Source

Thrown at src/domain/prompts.ts:97

 * @returns Interpolated string
 */
export function interpolate(template: string, variables: Record<string, string>): string {
  return template.replace(/\{(\w+)\}/g, (match, key) => {
    return key in variables ? variables[key] : match;
  });
}

/**
 * Render a stage prompt with the given variables.
 *
 * @param stage - The pipeline stage name
 * @param variables - Variable values for interpolation
 * @returns Rendered system and user prompt strings
 */
export function renderPrompt(stage: StageName, variables: Record<string, string>): StagePrompt {
  const template = STAGE_PROMPTS[stage];
  if (!template) {
    throw new Error(`Unknown stage: ${stage}`);
  }
  return {
    system: interpolate(template.system, variables),
    user: interpolate(template.user, variables),
  };
}

View on GitHub (pinned to a179ffed5b)

When it happens

Trigger: Thrown at src/domain/prompts.ts:97 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/a3e861d9f9b59474. Report an issue: GitHub.