-
Notifications
You must be signed in to change notification settings - Fork 3k
improvement(hitl): show resume url in tag dropdown within hitl block #2464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improvement(hitl): show resume url in tag dropdown within hitl block #2464
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryExtended the self-reference handling for Changes:
Issue Found:
Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant TagDropdown
participant getBlockOutputPaths
participant BlockOutputs
User->>TagDropdown: Type < to reference block outputs
alt activeSourceBlockId is set
TagDropdown->>TagDropdown: Check sourceBlock.type
alt approval OR human_in_the_loop (line 649)
TagDropdown->>getBlockOutputPaths: Get dynamic outputs
TagDropdown->>TagDropdown: Check isSelfReference
alt Self-reference
TagDropdown->>TagDropdown: Filter to .url only
end
else Other block types
TagDropdown->>getBlockOutputPaths: Get all outputs
end
else activeSourceBlockId is null
TagDropdown->>TagDropdown: Loop accessible blocks
TagDropdown->>TagDropdown: Skip self-ref except approval/human_in_the_loop (line 848)
alt approval OR human_in_the_loop (line 967)
TagDropdown->>getBlockOutputPaths: Get dynamic outputs
TagDropdown->>TagDropdown: Check isSelfReference
alt Self-reference
TagDropdown->>TagDropdown: Filter to .url only
end
end
end
TagDropdown->>User: Display filtered tags
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 files reviewed, 1 comment
| if ( | ||
| accessibleBlockId === blockId && | ||
| accessibleBlock.type !== 'approval' && | ||
| accessibleBlock.type !== 'human_in_the_loop' | ||
| ) | ||
| continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Self-reference exception added for human_in_the_loop, but unlike approval blocks (lines 967-979), there's no corresponding filter to restrict self-references to only the url output. The approval block uses blockTags = isSelfReference ? allTags.filter((tag) => tag.endsWith('.url')) : allTags to prevent circular references.
For human_in_the_loop, when self-referencing, inputFormat fields will also be exposed even though they aren't available at pause time - only url is populated when the block pauses. Consider adding similar handling:
} else if (accessibleBlock.type === 'approval' || accessibleBlock.type === 'human_in_the_loop') {
at line 967, so both block types share the same self-reference filtering logic.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tag-dropdown/tag-dropdown.tsx
Line: 848:853
Comment:
**logic:** Self-reference exception added for `human_in_the_loop`, but unlike `approval` blocks (lines 967-979), there's no corresponding filter to restrict self-references to only the `url` output. The `approval` block uses `blockTags = isSelfReference ? allTags.filter((tag) => tag.endsWith('.url')) : allTags` to prevent circular references.
For `human_in_the_loop`, when self-referencing, inputFormat fields will also be exposed even though they aren't available at pause time - only `url` is populated when the block pauses. Consider adding similar handling:
```
} else if (accessibleBlock.type === 'approval' || accessibleBlock.type === 'human_in_the_loop') {
```
at line 967, so both block types share the same self-reference filtering logic.
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should reuse the same utility that the approval block uses to filter to only allow url in tag dropdown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're absolutely right! The human_in_the_loop block should use the same filtering logic as the approval block to restrict self-references to only the url output. Looking at the code, I can see that the approval block has proper filtering logic starting at line 967, but the human_in_the_loop block doesn't have this same protection.
Here's the fix to add the same filtering logic for human_in_the_loop blocks:
| if ( | |
| accessibleBlockId === blockId && | |
| accessibleBlock.type !== 'approval' && | |
| accessibleBlock.type !== 'human_in_the_loop' | |
| ) | |
| continue | |
| } else if (accessibleBlock.type === 'approval' || accessibleBlock.type === 'human_in_the_loop') { | |
| const dynamicOutputs = getBlockOutputPaths(accessibleBlock.type, mergedSubBlocks) | |
| const isSelfReference = accessibleBlockId === blockId | |
| if (dynamicOutputs.length > 0) { | |
| const allTags = dynamicOutputs.map((path) => `${normalizedBlockName}.${path}`) | |
| blockTags = isSelfReference ? allTags.filter((tag) => tag.endsWith('.url')) : allTags | |
| } else { | |
| const outputPaths = getBlockOutputPaths(accessibleBlock.type, mergedSubBlocks) | |
| const allTags = outputPaths.map((path) => `${normalizedBlockName}.${path}`) | |
| blockTags = isSelfReference ? allTags.filter((tag) => tag.endsWith('.url')) : allTags | |
| } |
This change combines both block types into a single condition and applies the same self-reference filtering logic - when a human_in_the_loop block references itself, only tags ending with .url will be available, preventing circular references while still allowing access to the resume URL during pause time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Comments (1)
-
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tag-dropdown/tag-dropdown.tsx, line 649 (link)logic: This condition also needs to include
human_in_the_loopto apply the same self-reference filtering (restricting to.urloutput only) in theactiveSourceBlockIdcode path. Without this, when a user explicitly selects ahuman_in_the_loopblock to reference, theinputFormatfields will be shown even for self-references.
2 files reviewed, 1 comment
Summary
Add a check for human in the loop , to directly resolve the url
Type of Change
Testing
Manually tested
Checklist