Skip to content

feat(logs): record which deployment version of a child workflow ran - #10383

Merged
waleedlatif1 merged 4 commits into
stagingfrom
feat/child-deployment-version-span
Nov 24, 2026
Merged

waleedlatif1 merged 4 commits into
stagingfrom
feat/child-deployment-version-span

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • A deployed run calls each child workflow's active version. The handler already loads that deploymentVersionId to authorize the call, but the parent trace kept only childWorkflowSnapshotId, and that id can change with no redeploy (orphaned-snapshot cleanup, block migrations applied before hashing)
  • Spans now carry an optional childDeploymentVersionId:
    • on a workflow block's span, on success and on failure, for a deployed child
    • on a workflow_executor Agent tool span after a successful call
  • It is read only from workflow blocks and that tool, so a Function block or another tool returning the same key records nothing. Draft children and custom blocks never get one, so a custom block's consumer learns nothing about the publisher's workflow
  • No column, migration, backfill or UI. The v2 log contract documents the field (OpenAPI and CLI types regenerated)
  • A reader matches the id from sim logs get <runId> --trace against sim workflows versions list <workflowId>

Limits

  • Draft children have no version, and runs recorded before this change still need date matching
  • A child that fails before its version loads has none
  • Failed Agent tool calls, and calls inside an Agent-tool child, stay unknown
  • The id names the stored version, not later variable edits or migrations applied by a newer Sim release

Test plan

  • Handler: a deployed child records the id on success, when the child reports a failure, and when it throws; a draft child records none
  • Block executor: a failed workflow block's output gets the id; a custom block's does not
  • Spans: a workflow block span gets the id (success and failure) and drops it from displayed output; a Function block returning the key does not; a workflow_executor tool span gets it in both span builders; another tool returning the key does not
  • Each guard proven red by reverting it
  • check:openapi passes

A deployed run calls each child workflow's active version, and the handler
already loads that version id to authorize the call, but the parent trace
only kept the child's snapshot id. Snapshot ids are not a stable graph
identity: orphaned-snapshot cleanup and block migrations can mint a new id
with no redeploy.

Spans now carry an optional childDeploymentVersionId:
- on a workflow block's span, on success and failure, for deployed children
- on a workflow_executor Agent tool span after a successful call

It is taken only from workflow blocks and that tool, so another block or tool
returning the same key records nothing. Draft children and custom blocks never
get one. The v2 log contract documents the field.
@vercel

vercel Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Nov 24, 2026 10:38pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 11 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] No separate new issue blocks merging this revision.

Summary

The PR records child deployment versions in traces and shows them in CLI text output.

  • Parent workflow calls carry the deployed child’s version through failures.
  • Trace spans and the CLI show which deployed child version ran.

Reviews (3) · Last reviewed commit: "fix(agent): only drop the child version ..." · Reviewed by Greptile

…e CLI

- A custom tool titled workflow_executor loses its custom_ prefix before the
  span factory sees it, so its result could claim a child version. The Agent
  drops the key from custom tool results where the prefix is stripped.
- The version is recorded only after the child passes the same-workspace
  check, so that refusal never names another workspace's version.
- `sim logs get --trace` text output shows the child version.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot 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.

1 issue found across 15 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/sim/executor/handlers/agent/handler.ts">

<violation number="1" location="apps/sim/executor/handlers/agent/handler.ts:3248">
P3: This removes `childDeploymentVersionId` from every custom tool result, so an ordinary custom tool returning that field loses user data even though only `workflow_executor` should promote it to a span field. Restrict the omission to the normalized `workflow_executor` name.</violation>
</file>

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot 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 issues found across 15 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 6b87cf8 into staging Nov 24, 2026
87 checks passed
@waleedlatif1
waleedlatif1 deleted the feat/child-deployment-version-span branch November 24, 2026 22:57

This branch was previously deployed

1 inactive deployment
Preview — c960d9fc Deployed Nov 24, 2026 by vercel[bot]
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