Skip to content

Commit

Permalink
fix: ts and eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
shixin-guo committed Oct 30, 2023
1 parent 73758e2 commit d6c8b44
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions clients/tabby-agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"object-hash": "^3.0.0",
"openapi-fetch": "^0.7.6",
"pino": "^8.14.1",
"pino-std-serializers": "^6.2.2",
"rotating-file-stream": "^3.1.0",
"stats-logscale": "^1.0.7",
"toml": "^3.0.0",
Expand Down
3 changes: 2 additions & 1 deletion clients/tabby-agent/src/logger.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pino from "pino";
import { err as pinoStdSerializersError } from "pino-std-serializers";
import { isBrowser, isTest, testLogDebug } from "./env";

/**
Expand All @@ -16,7 +17,7 @@ const stream =
interval: "1d",
});

const options = { serializers: { error: pino.stdSerializers.err } };
const options = { serializers: { error: pinoStdSerializersError } };
export const rootLogger = !!stream ? pino(options, stream) : pino(options);
if (isTest && testLogDebug) {
rootLogger.level = "debug";
Expand Down
7 changes: 4 additions & 3 deletions clients/vscode/src/TabbyStatusBarItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { createMachine, interpret } from "@xstate/fsm";
import { agent } from "./agent";
import { notifications } from "./notifications";
import { TabbyCompletionProvider } from "./TabbyCompletionProvider";
import { StatusChangedEvent, AuthRequiredEvent, IssuesUpdatedEvent } from "tabby-agent";

const label = "Tabby";
const iconLoading = "$(loading~spin)";
Expand Down Expand Up @@ -137,12 +138,12 @@ export class TabbyStatusBarItem {
this.completionProvider.on("loadingStatusUpdated", () => {
this.fsmService.send(agent().getStatus());
});
agent().on("statusChanged", (event) => {
agent().on("statusChanged", (event: StatusChangedEvent) => {
console.debug("Tabby agent statusChanged", { event });
this.fsmService.send(event.status);
});

agent().on("authRequired", (event) => {
agent().on("authRequired", (event: AuthRequiredEvent) => {
console.debug("Tabby agent authRequired", { event });
notifications.showInformationStartAuth({
onAuthStart: () => {
Expand All @@ -154,7 +155,7 @@ export class TabbyStatusBarItem {
});
});

agent().on("issuesUpdated", (event) => {
agent().on("issuesUpdated", (event: IssuesUpdatedEvent) => {
console.debug("Tabby agent issuesUpdated", { event });
this.fsmService.send(agent().getStatus());
if (event.issues.length > 0 && !this.completionResponseWarningShown) {
Expand Down
2 changes: 1 addition & 1 deletion clients/vscode/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const setApiEndpoint: Command = {
validateInput: (input: string) => {
try {
let url = new URL(input);
assert(url.protocol == "http:" || url.protocol == "https:");
assert(url.protocol === "http:" || url.protocol === "https:");
} catch (_) {
return {
message: "Please enter a validate http or https URL.",
Expand Down
2 changes: 1 addition & 1 deletion clients/vscode/src/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function getHelpMessageForCompletionResponseTimeIssue() {
}
let commonHelpMessage = "";
const host = new URL(agent().getConfig().server.endpoint).host;
if (helpMessageForRunningLargeModelOnCPU.length == 0) {
if (helpMessageForRunningLargeModelOnCPU.length === 0) {
commonHelpMessage += ` - The running model ${
serverHealthState?.model ?? ""
} may be performing poorly due to its large parameter size. `;
Expand Down

0 comments on commit d6c8b44

Please sign in to comment.