Skip to content

v0.5.112: trace spans improvements, fathom integration, jira fixes, canvas navigation updates#3545

Merged
waleedlatif1 merged 9 commits intomainfrom
staging
Mar 12, 2026
Merged

v0.5.112: trace spans improvements, fathom integration, jira fixes, canvas navigation updates#3545
waleedlatif1 merged 9 commits intomainfrom
staging

Conversation

@waleedlatif1
Copy link
Collaborator

@waleedlatif1 waleedlatif1 commented Mar 12, 2026

waleedlatif1 and others added 7 commits March 12, 2026 01:19
* fix(blocks): remap condition/router IDs when duplicating blocks

Condition and router blocks embed IDs in the format `{blockId}-{suffix}`
inside their subBlock values and edge sourceHandles. When blocks were
duplicated, these IDs were not updated to reference the new block ID,
causing duplicate handle IDs and broken edge routing.

Fixes all four duplication paths: single block duplicate, copy/paste,
workflow duplication (server-side), and workflow import.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(blocks): deep-clone subBlocks before mutating condition IDs

Shallow copy of subBlocks meant remapConditionIds could mutate the
source data (clipboard on repeated paste, or input workflowState on
import). Deep-clone subBlocks in both regenerateBlockIds and
regenerateWorkflowIds to prevent this.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(blocks): remap condition IDs in regenerateWorkflowStateIds (template use)

The template use code path was missing condition/router ID remapping,
causing broken condition blocks when creating workflows from templates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…imeSegments (#3534)

* fix(traces): prevent condition blocks from rendering source agent's timeSegments

Condition blocks spread their source block's entire output into their own
output. When the source is an agent, this leaked providerTiming/timeSegments
into the condition's output, causing buildTraceSpans to create "Initial
response" as a child of the condition span instead of the agent span.

Two fixes:
- Skip timeSegment child creation for condition block types in buildTraceSpans
- Filter execution metadata (providerTiming, tokens, toolCalls, model, cost)
  from condition handler's filterSourceOutput

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(traces): guard condition blocks from leaked metadata on old persisted logs

Extend isConditionBlockType guards to also skip setting span.providerTiming,
span.cost, span.tokens, and span.model for condition blocks. This ensures
old persisted logs (recorded before the filterSourceOutput fix) don't display
misleading execution metadata on condition spans.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(traces): guard toolCalls fallback path for condition blocks on old logs

The else branch that extracts toolCalls from log.output also needs a
condition block guard, otherwise old persisted logs with leaked toolCalls
from the source agent would render on the condition span.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor(traces): extract isCondition to local variable for readability

Cache isConditionBlockType(log.blockType) in a local const at the top
of the forEach loop instead of calling it 6 times per iteration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* feat(fathom): add Fathom AI Notetaker integration

* fix(fathom): address PR review feedback

- Add response.ok checks to all 5 tool transformResponse functions
- Fix include_summary default to respect explicit false (check undefined)
- Add externalId validation before URL interpolation in webhook deletion

* fix(fathom): address second round PR review feedback

- Remove redundant 204 status check in deleteFathomWebhook (204 is ok)
- Use consistent undefined-guard pattern for all include flags
- Add .catch() fallback on webhook creation JSON parse
- Change recording_id default from 0 to null to avoid misleading sentinel

* fix(fathom): add missing crm_matches to list_meetings transform and fix action_items type

- Add crm_matches pass-through in list_meetings transform (was silently dropped)
- Fix action_items type to match API schema (description, user_generated, completed, etc.)
- Add crm_matches type with contacts, companies, deals, error fields

* fix(fathom): guard against undefined webhook id on creation success

* fix(fathom): add type to nested trigger outputs and fix boolean coercion

- Add type: 'object' to recorded_by and default_summary trigger outputs
- Use val === true || val === 'true' pattern for include flag coercion
  to safely handle both boolean and string values from providerConfig

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Lakee Sivaraya <71339072+lakeesiv@users.noreply.github.com>
Co-authored-by: Vikhyath Mondreti <vikhyath@simstudio.ai>
Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com>
The GET /rest/api/3/search/jql endpoint requires an explicit `fields`
parameter to return issue data. Without it, only the issue `id` is
returned with all other fields empty. This adds `fields=*all` as the
default when the user doesn't specify custom fields.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Mar 12, 2026

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Mar 12, 2026 8:30pm

Request Review

@cursor
Copy link

cursor bot commented Mar 12, 2026

PR Summary

Medium Risk
Adds a new third-party Fathom integration (API tools + external webhook subscription lifecycle) and changes workflow duplication ID-remapping logic, which could affect existing workflows if edge/handle rewriting is incorrect. Other changes are low risk but touch execution tracing and OAuth/Jira scope behavior.

Overview
Adds Fathom as a first-class tool/trigger integration: new FathomBlock, tool implementations (fathom_list_meetings, fathom_get_summary, fathom_get_transcript, fathom_list_team_members, fathom_list_teams), trigger configs (fathom_new_meeting, fathom_webhook), docs page, icons, and registry wiring. Webhook provider subscriptions now create/delete Fathom webhooks via the Fathom API and store an externalId for cleanup.

Fixes block duplication/paste/regenerate flows to remap condition/router IDs and edge sourceHandles when block IDs change (new condition-ids.ts used across DB duplication, persistence utils, and client store utilities).

Improves observability/UI correctness by filtering provider/model metadata out of condition-block source outputs and preventing condition blocks from rendering upstream providerTiming/timeSegments/cost/token details in trace spans.

Cleans up OAuth by removing the unused github-repo generic OAuth provider and env vars, adds missing Jira scope write:attachment:jira, updates Jira search to default fields=*all, and tweaks canvas selection/panning behavior (panOnDrag enabling middle-mouse panning behavior in cursor mode).

Written by Cursor Bugbot for commit aa0101c. Configure here.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 12, 2026

Greptile Summary

This PR bundles seven separate improvements: a full Fathom AI Notetaker integration (block, 5 tools, 2 triggers, webhook lifecycle management), two complementary fixes that prevent condition blocks from inheriting AI-agent trace data (condition-handler.ts + trace-spans.ts), a fix that correctly remaps condition/router subblock IDs and edge sourceHandle values during block duplication, Jira enhancements (missing write:attachment:jira OAuth scope and an explicit fields parameter on the JQL search endpoint), middle-mouse-button panning support in cursor mode, and removal of the unused github-repo generic OAuth provider.

Key observations:

  • The Fathom integration follows existing patterns (API-key auth, user-only visibility for credentials, external webhook lifecycle matching Grain/Calendly/etc.) and looks well-structured.
  • The condition-ID remapping logic (remapConditionBlockIds, remapConditionEdgeHandle) is functionally correct across all three call sites (store duplication, client-side regeneration, and server-side workflow duplication), but the slice(oldBlockId.length) idiom is subtle — both functions rely on the fact that slicing at oldBlockId.length (not prefix.length) preserves the separating hyphen in the suffix, making ${newBlockId}${suffix} produce the correct ${newBlockId}-{rest} format.
  • The Jira fields=*all default added by the search-issues fix may return very large payloads for wide queries and could cause downstream timeout or context-overflow issues — *navigable or a curated field list would be safer.
  • fathom_new_meeting.ts and fathom_webhook.ts are nearly line-for-line identical and are good candidates for a shared factory in utils.ts.

Confidence Score: 4/5

  • PR is safe to merge; no critical bugs found, though the Jira fields=*all default warrants attention.
  • All changes are well-structured and follow established patterns. The condition-ID remapping logic is correct across all three duplication paths. The Fathom integration is thorough (webhook lifecycle, security validation, correct credential visibility). The one substantive concern is the Jira search defaulting to fields=*all, which could produce very large API responses and may affect performance or downstream LLM context limits. The slice-idiom in condition-ids.ts is a minor readability issue, not a correctness bug.
  • apps/sim/tools/jira/search_issues.ts — the fields=*all default should be reviewed for payload-size impact.

Important Files Changed

Filename Overview
apps/sim/lib/workflows/condition-ids.ts New utility module for remapping condition/router block IDs during duplication. Logic is functionally correct but the slice-at-oldBlockId.length idiom is subtle and slightly inconsistent in style — worth clarifying.
apps/sim/lib/workflows/persistence/duplicate.ts Adds condition/router ID remapping to workflow duplication; correctly deep-clones subBlocks before mutation and remaps sourceHandles on edges.
apps/sim/stores/workflows/utils.ts Adds remapConditionIds helper and integrates it into regenerateWorkflowIds and regenerateBlockIds; correctly deep-clones subBlocks before mutation in all three call sites.
apps/sim/executor/handlers/condition/condition-handler.ts Strips providerTiming, tokens, toolCalls, model, and cost from condition block output, preventing AI-agent fields from leaking into condition block results.
apps/sim/lib/logs/execution/trace-spans/trace-spans.ts Guards all AI-specific span properties (providerTiming, cost, tokens, model, timeSegments, toolCalls) behind isCondition checks, preventing condition blocks from inheriting source-agent trace data.
apps/sim/tools/jira/search_issues.ts Adds explicit fields parameter to Jira JQL search; defaults to *all when no fields are specified, which can return very large payloads and may cause performance issues.
apps/sim/blocks/blocks/fathom.ts New Fathom block with 5 operations, API key auth, and trigger support; follows established patterns. Note: the block has three subblocks with id 'apiKey' (one main + two from trigger spreads), consistent with how other trigger-capable blocks like grain work.
apps/sim/lib/webhooks/provider-subscriptions.ts Adds createFathomWebhookSubscription and deleteFathomWebhook; mirrors pattern of other providers, correctly handles 404 on delete, and validateAlphanumericId allows hyphens so UUID-style Fathom IDs will pass validation.

Sequence Diagram

sequenceDiagram
    participant User
    participant SimUI as Sim Canvas
    participant SimAPI as Sim API
    participant FathomAPI as Fathom API

    Note over SimUI,FathomAPI: Fathom Trigger Setup
    User->>SimUI: Configure Fathom block + trigger (API key, options)
    SimUI->>SimAPI: POST /api/webhooks (providerConfig incl. apiKey)
    SimAPI->>FathomAPI: POST /external/v1/webhooks (destination_url, triggered_for, include_* flags)
    FathomAPI-->>SimAPI: { id: webhookId }
    SimAPI->>SimAPI: Store externalId = webhookId in providerConfig
    SimAPI-->>SimUI: Webhook created

    Note over FathomAPI,SimAPI: Runtime: New Meeting Event
    FathomAPI->>SimAPI: POST /api/webhooks/trigger/{path} (meeting payload)
    SimAPI->>SimAPI: Match webhook → workflow, inject payload as trigger inputs
    SimAPI-->>FathomAPI: 200 OK

    Note over User,FathomAPI: Tool Usage (List Meetings / Get Summary / Get Transcript)
    User->>SimUI: Run workflow with Fathom block
    SimUI->>SimAPI: Execute block (operation, apiKey, params)
    SimAPI->>FathomAPI: GET /external/v1/meetings or /recordings/{id}/summary|transcript
    FathomAPI-->>SimAPI: Meeting / summary / transcript data
    SimAPI-->>SimUI: Block output

    Note over SimUI,FathomAPI: Trigger Cleanup
    User->>SimUI: Remove trigger / delete workflow
    SimUI->>SimAPI: DELETE webhook
    SimAPI->>FathomAPI: DELETE /external/v1/webhooks/{externalId}
    FathomAPI-->>SimAPI: 200/404
    SimAPI-->>SimUI: Cleanup complete
Loading

Comments Outside Diff (1)

  1. apps/sim/tools/jira/search_issues.ts, line 2279-2281 (link)

    *all default may significantly increase payload size

    When no fields are specified, the fix now sends fields=*all to the Jira JQL search endpoint. *all returns every available field on every issue, which can make the response payload very large for queries that return many issues. This may cause downstream issues (timeouts, memory pressure, LLM context overflow when the results are passed to an agent).

    Consider using a more targeted default like *navigable (which returns only the fields shown in the Jira UI) or a curated list of the most commonly needed fields (e.g. summary,status,assignee,priority,issuetype,created,updated) instead of *all.

Last reviewed commit: c939f8a

Use explicit hyphen separator instead of relying on slice offset to
implicitly include the hyphen in the suffix, making the intent clearer.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@waleedlatif1
Copy link
Collaborator Author

@greptile

@waleedlatif1
Copy link
Collaborator Author

@cursor review

* feat(slack): add email field to get user and list users tools

* fix(slack): use empty string fallback for email and make type non-optional

* fix(slack): comment out users:read.email scope pending app review
@waleedlatif1 waleedlatif1 merged commit e9bdc57 into main Mar 12, 2026
11 checks passed
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

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