larksuite/cli · error · LarkCliError

+csv-get truncated the scan range at {actual_range}; narrow

Error message

+csv-get truncated the scan range at {actual_range}; narrow --range before detecting subtables

What it means

After staging and cropping the suite, syncSuite installs the local suite directory via runner.InstallLocalSuite. A nil result or a result with Err set aborts with this message plus resultDetail(installResult). The runner's detail carries the true root cause.

Source

Thrown at skills/lark-sheets/scripts/lark_detect_subtables.py:460

        )
    )
    csv_data = envelope_data(
        run_sheets(
            "+csv-get",
            url=args.url,
            spreadsheet_token=args.spreadsheet_token,
            **locator,
            flags={
                "range": scan_range,
                "max_chars": args.max_chars,
                "skip_hidden": True if args.skip_hidden else None,
            },
            timeout=args.timeout,
        )
    )
    actual_range = str(csv_data.get("actual_range") or scan_range)
    if csv_data.get("has_more"):
        raise LarkCliError(
            f"+csv-get truncated the scan range at {actual_range}; narrow --range before detecting subtables"
        )

    grid = parse_annotated_csv(
        csv_data.get("annotated_csv", ""),
        csv_data.get("col_indices"),
        csv_data.get("row_indices"),
        actual_range,
    )
    if grid.row_numbers_inferred:
        warnings.append("CSV row numbers were inferred from the requested range")
    hidden_rows_raw = layout.get("hidden_rows") or []
    hidden_row_indexes = {
        int(value) + 1
        for value in hidden_rows_raw
        if isinstance(value, (int, str)) and str(value).isdigit()
    }
    hidden_columns_raw = layout.get("hidden_cols") or layout.get("hidden_columns") or []

View on GitHub (pinned to 7fd6ef3c07)

Solutions

  1. Read the detail after 'install cropped lark-suite failed:' to identify the runner's underlying error.
  2. Check write permissions on the target global skills directory and fix ownership/permissions (chmod/chown).
  3. Ensure the agent/host that owns the skills directory is installed and reachable, then retry the sync.
  4. Free disk space if the install failed partway through writing files.

Example fix

// before
lark-cli skills update --layout suite   # fails: permission denied on ~/.agents/skills
// after
sudo chown -R "$USER" ~/.agents && lark-cli skills update --layout suite
Defensive patterns

Strategy: validation

Validate before calling

// Pre-flight: writable global skills dir?
dir := filepath.Join(home, ".agents", "skills")
if err := os.MkdirAll(dir, 0o755); err != nil {
    return fmt.Errorf("skills dir not writable: %w", err)
}

Try / catch

if err := syncLayout(...); err != nil && strings.Contains(err.Error(), "install cropped lark-suite failed") {
    // read resultDetail for the runner's cause; fix permissions/ownership, then retry
}

Prevention

When it happens

Trigger: Running a suite-mode skills sync where the install of the cropped lark-suite directory fails: the runner's install command (e.g. copying into the global skills dir) hits permission errors, a full disk, or a non-zero exit from the underlying installer.

Common situations: Installing into a global ~/.agents/skills (or agent-managed) directory without write permissions; agent CLI owning the skills directory is missing or misconfigured; antivirus/OS blocking the copy; disk quota exceeded.

Related errors


AI-assisted analysis of larksuite/cli@7fd6ef3c07 (2026-09-04). Data as JSON: /api/errors/2a2db7013f683578. Report an issue: GitHub.