-
Notifications
You must be signed in to change notification settings - Fork 1
fix: route every transcript client through the centralized proxy (#1087) #1129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
b6f4cf3
fix: route every transcript client through the centralized proxy (#1087)
groupthinking 5659f2b
fix(proxy): resolve helper standalone instead of silently disabling p…
groupthinking 49e887c
test(proxy): reject opaque and foreign proxy configs
groupthinking File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🔴 Critical | 🏗️ Heavy lift
Stop returning fabricated transcript results.
Both paths report successful extraction after real extraction fails.
InteractiveMetadataExtractor.extract_transcriptfalls back to_generate_transcript_whisper, which returns a hard-coded segment.RealVideoProcessor._extract_transcript_with_rotationreturns a fixed segment afteryt_dlp.extract_info()without extracting subtitle content. This sends false video data to downstream agents.Use a real transcriber and validate its output. If no real transcript is available, raise a typed extraction error.
src/agents/interactive_metadata_extractor.py#L106-L109: Do not call the placeholder transcript fallback after this request fails.src/agents/process_video_with_mcp.py#L241-L246: Propagate the direct extraction failure when no real fallback succeeds.src/agents/process_video_with_mcp.py#L257-L260: Replace the fixedyt_dlpfallback result with actual subtitle extraction or an error.As per coding guidelines, “Production code must use real behavior only: no mock delays, fake data, or simulated responses.” As per path instructions, “Flag any file that contains placeholder/stub implementations … or returns mock/fake data.”
📍 Affects 2 files
src/agents/interactive_metadata_extractor.py#L106-L109(this comment)src/agents/process_video_with_mcp.py#L241-L246src/agents/process_video_with_mcp.py#L257-L260🤖 Prompt for AI Agents
Sources: Coding guidelines, Path instructions
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: groupthinking/EventRelay
Length of output: 16595
🌐 Web query:
youtube-transcript-api http_client YouTubeTranscriptApi __init__ _http_client requests Session timeout💡 Result:
In the python library youtube-transcript-api, you can control the HTTP configuration by passing a custom requests.Session object to the YouTubeTranscriptApi constructor via the http_client parameter [1][2]. While the library does not have a native timeout parameter, you can manage request timeouts by configuring the Session object before passing it to the API [1][2][3]. To set a timeout for all requests made by the library: 1. Initialize a requests.Session object. 2. Manually set a default timeout for the session's request methods or use a transport adapter. A common pattern in the requests library is to monkeypatch the session or override the request method, as requests.Session does not have a built-in default timeout attribute [3]. Example of passing a custom session: from requests import Session from youtube_transcript_api import YouTubeTranscriptApi # Create a session http_client = Session # Customize the session (e.g., custom headers) http_client.headers.update({"Accept-Encoding": "gzip, deflate"}) # Inject the session into the API ytt_api = YouTubeTranscriptApi(http_client=http_client) ytt_api.fetch(video_id) Note that YouTubeTranscriptApi is not thread-safe because it uses a requests.Session object internally [2][4]. If you are working in a multi-threaded environment, you must initialize a new instance of YouTubeTranscriptApi (and ideally a new requests.Session) per thread [2][4]. Regarding the timeout specifically, users have noted that the library lacks a direct timeout argument, and requests for this feature have been discussed in the project's issue tracker [3]. Users are often advised to handle timeouts by wrapping the API calls or customizing the underlying requests session [3].
Citations:
🏁 Script executed:
Repository: groupthinking/EventRelay
Length of output: 40895
Set a finite HTTP timeout for every transcript client.
youtube-transcript-apiaccepts a custom HTTP client, but these calls pass onlyproxy_config. Without an enforced connect/read timeout, a blocked transcript/SRT fetch can hold an executor worker and stall the surrounding timeout or circuit-breaker path.Add one shared transcript HTTP-client factory that creates a
requests.Sessionwith bounded connect and read timeouts, and pass it throughhttp_client=at every transcript API call, including:src/agents/interactive_metadata_extractor.py#L106-L109src/agents/process_video_with_mcp.py#L241-L246src/agents/process_video_with_mcp.py#L257-L260src/integration/youtube_api.py#L118-C20src/mcp/mcp_video_processor.py#L713src/mcp/mcp_video_processor.py#L737Apply the same bounded-session pattern to the other YouTube transcript fetches under
src/youtube_extension/backend, since they create the same unbounded client.📍 Affects 4 files
src/agents/interactive_metadata_extractor.py#L106-L109(this comment)src/agents/process_video_with_mcp.py#L241-L246src/agents/process_video_with_mcp.py#L257-L260src/integration/youtube_api.py#L118-L120src/mcp/mcp_video_processor.py#L713-L713src/mcp/mcp_video_processor.py#L737-L737🤖 Prompt for AI Agents
Source: Path instructions