Skip to content

Move to event-driven controller#13

Draft
outcatcher wants to merge 3 commits into
mainfrom
event-driven
Draft

Move to event-driven controller#13
outcatcher wants to merge 3 commits into
mainfrom
event-driven

Conversation

@outcatcher
Copy link
Copy Markdown
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'
Comment thread src/kobold.ts Fixed
@outcatcher
Copy link
Copy Markdown
Owner Author

In testing

@outcatcher outcatcher marked this pull request as draft May 11, 2025 16:22
Comment thread src/kobold.ts
// 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.
Comment thread src/kobold.ts

// 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.
Comment thread src/kobold.ts
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.
Comment thread src/kobold.ts
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.
Comment thread src/kobold.ts
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