Skip to content

Conversation

@outcatcher
Copy link
Owner

@outcatcher outcatcher commented May 9, 2025

Make Controller operations event-based

Rename failed state to error

Make Controller an EventEmitter

Rename 'failed' state to 'error'
@outcatcher
Copy link
Owner Author

In testing

@outcatcher outcatcher marked this pull request as draft May 11, 2025 16:22
// Callbacks can be promises
// eslint-disable-next-line @typescript-eslint/no-misused-promises
this.on('load', this.handleLoad)
this.on('reload', this.handleReload)

Check failure

Code scanning / ESLint

Disallow Promises in places not designed to handle them Error

Promise returned in function argument where a void return was expected.

// StartKoboldCpp starts koboldcpp executable and wait before it responds.
runKoboldCpp(args: KoboldCppArgs) {
private handleLoad = async (args: KoboldCppArgs) => {

Check failure

Code scanning / ESLint

Disallow async functions which do not return promises and have no `await` expression Error

Async method 'handleLoad' has no 'await' expression.
this.aborter?.abort()

this.modelStatus.State = 'stopping'
this.waitForChildState('offline', modelStopTimeoutMs)

Check failure

Code scanning / ESLint

Require Promise-like statements to be handled appropriately Error

Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the void operator.
await sleep(waitItervalMs)

await waitForModel()
return await waitForModel()

Check failure

Code scanning / ESLint

Require `return` statements to either always or never specify values Error

Async arrow function expected no return value.
await sleep(waitItervalMs)

await waitForModel()
return await waitForModel()

Check failure

Code scanning / ESLint

Require expressions of type void to appear in statement position Error

Returning a void expression from a function is forbidden. Please remove the return statement.
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