Skip to content

M6: Rewire job handler + remove old services and tools#8167

Merged
alex-nork merged 1 commit into
mainfrom
swarm/video-pipe-refactor/task-6
Feb 24, 2026
Merged

M6: Rewire job handler + remove old services and tools#8167
alex-nork merged 1 commit into
mainfrom
swarm/video-pipe-refactor/task-6

Conversation

@alex-nork
Copy link
Copy Markdown
Contributor

@alex-nork alex-nork commented Feb 24, 2026

Part of #8012. Rewires media-processing job handler to use preprocess/map/reduce phases. Removes 10 obsolete files: timeline-service, event-detection-service, retrieval-service, capability-registry, feedback-store, feedback-aggregation, detect-events, submit-feedback, recalibrate, select-tracking-profile.


Open with Devin

Co-Authored-By: Claude <noreply@anthropic.com>
@alex-nork alex-nork self-assigned this Feb 24, 2026
@alex-nork alex-nork merged commit ed45679 into main Feb 24, 2026
@alex-nork alex-nork deleted the swarm/video-pipe-refactor/task-6 branch February 24, 2026 19:27
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 5 additional findings in Devin Review.

Open in Devin Review

Comment on lines +44 to +46
reduce: { execute: (assetId, onProgress) => reduceForAsset(assetId, {
systemPrompt: 'Summarize the video content based on the structured observations.',
}, onProgress) },
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Missing required query field in reduce stage causes "User query: undefined" to be sent to Claude

The reduce handler in the job handler calls reduceForAsset(assetId, { systemPrompt: '...' }, onProgress) but omits the required query field from ReduceOptions. At runtime, options.query is undefined, which gets interpolated into the Claude prompt at reduce.ts:132 as "User query: undefined".

Root Cause and Impact

The ReduceOptions interface at assistant/src/config/bundled-skills/media-processing/services/reduce.ts:29-36 defines query: string as a required field:

export interface ReduceOptions {
  query: string;
  systemPrompt?: string;
  model?: string;
}

But the job handler at line 44-46 only provides systemPrompt:

reduce: { execute: (assetId, onProgress) => reduceForAsset(assetId, {
  systemPrompt: 'Summarize the video content based on the structured observations.',
}, onProgress) },

In sendToClaude (reduce.ts:132), the query is interpolated directly:

const userContent = `Here is the video analysis data:\n\n${mapText}\n\n---\n\nUser query: ${query}`;

This results in "User query: undefined" being sent to Claude, which degrades the quality of the reduce step output. The fix should either make query optional in ReduceOptions (with a sensible default for one-shot merge mode), or provide a meaningful query string like 'Summarize the video content.' in the job handler.

Impact: Every automated media processing job's reduce stage sends a malformed prompt to Claude, producing suboptimal or confusing results.

Suggested change
reduce: { execute: (assetId, onProgress) => reduceForAsset(assetId, {
systemPrompt: 'Summarize the video content based on the structured observations.',
}, onProgress) },
reduce: { execute: (assetId, onProgress) => reduceForAsset(assetId, {
query: 'Summarize the video content. Identify key events, subjects, and notable moments with timestamps.',
systemPrompt: 'Summarize the video content based on the structured observations.',
}, onProgress) },
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 640c206c4e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +44 to +46
reduce: { execute: (assetId, onProgress) => reduceForAsset(assetId, {
systemPrompt: 'Summarize the video content based on the structured observations.',
}, onProgress) },
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Pass an explicit reduce query in media processing jobs

The new reduce stage invokes reduceForAsset without a query, so every background media_processing job (e.g. enqueued by ingest_media) sends a prompt with User query: undefined to the reduce service; this makes the final stage output unreliable and can silently produce low-quality summaries even when the pipeline is marked successful. Provide a concrete query string (or update reduce options to default one) when calling reduceForAsset.

Useful? React with 👍 / 👎.

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