Skip to content

feat(youtube): fix the video analysis prompt, add a summary mode - #15

Merged
maxbolgarin merged 1 commit into
mainfrom
claude/cool-einstein-qjmr6y
Oct 10, 2026
Merged

maxbolgarin merged 1 commit into
mainfrom
claude/cool-einstein-qjmr6y

Conversation

@maxbolgarin

Copy link
Copy Markdown
Owner

Summary

video preset: problems found

  • Broken jump-to-moment links. The prompt asked for [HH:MM:SS](URL?t=Ns), but the link template is watch?v=ID&t=Ns. A model that followed the example wrote a second ?, which breaks the link.
  • Wrong job. It called itself a summary ("Task: summarize"), while the bot labels it ▶ Analyze. There was no breakdown of the speaker's position, claims or arguments.
  • Chunks split mid-argument. max_chunk_input_tokens: 35000 split anything past ~40 minutes into map-reduce fragments, so an argument was summarized in pieces.

What changed

  • video v2 is an analysis. It covers:

    • the topic and the speaker's position;
    • claims, each with the arguments behind it and timestamps;
    • how the argument holds together (what rests on facts vs examples or emotion, unsupported claims, objections addressed or skipped), without judging truth, which is the fact-check's job;
    • numbers, quotes, and moments worth watching.

    The prompt now gives one explicit link example. The chunk cap is 90k, so a two-hour transcript (~50-60k tokens) fits in one call and the cap still stays under the low-TPM guard that test_video_preset_has_chunk_cap pins. The output budget is 8k.

  • New video_summary preset (hidden). A retelling in order for someone who won't watch: what it's about, the video part by part with a timestamp per part, takeaways, and whether it's worth watching anyway.

  • Surfaces.

    • Bot: the YouTube panel gets 📄 Summary (Y_SUM), which runs the existing single-item path with a preset override, like Fact-check.
    • CLI: the YouTube picker gets a Summary row (SUMMARY_SENTINEL).
    • --preset video_summary also works.
  • Docs: docs/bot.md, docs/sources.md, presets/README.md.

Related issue

n/a

Test plan

  • uv run pytest -q (2659 passed)
  • uv run ruff check .
  • uv run ruff format --check .
  • tests/test_video_presets.py checks:
    • both presets exist in en and ru, are hidden, and open with a TL;DR;
    • links use the template's &t=, never URL?t=;
    • the chunk cap sits between 60k and 100k;
    • the analysis has a claims/arguments section and the summary is chronological;
    • the bot button and the CLI row run video_summary.
  • Run both on a real video and read the output; the reports themselves weren't generated here.

Checklist

  • PR title uses a Conventional Commits prefix
  • Updated CLAUDE.md if architecture / invariants changed (n/a)
  • Added or updated tests for the change
  • No new network calls inside tests

🤖 Generated with Claude Code

https://claude.ai/code/session_019axffqQzzXeAQWXNrH2xpr


Generated by Claude Code

The video preset mixed two link formats: it asked for
`[HH:MM:SS](URL?t=Ns)` while the template is `watch?v=ID&t=Ns`, so a
model following the example wrote a second `?` and broke the
jump-to-moment link. It also called itself a summary while the bot sells
it as the analysis, and capped chunks at 35k tokens, which split any
video past ~40 minutes into map-reduce fragments.

- video (v2): an analysis - topic and the speaker's position, claims
  with the arguments behind each, how the argument holds together
  (without fact-checking), numbers, quotes, moments worth watching.
  One explicit link example; chunk cap 90k (a two-hour transcript fits,
  still under low TPM tiers); output budget 8k.
- video_summary (new): a retelling in order for someone who won't
  watch - what it's about, part by part with timestamps, takeaways,
  whether it's worth watching anyway.
- Bot YouTube panel gets a Summary button (Y_SUM); the CLI picker a
  Summary row.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019axffqQzzXeAQWXNrH2xpr
@maxbolgarin
maxbolgarin force-pushed the claude/cool-einstein-qjmr6y branch from 4574a73 to ace46f9 Compare October 10, 2026 10:12
@maxbolgarin
maxbolgarin merged commit e3ae058 into main Oct 10, 2026
8 checks passed
@maxbolgarin
maxbolgarin deleted the claude/cool-einstein-qjmr6y branch October 10, 2026 10:13
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.9.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants