diff --git a/skills/watch/SKILL.md b/skills/watch/SKILL.md index cb8b072..7cd78b6 100644 --- a/skills/watch/SKILL.md +++ b/skills/watch/SKILL.md @@ -93,7 +93,7 @@ On macOS with Homebrew, it auto-installs `ffmpeg` and `yt-dlp`. On Linux/Windows - `balanced` (recommended) — scene-aware frames (cap 100, default). - `token-burner` — scene-aware, uncapped (maximum fidelity; high token cost). -Write the answer directly into `~/.config/watch/.env` by setting: +Write the answer directly into `~/.config/watch/.env` by setting the bare key on its own line — **no trailing inline comment** (a `# note` after the value can break parsing): ```bash WATCH_DETAIL=balanced diff --git a/skills/watch/scripts/config.py b/skills/watch/scripts/config.py index 93f70d1..3a97bad 100644 --- a/skills/watch/scripts/config.py +++ b/skills/watch/scripts/config.py @@ -32,6 +32,15 @@ def read_env_file(path: Path | None = None) -> dict[str, str]: value = value.strip() if len(value) >= 2 and value[0] in ('"', "'") and value[-1] == value[0]: value = value[1:-1] + else: + # Strip an inline comment (a '#' preceded by whitespace) from an + # unquoted value. Without this, `WATCH_DETAIL=balanced # note` + # parses as "balanced # note", fails validation, and silently + # falls back to the default. Keeps '#' inside quotes / API keys. + for i, ch in enumerate(value): + if ch == "#" and i > 0 and value[i - 1] in " \t": + value = value[:i].rstrip() + break values[key.strip()] = value return values diff --git a/skills/watch/scripts/setup.py b/skills/watch/scripts/setup.py index 5582eb4..9bc2190 100755 --- a/skills/watch/scripts/setup.py +++ b/skills/watch/scripts/setup.py @@ -52,8 +52,10 @@ ENV_TEMPLATE = """# /watch API configuration GROQ_API_KEY= OPENAI_API_KEY= -# Default watch behavior (the /watch first-run wizard sets this for you): -# WATCH_DETAIL=balanced # transcript | efficient | balanced | token-burner +# Default watch behavior (the /watch first-run wizard sets this for you). +# Allowed values: transcript | efficient | balanced | token-burner +# Keep the value on its own line with no trailing comment. +# WATCH_DETAIL=balanced """