Skip to content

improvement(blocks): depends on misalignments audit#4409

Merged
icecrasher321 merged 2 commits intostagingfrom
fix/dependson-gatings
May 2, 2026
Merged

improvement(blocks): depends on misalignments audit#4409
icecrasher321 merged 2 commits intostagingfrom
fix/dependson-gatings

Conversation

@icecrasher321
Copy link
Copy Markdown
Collaborator

@icecrasher321 icecrasher321 commented May 2, 2026

Summary

  • missing / overreaching dependsOn for blocks found in audit
  • elevenlabs stt tool upgrade from scribe_v1 to v2

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link
Copy Markdown

vercel Bot commented May 2, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped May 2, 2026 6:20pm

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented May 2, 2026

PR Summary

Medium Risk
Touches workflow editor dependency-clearing logic and many block definitions; mistakes could cause unintended subblock resets or stale UI state. The STT change forces ElevenLabs requests onto scribe_v2, which may affect output quality/compatibility for existing workflows expecting v1 behavior.

Overview
Fixes subblock dependency behavior across the workflow editor. Many block subblocks now declare explicit dependsOn (including richer { all, any } forms) so conditional inputs refresh/clear correctly when upstream fields like credential, provider, authMethod, or IDs change.

Improves dependency resolution logic. Adds getDependsOnFields and getSubBlocksDependingOnChange (canonical basic/advanced param aware) and updates collaborative editing to clear dependent subblocks using this new resolver.

Updates ElevenLabs STT model defaults. ElevenLabs STT is moved to scribe_v2 end-to-end (docs, block UI options, tool request body, and API route), and the API route no longer accepts/passes through a user-specified ElevenLabs model.

Reviewed by Cursor Bugbot for commit adfb2b9. Configure here.

@icecrasher321 icecrasher321 changed the title fix(blocks): depends on misalignments audit improvement(blocks): depends on misalignments audit May 2, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 2, 2026

Greptile Summary

This PR audits and corrects dependsOn declarations across ~30 block config files, ensuring dependent sub-blocks are properly gated when their parent fields are empty. Alongside the audit, it introduces getSubBlocksDependingOnChange in blocks/utils.ts (replacing the removed isDependency) and updates use-collaborative-workflow.ts to use it — fixing the auto-clear logic for object-form dependsOn and canonical field pairs that the old array-only filter missed. Additional fixes include: upgrading ElevenLabs STT to scribe_v2, correcting a google_maps bug where addressToValidate leaked into non-validate operations, renaming prioritycustomerRequestPriority in the Linear block to avoid collision, and refactoring Stagehand params to map fields explicitly per operation.

Confidence Score: 4/5

Safe to merge — all changes are additive config fixes or targeted bug corrections with no data-loss risk

Only P2 findings present (ElevenLabs model param still in schema but silently ignored). The core logic changes are well-tested and the dependsOn additions are mechanical and low-risk.

apps/sim/tools/stt/elevenlabs.ts — model param should be removed from the schema to match the hardcoded behaviour

Important Files Changed

Filename Overview
apps/sim/blocks/utils.ts Removes isDependency, adds getDependsOnFields + getSubBlocksDependingOnChange with canonical-pair awareness; clean refactor
apps/sim/blocks/utils.test.ts Adds thorough unit tests for getDependsOnFields and getSubBlocksDependingOnChange, covering array, object-form, and canonical-pair cases
apps/sim/hooks/use-collaborative-workflow.ts Replaces narrow inline filter (array-only dependsOn) with getSubBlocksDependingOnChange, fixing the auto-clear logic for object-form deps and canonical pairs
apps/sim/blocks/blocks/google_maps.ts Fixes bug where stale addressToValidate could override params.address on non-validate_address operations; now destructures it out of rest as well
apps/sim/tools/stt/elevenlabs.ts Hardcodes model to scribe_v2 in transform, but the model param remains in the schema with user-or-llm visibility, creating a misleading contract
apps/sim/app/api/tools/stt/route.ts Extracts ELEVENLABS_STT_MODEL constant, removes model param from transcribeWithElevenLabs; model is still used by other provider branches (Deepgram, Gemini, AssemblyAI)
apps/sim/blocks/blocks/linear.ts Renames priority to customerRequestPriority to avoid collision with issue-level priority; updates both params mapper and schema output
apps/sim/blocks/blocks/stagehand.ts Refactors params builder to explicitly map fields per operation (extract vs agent) instead of spreading all params; removes ambiguity
apps/sim/blocks/blocks/video_generator.ts Adds dependsOn to all provider/model-conditional sub-blocks across both VideoGenerator and VideoGeneratorV2; covers ~25 additions
apps/sim/blocks/blocks/tts.ts Adds dependsOn: ['provider'] to all provider-conditional sub-blocks; sampleRate gets dependsOn: ['encoding'] which is correct for that field

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Sub-block value changes\nin workflow editor] --> B[use-collaborative-workflow\nupdateSubBlock]
    B --> C[getSubBlocksDependingOnChange\nblocks/utils.ts]
    C --> D[buildCanonicalIndex\nlib/workflows/subblocks/visibility]
    D --> E{Is changedId\npart of a canonical group?}
    E -- Yes --> F[Expand changedFields set\nwith basicId + advancedIds + canonicalId]
    E -- No --> G[changedFields = changedId only]
    F --> H[Filter subBlocks where\ngetDependsOnFields overlaps changedFields]
    G --> H
    H --> I[Auto-clear dependent\nsub-block values]

    J[useDependsOnGate hook\nUI gating layer] --> K{dependsOn format?}
    K -- Array --> L[all fields required - AND logic]
    K -- Object all/any --> M[all AND logic + any OR logic]
    L --> N[Block/unblock sub-block input]
    M --> N
Loading

Comments Outside Diff (1)

  1. apps/sim/tools/stt/elevenlabs.ts, line 23-28 (link)

    P2 Accepted model param silently overridden

    The tool schema still declares model with visibility: 'user-or-llm', but the transform on line 71 (and the V2 tool on line 141) always hardcodes 'scribe_v2' — so any value an LLM or user provides is silently discarded. This creates a misleading contract: callers think model is honored, but it isn't. Since only scribe_v2 is now supported, the model param can be removed from the tool's params definition entirely.

Reviews (1): Last reviewed commit: "fix overclearing finds" | Re-trigger Greptile

@icecrasher321 icecrasher321 merged commit 20ee07c into staging May 2, 2026
14 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/dependson-gatings branch May 3, 2026 03:04
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