Skip to content

feat(youtube): add Ask Gemini video conversations - #416

Merged
sozercan merged 19 commits into
mainfrom
video-ai
Aug 6, 2026
Merged

feat(youtube): add Ask Gemini video conversations#416
sozercan merged 19 commits into
mainfrom
video-ai

Conversation

@sozercan

@sozercan sozercan commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a signed-in, watch-scoped Ask Gemini toolbar experience for eligible YouTube videos
  • support server-issued suggestions, free-text prompts, follow-up turns, Markdown responses, and transactional New Chat
  • match the Music command bar with a compact input-first glass panel and wrapping suggestion chips
  • add a Foundation-only YouTubeAskCore target for strict parsing, bounded wire decoding, request construction, opaque commands, and visible-text sanitization
  • add redacted API Explorer audit, parity, guarded live-validation, and capability-provenance tooling
  • harden WebKit cookie persistence, login completion, rollback, logout invalidation, and stale-write handling

Eligibility and safety

The panel is omitted unless all of the following hold:

  • the user is signed in outside guest mode
  • the selected account is a verified primary account
  • YouTube returns an eligible PAyouchat capability for the current account, region, and video
  • the bootstrap and commands remain bound to the current video, account scope, authentication generation, conversation, and revision

Brand accounts remain fail-closed until their delegated Ask identity/request flow is separately validated. Opaque continuations, click tracking, account identifiers, cookies, and raw payloads remain memory-only and are never logged or persisted.

Root causes addressed

  • responsive YouTube surfaces mirror content-equivalent Ask panels with different opaque commands; Kaset now selects the first complete panel atomically instead of merging commands
  • the live composer command currently appears under footer.chatInputViewModel.sendUserQueryCommand, not only youChatItemViewModel
  • short Ask content previously expanded to the full scroll cap; the panel now stays intrinsic-height while long transcripts remain bounded and scrollable
  • successful responses may omit a replacement composer command; the validated command remains available across bound conversation revisions, with one action consumed per revision

Validation

  • swiftformat .
  • swiftlint --strict
  • swift build
  • swift build --target APIExplorer
  • swift test --skip KasetUITests --filter YouTubeAsk
  • swift test --skip KasetUITests --filter WebKitAuthMaterialTests
  • swift test --skip KasetUITests --filter WebKitManagerTests
  • swift test --skip KasetUITests --filter LocalizationCatalogParityTests
  • swift test --skip KasetUITests --filter AppLocalizationTests
  • git diff --check
  • repeated structured autoreview passes; final result clean
  • packaged release build signed, relaunched, and live-verified with multiple free-text prompts in one chat

UI tests were not run, per repository policy.

sozercan added 13 commits July 29, 2026 20:04
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Copilot AI balanced review requested due to automatic review settings August 3, 2026 05:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bd586397d3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Tests/KasetTests/AuthServiceTests.swift Outdated
Comment thread Sources/Kaset/Services/Auth/AuthService.swift Outdated
Comment thread Sources/Kaset/Views/YouTube/YouTubeWatchView.swift Outdated
Comment thread Sources/Kaset/Services/API/MockUITestYouTubeClient.swift Outdated
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Copilot AI review requested due to automatic review settings August 3, 2026 07:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>

sozercan commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b40de2bf11

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/Kaset/Models/YouTube/YouTubeAskModels.swift Outdated
Comment thread Sources/Kaset/Services/Auth/AuthService.swift
Comment thread Sources/Kaset/Services/API/YouTubeClient+Ask.swift Outdated
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Copilot AI review requested due to automatic review settings August 3, 2026 08:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

sozercan commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4be07c1357

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/Kaset/Services/Auth/AuthService.swift
Comment thread Sources/Kaset/ViewModels/YouTube/YouTubeWatchViewModel.swift Outdated
Comment thread Sources/Kaset/Services/API/MockUITestYouTubeClient.swift
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Copilot AI review requested due to automatic review settings August 3, 2026 09:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

sozercan commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d5b4089552

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/Kaset/Views/YouTube/YouTubeWatchView.swift Outdated
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Copilot AI review requested due to automatic review settings August 3, 2026 10:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

sozercan commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4dd2fc025c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/APIExplorer/main.swift
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Copilot AI review requested due to automatic review settings August 3, 2026 10:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

sozercan commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 209d654378

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@sozercan
sozercan merged commit bb3a555 into main Aug 6, 2026
14 of 17 checks passed
@sozercan
sozercan deleted the video-ai branch August 6, 2026 07:16
Yoddikko pushed a commit to Yoddikko/kasetPlus that referenced this pull request Aug 27, 2026
Cherry-picked/adapted from upstream bb3a555. The additive YouTubeAskCore
module, models, views, view models, cookie-backup subsystem, tests and ADR
applied cleanly; auth/webkit/login mods auto-merged. Conflicts resolved
against the fork's diverged watch-page work:

- YouTubeClient: keep both getPlayability (members gate) and the new
  getWatchPage; extend getWatchPage with an optional playlistId so Mix/radio
  watch-next context is preserved (upstream dropped it).
- YouTubeWatchViewModel.load: merge upstream's account-scope reset + Ask
  bootstrap seeding with the fork's collaborators/notifications, live-chat
  startup and members gate; route the fetch through loadWatchPageWithIdentityRetry
  (now carrying playlistId). Comment load keeps the fork's sort tokens plus
  upstream's initial-completion tracking.
- YouTubeWatchView: adopt upstream's Ask toolbar/overlay/accessibility and the
  split playback/load tasks (load(accountScope:)), but keep the fork's inline
  player wiring (upNextQueue + heatmap, which the new lifecycle helper omits)
  and the promoted (non-DEBUG) ambient style picker; drop upstream's DEBUG
  prototype duplicate.
- APIExplorer: keep the fork's --hl flag, re-ported into upstream's unified
  option switch, alongside the new BoundedResponseDataDelegate.
- Localization: inject the 23 new Ask source keys into the catalog and
  regenerate .lproj mirrors via Scripts/sync-lproj.py.

Builds clean (swift build). NOT yet runtime-verified: the Ask flow touches
auth/webkit paths that auto-merged, and the test target is pre-existing broken
on main (MockYouTubeWatchPlaybackController lacks availableAudioTracks). Needs
manual QA + the test target fixed before release.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Yoddikko added a commit to Yoddikko/kasetPlus that referenced this pull request Aug 27, 2026
…upstream ledger

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Yoddikko added a commit to Yoddikko/kasetPlus that referenced this pull request Aug 27, 2026
sozercan#384/sozercan#415 already-ported

Content already present via cherry-picks and prior independent ports; records
ancestry so the fork reads 0-behind. No code changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants