Skip to content

armgit / hypit

Public Imported from GitHub
0

Clone any viral video with AI agents. Not just a script, the whole workflow: swap the face, the words, the B-roll, ship 100 variants in one command, and get your 100M views.

fix: a three-shot review is an observation, so cache it like one

rpone523c7360957c
diff --git a/packages/reference-video-tools/src/tools.ts b/packages/reference-video-tools/src/tools.ts
index 4fd7a2a4..d9333115 100644
--- a/packages/reference-video-tools/src/tools.ts
+++ b/packages/reference-video-tools/src/tools.ts
@@ -595,14 +595,27 @@ export function createReferenceVideoTools(options: ToolOptions = {}): ReferenceV
: [];
})
: []).map((items) => items as unknown as readonly [Shot, Shot, Shot]);
- const threeShotObservations = await pacedMap(windows, concurrency, gapMs, async (items) => {
- const result = await ask(`window:${items[0].shot_id}`, {
+ // A three-shot review is an observation like any other, so it is cached like any other. Asking
+ // for it directly meant an answer recorded against its key was never read back, which left the
+ // review unanswerable for an observer that answers out of band.
+ const windowTasks: ObservationTask[] = windows.map((items) => ({
+ key: `window:${items[0].shot_id}`,
+ request: {
media: items.map((shot) => shot.clip_ref),
prompt: `Compare shots ${items[0].index}, ${items[1].index}, and ${items[2].index}. Decide whether the three clips are one continuous camera shot and whether one visual overlay or insert persists through both boundaries. Explain the evidence in natural language only.`,
instruction: "Analyze a three-shot continuity window only. Do not write markup, SVML, JSON plans, or component names.",
- });
- return { shot_ids: items.map((shot) => shot.shot_id), combined_duration_seconds: Number((items[2].end_seconds - items[0].start_seconds).toFixed(3)), result };
- });
+ },
+ }));
+ const windowObservations = await runObservationTasks(
+ state.root, windowTasks,
+ reobserve ? new Set(windowTasks.map((task) => task.key)) : new Set<string>(),
+ concurrency, gapMs, ask,
+ );
+ const threeShotObservations = windows.map((items) => ({
+ shot_ids: items.map((shot) => shot.shot_id),
+ combined_duration_seconds: Number((items[2].end_seconds - items[0].start_seconds).toFixed(3)),
+ result: windowObservations.get(`window:${items[0].shot_id}`)!,
+ }));
for (const window of threeShotObservations) {
if (window.result.status !== "complete") unresolved.push(`three-shot:${window.shot_ids.join("+")}`);
}