Skip to content

fix(files): dispatch search indexing from Trigger workers - #7293

Merged
icecrasher321 merged 2 commits into
stagingfrom
codex/fix-workspace-file-search-trigger-dispatch
Aug 31, 2026
Merged

fix(files): dispatch search indexing from Trigger workers#7293
icecrasher321 merged 2 commits into
stagingfrom
codex/fix-workspace-file-search-trigger-dispatch

Conversation

@icecrasher321

Copy link
Copy Markdown
Collaborator

Summary

  • dispatch workspace file indexing as Trigger.dev child tasks when already inside a Trigger run
  • add regression coverage and remove the unused dispatch-limit helper
  • simplify sandbox image builds to one stable Trigger.dev task ID

Type of Change

  • Bug fix

Testing

  • focused Vitest suite: 3 files, 49 tests
  • bun run lint
  • bun run type-check
  • bun run check:audits (39 audits)
  • block registry validation against origin/staging

Checklist

  • Code follows project conventions
  • Tests added or updated and passing
  • Full lint, type-check, and audit checks pass
  • Branch is based on the latest staging

@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 31, 2026 8:20am

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 5 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR routes workspace-file indexing through Trigger.dev whenever execution is already inside a Trigger worker and simplifies sandbox image builds to a stable task ID.

  • Adds runtime-aware selection between Trigger.dev and detached indexing.
  • Adds regression coverage for nested Trigger dispatch.
  • Replaces revisioned sandbox image task IDs and removes compatibility handlers.

Confidence Score: 4/5

The rollout compatibility gap should be fixed before merging because old replicas or queued revisioned tasks can leave sandbox image builds pending.

The new worker removes every handler for the task ID emitted by the previous web release even though web and Trigger deployments can overlap, so builds created during that window may not execute until their pending records become stale.

Files Needing Attention: apps/sim/lib/execution/remote-sandbox/image-registry.ts; apps/sim/background/sandbox-image-build.ts

Important Files Changed

Filename Overview
apps/sim/lib/workspace-files/search/dispatcher.ts Correctly selects Trigger.dev for indexing when either deployment configuration or active Trigger runtime context requires it.
apps/sim/lib/execution/remote-sandbox/image-registry.ts Introduces the stable sandbox-build task ID, but mixed-version deployments can still emit the removed revisioned ID.
apps/sim/background/sandbox-image-build.ts Removes revisioned compatibility handlers before old producers and queued task IDs are guaranteed to have drained.
apps/sim/lib/workspace-files/search/dispatcher.test.ts Adds focused coverage for the new Trigger dispatch predicate.
apps/sim/lib/execution/remote-sandbox/image-registry.test.ts Updates the task-ID assertion but does not cover mixed-version rollout compatibility.

Sequence Diagram

sequenceDiagram
    participant W as Old web replica
    participant T as Trigger.dev
    participant N as New worker
    participant D as Sandbox image row
    W->>D: Create pending build
    W->>T: Trigger sandbox-image-build-v2
    Note over N: Registers only sandbox-image-build
    T--xN: No matching v2 handler
    Note over D: Remains pending until stale/reclaimed
Loading

Reviews (1): Last reviewed commit: "fix(files): dispatch search indexing fro..." | Re-trigger Greptile

Comment thread apps/sim/lib/execution/remote-sandbox/image-registry.ts
@icecrasher321
icecrasher321 merged commit ba3cf4d into staging Aug 31, 2026
27 checks passed
@icecrasher321
icecrasher321 deleted the codex/fix-workspace-file-search-trigger-dispatch branch August 31, 2026 08:25
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