Skip to content

Add video agent API - #19

Merged
devhims merged 6 commits into
mainfrom
feat/video-agent-api
Sep 5, 2026
Merged

Add video agent API#19
devhims merged 6 commits into
mainfrom
feat/video-agent-api

Conversation

@devhims

@devhims devhims commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Adds an asynchronous video agent API for topic research and single-video inspection. Authenticated callers can start idempotent runs, poll results, and restore or search conversation history. GLM powers routing, the agent loop, transcript analysis, and isolated storyboard analysis.

The endpoint ships behind AGENT_RUNTIME_ENABLED and AGENT_ACCESS_MODE=admins. Admin access checks the authenticated account's current verified email against ADMIN_EMAILS_SECRET, including for API-key callers. Setting the access mode to all enables a later rollout to authenticated users.

  • Persist runs, evidence, citations, conversation branches, and recovery checkpoints in Durable Objects. Enforce a 60-second admission deadline with 20 seconds reserved for finalization, bounded tool/model budgets, and one research search.
  • Add storyboard extraction to the processor and visual analysis to both capabilities. Validate final citations against persisted evidence and return qualified partial answers when sufficient evidence survives a model failure.
  • Reserve 22 credits before inference, settle completed evidence once, and refund unused credits on terminal outcomes. Recover interrupted settlement without double charging.
  • Cancel runs and clear agent data during account deletion. Register conversations before starting work and retain deletion tombstones to block late writes.
  • Add local Worker smoke testing, regression tests, API documentation, and architecture references. Remove nonessential author email fields from package metadata.

Validation:

  • 332 automated tests passed across platform unit, Durable Object, D1 credit, and processor suites.
  • TypeScript, generated-documentation, and whitespace checks passed.
  • Live GLM research: 52.3 seconds, 9 citations, 4 credits charged.
  • Live GLM inspection: 26.5 seconds, 11 citations, transcript and storyboard evidence, 3 credits charged.
  • Verified the matching reserve and settlement entries in local D1.

The live non-admin check was skipped without a second token; automated access-control tests passed. No endpoint deployment was performed. Deployment requires the ADMIN_EMAILS_SECRET binding and the configured Durable Object migrations.

The branch contains six focused commits for processor extraction, runtime/API, access controls, billing, account deletion, and smoke tests/documentation. The final source tree is identical to the previously validated version.

@vercel

vercel Bot commented Sep 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
video2ctx-web Ready Ready Preview Sep 5, 2026 10:14am UTC

@mintlify

mintlify Bot commented Sep 5, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
video2ctx 🟢 Ready View Preview Sep 5, 2026, 10:13 AM

💡 Tip: Enable Automations to automatically generate PRs for you.

@devhims
devhims force-pushed the feat/video-agent-api branch from a69fe10 to db70618 Compare September 5, 2026 10:13
@devhims
devhims merged commit eec5ad5 into main Sep 5, 2026
7 checks passed
@devhims
devhims deleted the feat/video-agent-api branch September 5, 2026 10:18
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.

1 participant