Skip to content

fix(resp-format): add UI warning for invalid json in response format#652

Merged
icecrasher321 merged 5 commits intostagingfrom
fix/resp-format-json-extraction
Jul 10, 2025
Merged

fix(resp-format): add UI warning for invalid json in response format#652
icecrasher321 merged 5 commits intostagingfrom
fix/resp-format-json-extraction

Conversation

@icecrasher321
Copy link
Collaborator

@icecrasher321 icecrasher321 commented Jul 10, 2025

Description

Add realtime UI warning if invalid json in response format field.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Screen.Recording.2025-07-10.at.11.50.42.AM.mov

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally and in CI (bun run test)
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have updated version numbers as needed (if needed)
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Security Considerations:

  • My changes do not introduce any new security vulnerabilities
  • I have considered the security implications of my changes

@vercel
Copy link

vercel bot commented Jul 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sim ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 10, 2025 8:24pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Skipped (Inspect) Jul 10, 2025 8:24pm

@delve-auditor
Copy link

delve-auditor bot commented Jul 10, 2025

No security or compliance issues detected. Reviewed everything up to a0a4b21.

Security Overview
  • 🔎 Scanned files: 3 changed file(s)
Detected Code Changes
Change Type Relevant files
Enhancement ► code.tsx
    Add JSON validation for response format
► sub-block.tsx
    Add JSON validation UI elements
► agent-handler.ts
    Improve response format handling
Documentation ► function.mdx
    Update output format and descriptions
► response.mdx
    Update response fields documentation
► Multiple tool .mdx files
    Standardize output format documentation

Reply to this PR with @delve-auditor followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.

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.

PR Summary

Enhances JSON handling with robust parsing and UI feedback for response formats in workflow blocks.

  • Added real-time JSON validation in apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/components/sub-block/sub-block.tsx with visual AlertTriangle indicator and tooltip
  • Implemented multi-strategy JSON parsing in apps/sim/executor/handlers/agent/agent-handler.ts including markdown code block extraction and bracket matching
  • Added visual feedback in Code component with red border/background styling for invalid JSON states
  • Improved error handling by adding informative warnings instead of silent failures during JSON parsing

3 files reviewed, 2 comments
Edit PR Review Bot Settings | Greptile

…/workflow-block/components/sub-block/components/code.tsx

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@vercel vercel bot temporarily deployed to Preview – docs July 10, 2025 20:17 Inactive
@icecrasher321 icecrasher321 changed the title fix(resp-format): json escaping issues + add UI warning for invalid json fix(resp-format): add UI warning for invalid json in response format Jul 10, 2025
@icecrasher321 icecrasher321 merged commit 614d826 into staging Jul 10, 2025
5 of 6 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/resp-format-json-extraction branch July 10, 2025 22:25
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
…son-extraction

fix(resp-format): add UI warning for invalid json in response format
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