Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor execution #257

Merged
merged 4 commits into from
Dec 18, 2024
Merged

Conversation

toyamarinyon
Copy link
Contributor

In order to prototype the retry, the code was implemented in hard copy, and each of the instrumentation and other code had to be implemented, so it was refactored to be in one place.

Consolidate duplicate code between executeStep and retryStep into a shared
generateText function. Created ExecutionContext interface to standardize
data passing between functions.

Key changes:
- Extract core text generation logic into standalone generateText function
- Add ExecutionContext interface to encapsulate execution state
- Remove duplicated node resolution and artifact handling code
- Maintain existing functionality while reducing code complexity
Consolidate duplicate flow execution code into reusable performFlowExecution
function. Simplifies both new executions and retries through a common path.

Key changes:
- Create ExecuteFlowParams interface to standardize execution parameters
- Extract core flow execution logic into performFlowExecution
- Unify execution state management between new and retry flows
- Reduce code duplication while maintaining execution behaviors
- Simplify job execution status handling
Split execution snapshot building logic into focused utility functions and
cleanup initialization code for both new and retry executions.

Key changes:
- Split buildExecutionsFromSnapshot into separate utility functions
- Remove createInitialExecution in favor of direct object creation
- Standardize execution state initialization between new and retry flows
- Improve type safety with explicit Execution type annotations

The refactoring improves clarity by:
- Making execution state construction more explicit
- Reducing complexity of snapshot handling
- Keeping utility functions focused on single responsibilities
@toyamarinyon toyamarinyon requested a review from shige as a code owner December 18, 2024 12:49
Copy link

vercel bot commented Dec 18, 2024

@toyamarinyon is attempting to deploy a commit to the Edge Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Dec 18, 2024

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

Name Status Preview Comments Updated (UTC)
giselle ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 18, 2024 0:53am

Copy link
Member

@shige shige left a comment

Choose a reason for hiding this comment

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

LGTM! ♻️

@toyamarinyon toyamarinyon merged commit c6822f9 into giselles-ai:main Dec 18, 2024
5 checks passed
@toyamarinyon toyamarinyon deleted the refactor-execution branch December 18, 2024 12:59
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