mvanhorn/last30days-skill · error · SystemExit

Unsupported emit mode: {emit}

Error message

Unsupported emit mode: {emit}

What it means

The single-report emit dispatcher in last30days.py accepts only a fixed set of emit modes (json, html, compact/md, context, brief) and raises SystemExit for anything else. This is argparse-independent validation: the --emit value reached the renderer without matching a supported mode.

Source

Thrown at skills/last30days/scripts/last30days.py:413

        return html_render.render_html(
            report,
            fun_level=fun_level,
            save_path=save_path,
            synthesis_md=synthesis_md,
            register=register,
        )
    if emit in {"compact", "md"}:
        return render.render_compact(
            report,
            fun_level=fun_level,
            save_path=save_path,
            register=register,
        )
    if emit == "context":
        return render.render_context(report)
    if emit == "brief":
        return render.render_brief(report)
    raise SystemExit(f"Unsupported emit mode: {emit}")


def emit_comparison_output(
    entity_reports: list[tuple[str, schema.Report]],
    emit: str,
    fun_level: str = "medium",
    save_path: str | None = None,
    synthesis_md: str | None = None,
    json_profile: str = "agent",
) -> str:
    if emit == "json":
        payload = {
            "comparison": True,
            "entities": [label for label, _ in entity_reports],
            "reports": [
                {
                    "entity": label,
                    "report": (

View on GitHub (pinned to c7460f6114)

Solutions

  1. Run with --help or check emit_output() to enumerate valid modes: json, html, compact, md, context, brief.
  2. Fix the flag value, e.g. --emit=md instead of --emit=markdown.
  3. If wiring automated callers, validate the emit string against the supported set before invoking.

Example fix

# before
--emit=markdown

# after
--emit=md
Defensive patterns

Strategy: validation

Validate before calling

SUPPORTED_EMIT = {'json', 'html', 'compact', 'md', 'context', 'brief'}
if emit not in SUPPORTED_EMIT:
    raise ValueError(f'unsupported emit {emit!r}; choose from {sorted(SUPPORTED_EMIT)}')

Type guard

def is_supported_emit(value: str) -> TypeGuard[str]:
    return value in {'json', 'html', 'compact', 'md', 'context', 'brief'}

Prevention

When it happens

Trigger: Calling the engine with --emit=markdown, --emit=csv, --emit=compact2, or any typo — the string falls through all if-blocks in emit_output() and hits the final raise.

Common situations: Agent or script guessing flag values instead of reading --help; emit modes renamed between skill versions; copy-paste from outdated SKILL.md/README examples.

Related errors


AI-assisted analysis of mvanhorn/last30days-skill@c7460f6114 (2026-08-15). Data as JSON: /api/errors/3d552f122f46f18e. Report an issue: GitHub.