Skip to content

Conversation

@icecrasher321
Copy link
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
Copy link

vercel bot commented Jan 27, 2026

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

1 Skipped Deployment
Project Deployment Review Updated (UTC)
docs Skipped Skipped Jan 27, 2026 10:09pm

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 27, 2026

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

Filename Overview
apps/sim/blocks/types.ts Added hiddenFromDisplay flag to OutputFieldDefinition for hiding fields from UI/logs
apps/sim/executor/utils/output-filter.ts New utility function to filter block outputs based on hiddenFromDisplay flag and internal keys
apps/sim/blocks/blocks/human_in_the_loop.ts Added missing output fields (response, submission, resumeInput, submittedAt) with hiddenFromDisplay flags
apps/sim/executor/execution/block-executor.ts Replaced inline filtering logic with shared filterOutputForLog utility function
apps/sim/lib/workflows/blocks/block-outputs.ts Updated 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

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

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
Collaborator Author

@cursor review

@icecrasher321
Copy link
Collaborator Author

@cursor review

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

@cursor cursor bot left a comment

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

@icecrasher321 icecrasher321 merged commit 0894278 into staging Jan 27, 2026
12 checks passed
@icecrasher321 icecrasher321 deleted the feat/blocks-outputs-inputs branch January 27, 2026 22:35
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.

3 participants