Skip to content

Conversation

@icecrasher321
Copy link
Collaborator

Summary

Do not filter out any agent outputs from trace spans.

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

vercel bot commented Jan 30, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jan 30, 2026 8:25pm

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 30, 2026

Greptile Overview

Greptile Summary

Removed hiddenFromDisplay flags from providerTiming and cost outputs in the agent block configuration, and changed cost type from number to json to match the actual data structure.

Key changes:

  • providerTiming output no longer hidden from display in trace spans
  • cost output no longer hidden from display in trace spans
  • cost type changed from number to json (matches implementation in trace-spans.ts:186-192 where cost is an object with input, output, and total fields)

Impact:

  • Agent execution logs will now include cost and timing information in trace spans
  • Fixes inconsistency where cost was typed as number but actually returns an object structure
  • UI can now display cost breakdowns and provider timing data for agent blocks

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • The change is straightforward and fixes a bug where cost and timing data were being filtered out from trace spans. The type change for cost from number to json correctly reflects the actual data structure used throughout the codebase.
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/blocks/blocks/agent.ts Removed hiddenFromDisplay flag from providerTiming and cost outputs, changed cost type from number to json

Sequence Diagram

sequenceDiagram
    participant Executor
    participant AgentBlock
    participant OutputFilter
    participant TraceSpans
    participant Display

    Note over AgentBlock: PR Change: Remove hiddenFromDisplay flags
    
    Executor->>AgentBlock: Execute agent block
    AgentBlock->>AgentBlock: Generate outputs (content, cost, providerTiming)
    
    AgentBlock-->>Executor: Return all outputs
    
    Executor->>OutputFilter: filterOutputForLog(blockType, output)
    
    alt Before PR
        OutputFilter->>OutputFilter: Check hiddenFromDisplay flag
        OutputFilter->>OutputFilter: Filter out cost & providerTiming
        OutputFilter-->>Executor: Filtered output (no cost/providerTiming)
    else After PR
        OutputFilter->>OutputFilter: Check hiddenFromDisplay flag
        OutputFilter->>OutputFilter: Include all outputs
        OutputFilter-->>Executor: Complete output (with cost/providerTiming)
    end
    
    Executor->>TraceSpans: buildTraceSpans(executionResult)
    
    alt After PR
        TraceSpans->>TraceSpans: Extract log.output.providerTiming
        TraceSpans->>TraceSpans: Extract log.output.cost
        TraceSpans->>TraceSpans: Add to span.providerTiming
        TraceSpans->>TraceSpans: Add to span.cost
    end
    
    TraceSpans-->>Display: TraceSpan with cost & timing data
    Display->>Display: Display cost & timing in UI
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.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@icecrasher321 icecrasher321 merged commit a280a53 into staging Jan 30, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/agent-logs branch January 30, 2026 23:01
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.

2 participants