@gentbajko/slopify 1.5.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -129,7 +129,7 @@ export function planPreview(deps, view, catalogue, selection, id) {
129
129
  return {
130
130
  key: row.key,
131
131
  submit,
132
- uncertain: submit && hasSubmittedRequest(deps, view.revision.id, row.key, row.fingerprint),
132
+ uncertain: submit && hasSubmittedRequest(deps, view.revision.id, row.key),
133
133
  };
134
134
  });
135
135
  const execution = {
@@ -28,6 +28,19 @@ export function retainedPreviewPlan(deps, view, catalogue) {
28
28
  const recipe = original.recipes.find((one) => one.key === piece.key);
29
29
  if (recipe === undefined)
30
30
  continue;
31
+ // Pre-1.5 requests embedded research in messages. Review a fresh document-based
32
+ // request instead of re-admitting an input the current scheduler cannot match.
33
+ // Running calls, accepted jobs and cached answers must retain their exact input.
34
+ if ((piece.key === "research:notes" || piece.key === "article:body") &&
35
+ piece.input.kind === "llm" &&
36
+ (piece.input.documents?.length ?? 0) === 0 &&
37
+ recipe.input.kind === "llm" &&
38
+ (recipe.input.documents?.length ?? 0) > 0 &&
39
+ row.state !== "running" &&
40
+ !deps.db
41
+ .prepare("SELECT 1 FROM revision_work_pieces WHERE work_id=? AND (state IN ('running','done') OR continuation IS NOT NULL OR result_json IS NOT NULL) LIMIT 1")
42
+ .get(piece.workId))
43
+ continue;
31
44
  replacements.set(piece.key, {
32
45
  ...recipe,
33
46
  input: piece.input,
@@ -121,8 +134,8 @@ function cachedArticleComplete(deps, revisionId, workId) {
121
134
  }
122
135
  return false;
123
136
  }
124
- export function hasSubmittedRequest(deps, revisionId, key, fingerprint) {
137
+ export function hasSubmittedRequest(deps, revisionId, key) {
125
138
  return (deps.db
126
- .prepare(`SELECT 1 FROM revision_work_reservations r JOIN revision_work_pieces p ON p.id=r.piece_id WHERE r.revision_id=? AND r.work_key=? AND r.fingerprint=? AND p.submitted_at IS NOT NULL AND p.continuation IS NULL AND p.state!='done'`)
127
- .get(revisionId, key, fingerprint) !== undefined);
139
+ .prepare(`SELECT 1 FROM revision_work_reservations r JOIN revision_work_pieces p ON p.id=r.piece_id WHERE r.revision_id=? AND r.work_key=? AND p.submitted_at IS NOT NULL AND p.continuation IS NULL AND p.state!='done'`)
140
+ .get(revisionId, key) !== undefined);
128
141
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gentbajko/slopify",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Turn a prompt into a finished video, locally, with your own provider keys",
5
5
  "license": "MIT",
6
6
  "author": "Gent Bajko",