Skip to content

feat(cre/sdk): add capability_id field to CapabilityResponse#332

Closed
vreff wants to merge 4 commits intomainfrom
add-capability-id-to-response
Closed

feat(cre/sdk): add capability_id field to CapabilityResponse#332
vreff wants to merge 4 commits intomainfrom
add-capability-id-to-response

Conversation

@vreff
Copy link
Copy Markdown
Contributor

@vreff vreff commented Mar 26, 2026

Summary

Add a top-level capability_id string field (field number 3) to the CapabilityResponse message in both v1alpha and v1beta protos.

Motivation

When a workflow execution fails due to a capability error, the engine currently has no structured way to attribute the failure to a specific capability in metrics. The error string crosses the WASM boundary and loses capability context.

Changes

  • cre/sdk/v1alpha/sdk.proto: Added string capability_id = 3 to CapabilityResponse
  • cre/sdk/v1beta/sdk.proto: Same change for v1beta
  • Generated Go code: Regenerated via go generate

Compatibility

This is a backward-compatible addition. Existing consumers ignore the new field. The field is populated by the WASM host when constructing error responses, allowing the workflow engine to include the failing capability ID in the platform_engine_workflow_execution_failed_count metric.

Downstream PRs

  • chainlink-common: Set capability_id in the WASM host error path
  • cre-sdk-go: Propagate capability_id through the SDK
  • chainlink: Read capability_id from responses for metrics

Add a top-level capability_id string field (field number 3) to the
CapabilityResponse message in both v1alpha and v1beta protos. This is a
backward-compatible addition that allows the host to tag error responses
with the ID of the capability that failed, enabling downstream consumers
to attribute workflow execution failures to specific capabilities in
metrics and observability.
@vreff vreff requested review from a team as code owners March 26, 2026 18:26
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 26, 2026

⚠️ No Changeset found

Latest commit: 611d38b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Copy Markdown

👋 vreff, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 26, 2026

The latest Buf updates on your PR. Results from workflow Regenerate Protobuf Files / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed⏩ skippedMar 26, 2026, 6:40 PM

vreff added a commit to smartcontractkit/chainlink-common that referenced this pull request Mar 26, 2026
Populate the new CapabilityResponse.capability_id field when a capability
call returns an error. This allows the workflow engine to attribute
execution failures to the specific capability that caused them.

Depends on: smartcontractkit/chainlink-protos#332
vreff and others added 2 commits March 26, 2026 14:37
Add an optional failed_capability_id field (field 4) to ExecutionResult in
both v1alpha and v1beta. This allows the SDK to propagate the ID of the
capability that caused an execution failure, so the engine can read it
directly from the result without side-channel state tracking.
@vreff vreff closed this Mar 26, 2026
@vreff vreff deleted the add-capability-id-to-response branch March 26, 2026 19:20
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