Skip to content

fix(hitl): add missing fields to block configs - #3027

Merged
icecrasher321 merged 4 commits into
stagingfrom
feat/blocks-outputs-inputs
Jan 27, 2026
Merged

fix(hitl): add missing fields to block configs#3027
icecrasher321 merged 4 commits into
stagingfrom
feat/blocks-outputs-inputs

Conversation

@icecrasher321

Copy link
Copy Markdown
Collaborator

Summary

Cleanup code to hide fields from display logs. Add missing fields for HITL.

Type of Change

  • Bug fix
  • Other: Code quality improvement

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

vercelBot commented Jan 27, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
ProjectDeploymentReviewUpdated (UTC)
docsSkippedSkippedJan 27, 2026 10:09pm

Request Review

@greptile-apps

Copy link
Copy Markdown
Contributor

Greptile Overview

Greptile Summary

This PR introduces a systematic approach to hiding internal block output fields from display logs and UI while keeping them available for execution. The implementation adds a hiddenFromDisplay flag to output field definitions and creates a centralized filterOutputForLog utility to handle filtering consistently across the codebase.

Key Changes:

  • Added hiddenFromDisplay flag to OutputFieldDefinition type to mark fields that should be hidden from logs/UI
  • Created centralized filterOutputForLog utility in apps/sim/executor/utils/output-filter.ts to replace scattered filtering logic
  • Added missing output fields to human_in_the_loop block (response, submission, resumeInput, submittedAt) with appropriate hiddenFromDisplay flags
  • Marked sensitive/internal fields as hidden: providerTiming, cost (agent), childTraceSpans (workflow blocks), response/submission/resumeInput (HITL)
  • Changed agent block output types from any to json for better type safety
  • Removed approval block special handling from tag dropdown and output logic
  • Updated trigger block filtering to use type-safe isTriggerInternalKey guard
  • Simplified resume UI to show "No display data configured" instead of rendering pause response data

Code Quality Improvements:

  • Eliminated duplicate filtering logic across multiple files by centralizing in a single utility
  • Improved type safety with proper type guards and typed constants
  • Better separation of concerns between execution data and display data

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Well-structured refactoring with centralized filtering logic, proper type safety, and consistent handling across all block types
  • No files require special attention

Important Files Changed

FilenameOverview
apps/sim/blocks/types.tsAdded hiddenFromDisplay flag to OutputFieldDefinition for hiding fields from UI/logs
apps/sim/executor/utils/output-filter.tsNew utility function to filter block outputs based on hiddenFromDisplay flag and internal keys
apps/sim/blocks/blocks/human_in_the_loop.tsAdded missing output fields (response, submission, resumeInput, submittedAt) with hiddenFromDisplay flags
apps/sim/executor/execution/block-executor.tsReplaced inline filtering logic with shared filterOutputForLog utility function
apps/sim/lib/workflows/blocks/block-outputs.tsUpdated to respect hiddenFromDisplay in filterOutputsByCondition, removed approval block handling

Sequence Diagram

sequenceDiagram
participant UI as Resume UI
participant Executor as Block Executor
participant Filter as Output Filter
participant Config as Block Config
participant Log as Block Log
Note over UI,Log: Human-in-the-loop Block Execution
Executor->>Config: Get block outputs schema
Config-->>Executor: Returns outputs with hiddenFromDisplay flags
Executor->>Executor: Execute HITL block
Executor->>Executor: Generate output (url, response, submission, etc.)
Note over Executor,Filter: Filtering for Display/Logs
Executor->>Filter: filterOutputForLog(blockType, output, options)
Filter->>Config: Check hiddenFromDisplay flag for each field
Config-->>Filter: Return field metadata
Filter->>Filter: Skip fields with hiddenFromDisplay=true
Filter->>Filter: Skip fields starting with '_'
Filter->>Filter: Skip additionalHiddenKeys (e.g., 'resume')
Filter-->>Executor: Return filtered output
Executor->>Log: Write filtered output to block log
Executor->>UI: Send filtered output for display
Note over UI: Only shows: url, resumeEndpoint, submittedAt, and form fields
Note over Log: Hidden: response, submission, resumeInput, cost, providerTiming
Loading

@greptile-appsgreptile-appsBot left a comment

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.

No files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@icecrasher321

Copy link
Copy Markdown
CollaboratorAuthor

@cursor review

Comment threadapps/sim/executor/utils/output-filter.ts Outdated
@icecrasher321

Copy link
Copy Markdown
CollaboratorAuthor

@cursor review

@Sg312
Sg312 self-requested a review January 27, 2026 22:12

@cursorcursorBot 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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Comment threadapps/sim/blocks/blocks/human_in_the_loop.ts
@icecrasher321
icecrasher321 merged commit 0894278 into stagingJan 27, 2026
12 checks passed
@icecrasher321
icecrasher321 deleted the feat/blocks-outputs-inputs branch January 27, 2026 22:35
royceP2 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Mar 3, 2026
* fix(hitl): add missing fields to block configs
* update copilot paths
* one more case
* update helper usage
Sign up for freeto 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.

2 participants

@icecrasher321@Sg312