def filter_output(output):
    """Filter warning lines from output and return the last valid line."""
    lines = output.split("\n")
    valid_lines = []
    for line in lines:
        stripped = line.strip()
        if not stripped:
            continue
        if "warning" in stripped.lower():
            continue
        if "starting call" in stripped.lower():
            continue
        if "finished call" in stripped.lower():
            continue
        valid_lines.append(stripped)

    if valid_lines:
        return valid_lines[-1]
    return ""
