Merge pull request #26 from vgcman16/codex/design-abortallactions-to-cancel-ongoing-actions

Implement action abort handling
This commit is contained in:
vgcman16 2025-06-05 21:04:36 -05:00 committed by GitHub
commit bf5bd791ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -467,7 +467,31 @@ export class WorkbenchStore {
}
abortAllActions() {
// TODO: what do we wanna do and how do we wanna recover from this?
// Reset any queued actions so nothing new runs
this.#globalExecutionQueue = Promise.resolve();
// Abort currently running command in the shell if there is one
const execution = this.boltTerminal.executionState.get();
if (execution?.active) {
execution.abort?.();
// Send CTRL+C to ensure the process is interrupted
this.boltTerminal.terminal?.input('\x03');
}
// Abort all actions for every artifact
const artifacts = this.artifacts.get();
for (const artifact of Object.values(artifacts)) {
const actions = artifact.runner.actions.get();
for (const action of Object.values(actions)) {
if (action.status === 'running' || action.status === 'pending') {
action.abort();
}
}
}
}
setReloadedMessages(messages: string[]) {