hermes - 💡(How to fix) Fix feat: add pre_generate hook to VideoGenProvider for quota/cost checks before dispatch

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fix / Workaround

Mother's Luma plugin needs to check the brand's monthly budget before dispatching to Luma. Currently implemented as an MCP call inside generate(). A native hook would make this cleaner and lower-latency, and remove the dependency on Mother's MCP server being available at generation time.

Code Example

def pre_generate(self, prompt: str, model: str, **kwargs) -> Optional[dict]:
    """Called before generate(). Return a dict to short-circuit (use as generate() result). Return None to proceed normally."""
    return None
RAW_BUFFERClick to expand / collapse

Problem

There is no hook point before generate() is called by Hermes. Implementing pre-generation checks (quota, rate-limits, cost gates) requires embedding the check logic inside generate() itself, which adds latency and couples quota logic to generation logic.

Proposed Change

Add an optional pre_generate() hook to VideoGenProvider:

def pre_generate(self, prompt: str, model: str, **kwargs) -> Optional[dict]:
    """Called before generate(). Return a dict to short-circuit (use as generate() result). Return None to proceed normally."""
    return None

Motivation

Mother's Luma plugin needs to check the brand's monthly budget before dispatching to Luma. Currently implemented as an MCP call inside generate(). A native hook would make this cleaner and lower-latency, and remove the dependency on Mother's MCP server being available at generation time.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix feat: add pre_generate hook to VideoGenProvider for quota/cost checks before dispatch