diegosouzapw/OmniRoute · error · Error

Local corpus endLine must be greater than or equal to startL

Error message

Local corpus endLine must be greater than or equal to startLine

What it means

Error "Local corpus endLine must be greater than or equal to startLine" thrown in diegosouzapw/OmniRoute.

Source

Thrown at src/lib/localCorpus/index.ts:587

      throw new Error("Local corpus file path escapes the configured root");
    }

    let content: string;
    try {
      content = await fs.readFile(canonicalFile, "utf8");
    } catch {
      throw new Error("Local corpus file is not accessible");
    }
    if (content.includes("\0")) throw new Error("Local corpus file is not valid text");

    const lines = content.split(/\r?\n/);
    const requestedStart = positiveInteger(options.startLine, 1);
    const requestedEnd = positiveInteger(
      options.endLine,
      requestedStart + this.limits.maxReadLines - 1
    );
    if (requestedEnd < requestedStart) {
      throw new Error("Local corpus endLine must be greater than or equal to startLine");
    }

    const startLine = Math.min(requestedStart, Math.max(lines.length, 1));
    const endLine = Math.min(lines.length, requestedEnd, startLine + this.limits.maxReadLines - 1);
    return {
      relativePath: normalizeRelativePath(path.relative(root, canonicalFile)),
      content: lines.slice(startLine - 1, endLine).join("\n"),
      startLine,
      endLine,
      totalLines: lines.length,
      truncated: startLine > 1 || endLine < lines.length,
    };
  }
}

export function getDefaultLocalCorpusStatus(): LocalCorpusStatus {
  const limits = resolveLimits({});
  return {

View on GitHub (pinned to a179ffed5b)

When it happens

Trigger: Thrown at src/lib/localCorpus/index.ts:587 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/1c6fb67c9ad9bfaf. Report an issue: GitHub.