Skip to content

Fix agent stuck in waiting state after completion#343

Open
satti-hari-krishna-reddy wants to merge 3 commits intoShuffle:mainfrom
satti-hari-krishna-reddy:timeout-fix
Open

Fix agent stuck in waiting state after completion#343
satti-hari-krishna-reddy wants to merge 3 commits intoShuffle:mainfrom
satti-hari-krishna-reddy:timeout-fix

Conversation

@satti-hari-krishna-reddy
Copy link
Collaborator

No description provided.

formattedAppName := strings.ReplaceAll(strings.ToLower(app.Name), " ", "_")

isInternalShuffleApp := false
switch formattedAppName {
Copy link
Member

Choose a reason for hiding this comment

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

Something about just matching name seems off, but I'm not sure exactly why.

I wonder if there is a way to "steal" the URL field/apikey by formatting an app in a certain way.

Just need to think it over before merging 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I think having a special verified field for apps built by support users would be better. Given that we're already overriding the URL field when injecting the auth, if we compare additionally to this special field and both are true, we can trust it. What do you think?


returnAction, err := HandleAiAgentExecutionStart(workflowExecution, actionResult.Action, true)
var originalAction Action
if foundActionResultIndex >= 0 && foundActionResultIndex < len(workflowExecution.Results) {
Copy link
Member

Choose a reason for hiding this comment

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

What was the point of this? I'm always confused when we override actions, when things used to work without it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

At line 8295 in ai, we are building actionResult, and inside of that we are setting the action's label name as fmt.Sprintf("Agent Decision %s", decision.RunDetails.Id). Then we call handleAgentDecisionStreamResult, and that one passes actionResult to HandleAiAgentExecutionStart. Now startNode is overwritten with an action with label, e.g., "Agent Decision RNnBU2aY". Due to this, the later nodes in workflow that are trying to refer to the AI agent node with its original label can't find it, resulting in being unable to get any data from the agent node at all.

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