Skip to content

feat(proto): auto-discover payload-visitor roots from coresdk#2214

Open
cconstable wants to merge 1 commit into
mainfrom
extstore/improve-payload-visitor-coverage
Open

feat(proto): auto-discover payload-visitor roots from coresdk#2214
cconstable wants to merge 1 commit into
mainfrom
extstore/improve-payload-visitor-coverage

Conversation

@cconstable

@cconstable cconstable commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

What was changed

  • Replace the hand-maintained visitor path list in gen-payload-visitor.ts with auto generated roots

Why?

  • Avoids the need to add new payload bearing types to the visitor generator manually.

Checklist

  • Added tests.

Replace the hand-maintained ROOTS list in gen-payload-visitor.ts with automatic discovery: a root is any payload-bearing message under the coresdk namespace that no other reachable message embeds (WorkflowActivation, ActivityTaskCompletion, NexusTask, etc.). Regenerating now picks up new worker-boundary message types without editing the generator. Regenerated payload-visitor.generated.ts.
@cconstable cconstable requested a review from a team as a code owner July 15, 2026 17:47
Comment on lines -14 to +15
const ROOTS = [
{ type: 'coresdk.workflow_activation.WorkflowActivation', entry: 'walkWorkflowActivation' },
{ type: 'coresdk.workflow_completion.WorkflowActivationCompletion', entry: 'walkWorkflowActivationCompletion' },
] as const;
// Namespaces scanned for root messages.
const ROOT_NAMESPACES = ['coresdk'] as const;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generate everything under coresdk instead of explicit types now

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.

Are all of the messages that are handled lang side in the coresdk namespace? I think the generated code looks correct for task processing. Unsure whether we'll use the visitor for client calls or not; in Go we used the visitor, in Python we piggy-backed onto the existing encode/decode calls.

Comment on lines -14 to +15
const ROOTS = [
{ type: 'coresdk.workflow_activation.WorkflowActivation', entry: 'walkWorkflowActivation' },
{ type: 'coresdk.workflow_completion.WorkflowActivationCompletion', entry: 'walkWorkflowActivationCompletion' },
] as const;
// Namespaces scanned for root messages.
const ROOT_NAMESPACES = ['coresdk'] as const;

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.

Are all of the messages that are handled lang side in the coresdk namespace? I think the generated code looks correct for task processing. Unsure whether we'll use the visitor for client calls or not; in Go we used the visitor, in Python we piggy-backed onto the existing encode/decode calls.

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