-
Notifications
You must be signed in to change notification settings - Fork 46.2k
fix(execution): terminate agents stuck in empty execution state #12001
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
Open
jayvenn21
wants to merge
14
commits into
Significant-Gravitas:dev
Choose a base branch
from
jayvenn21:fix/execution-empty-updates-watchdog
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+131
−30
Open
Changes from 7 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e9f9dba
fix(execution): terminate agents stuck in empty execution state
jayvenn21 f41e295
Merge upstream/dev; fix review comments (reset executionStuck on run …
jayvenn21 813c4d0
fix(frontend): reset executionStuck on run change; use AgentExecution…
jayvenn21 eb72af5
fix(frontend): type POLLING_STATUSES as Set<AgentExecutionStatus>
jayvenn21 aa7ff03
chore: format SelectedRunView with prettier
jayvenn21 e3ccde6
fix(frontend): treat missing execution status as empty update
jayvenn21 4545818
fix(frontend): use ErrorCard hint for execution stuck message
jayvenn21 453942a
fix(frontend): safely guard malformed execution updates
jayvenn21 9386c89
fix(frontend): narrow execution status to enum before polling check
jayvenn21 5703cce
fix(frontend): restrict isPollingStatus to POLLING_STATUSES only
jayvenn21 3e5dcfe
fix(frontend): treat terminal execution states as valid, not empty
jayvenn21 c1f84f1
fix(frontend): return early on empty update so watchdog threshold can…
jayvenn21 436f19a
fix(frontend): return early on empty update in FloatingReviewsPanel
jayvenn21 2829e41
Merge branch 'dev' into fix/execution-empty-updates-watchdog
ntindle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
autogpt_platform/frontend/src/lib/executionPollingWatchdog.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import { AgentExecutionStatus } from "@/app/api/__generated__/models/agentExecutionStatus"; | ||
|
|
||
| export const EMPTY_EXECUTION_UPDATES_THRESHOLD = 40; | ||
|
|
||
| const POLLING_STATUSES = new Set<AgentExecutionStatus>([ | ||
| AgentExecutionStatus.RUNNING, | ||
| AgentExecutionStatus.QUEUED, | ||
| AgentExecutionStatus.INCOMPLETE, | ||
| AgentExecutionStatus.REVIEW, | ||
| ]); | ||
|
|
||
| export function isEmptyExecutionUpdate(rawData: unknown): boolean { | ||
| if (!rawData || typeof rawData !== "object" || !("status" in rawData)) | ||
| return true; | ||
| if ((rawData as { status: unknown }).status !== 200) return false; | ||
| const data = (rawData as { data?: unknown }).data; | ||
| if (!data || typeof data !== "object" || Array.isArray(data)) return true; | ||
| const status = (data as { status?: string }).status; | ||
| if (!status || !POLLING_STATUSES.has(status)) return true; | ||
| const nodeExecutions = (data as { node_executions?: unknown[] }) | ||
| .node_executions; | ||
| return !Array.isArray(nodeExecutions) || nodeExecutions.length === 0; | ||
| } | ||
|
|
||
| export function isPollingStatus(status: string | undefined): boolean { | ||
| return !!status && POLLING_STATUSES.has(status); | ||
| } | ||
jayvenn21 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.