Fix clearTimeout leaks, transcript_segments shape mismatch, and ENABLE_VERTEX_AI boolean parsing#35
Merged
groupthinking merged 4 commits intomainfrom Feb 27, 2026
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
🚅 Deployed to the EventRelay-pr-35 environment in EventRelay
|
…E_VERTEX_AI boolean parsing Co-authored-by: groupthinking <154503486+groupthinking@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add frontend-only video analysis pipeline with multi-strategy transcription
Fix clearTimeout leaks, transcript_segments shape mismatch, and ENABLE_VERTEX_AI boolean parsing
Feb 27, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes request-timeout cleanup in the Next.js API routes to prevent dangling timers when fetch() aborts/errors, and aligns the /api/video response’s transcript_segments count with the backend’s transcript shape.
Changes:
- Move
clearTimeout(...)intofinallyblocks so timers are always cleared (even on abort/network error) in both/api/video(15s) and/api/transcribe(8s) backend calls. - Update
/api/videoto computetranscript_segmentsfromresult.transcript.segments.length(while still tolerating the legacy “array transcript” shape).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apps/web/src/app/api/video/route.ts | Ensures backend timeout is always cleared; fixes transcript_segments counting against { text, source, segments }. |
| apps/web/src/app/api/transcribe/route.ts | Ensures YouTube-backend timeout is always cleared to avoid dangling timers on abort/errors. |
Base automatically changed from
claude/slack-check-status-update-R47Ph
to
main
February 27, 2026 23:05
groupthinking
approved these changes
Feb 27, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Four bugs from PR #33 review: dangling timers on fetch abort, wrong property path for segment count, and Vertex AI importing when
ENABLE_VERTEX_AI=0.Changes
video/route.ts&transcribe/route.ts—clearTimeoutinfinallyclearTimeoutwas placed afterawait fetch(...), so it never ran on abort or network error, leaving timers pending. Moved intofinallyblocks on both the 15s backend timeout and the 8s YouTube transcript timeout.video/route.ts—transcript_segmentsshapeWas reading
result.transcript?.length, but the backend returnstranscriptas{ text, source, segments }. Fixed toresult.transcript?.segments?.length.gemini_service.py—ENABLE_VERTEX_AIboolean gateRaw
os.getenv("ENABLE_VERTEX_AI")is truthy for any non-empty string including"0", defeating the intent. Now parsed strictly:video/route.ts— duplicatelet transcriptdeclaration removed (would cause a compile error).💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.