Skip to content

🙌 OpenHands: AI-Driven Development

Fix lint failures and enforce linting in CI (#209)

Graham Neubig00f1d99b1c27
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000000..6313b56c57
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+* text=auto eol=lf
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 3ade464954..f083fdf9d8 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -45,6 +45,9 @@ jobs:
- name: Install dependencies
run: npm ci
+ - name: Lint
+ run: npm run lint
+
- name: Test
run: npm test
diff --git a/.openhands/hooks.json b/.openhands/hooks.json
new file mode 100644
index 0000000000..b273d634ff
--- /dev/null
+++ b/.openhands/hooks.json
@@ -0,0 +1,14 @@
+{
+ "stop": [
+ {
+ "matcher": "*",
+ "hooks": [
+ {
+ "type": "command",
+ "command": ".openhands/hooks/on_stop.sh",
+ "timeout": 600
+ }
+ ]
+ }
+ ]
+}
diff --git a/.openhands/hooks/on_stop.sh b/.openhands/hooks/on_stop.sh
new file mode 100755
index 0000000000..2d2e0fffb1
--- /dev/null
+++ b/.openhands/hooks/on_stop.sh
@@ -0,0 +1,34 @@
+#!/usr/bin/env bash
+# Stop hook: runs the repo quality gate before allowing OpenHands to finish.
+#
+# Hooks can block agent completion by exiting with code 2 and returning JSON.
+# Keep this aligned with the checks that should run before an agent declares
+# repository work complete.
+
+set -o pipefail
+
+PROJECT_DIR="${OPENHANDS_PROJECT_DIR:-$(pwd)}"
+cd "$PROJECT_DIR" || exit 1
+
+run_check() {
+ local name="$1"
+ shift
+
+ echo "=== Running ${name} ===" >&2
+ local output
+ output=$("$@" 2>&1)
+ local exit_code=$?
+ echo "$output" >&2
+
+ if [ "$exit_code" -ne 0 ]; then
+ local escaped_output
+ escaped_output=$(printf '%s' "$output" | jq -Rs .)
+ printf '{"decision":"deny","reason":"%s failed","additionalContext":%s}\n' "$name" "$escaped_output"
+ exit 2
+ fi
+}
+
+run_check "npm run lint" npm run lint
+run_check "npm test" npm test
+
+echo '{"decision":"allow"}'
diff --git a/.openhands/pre-commit.sh b/.openhands/pre-commit.sh
deleted file mode 100755
index e70d33cfaf..0000000000
--- a/.openhands/pre-commit.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/env bash
-
-SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
-
-cd "$REPO_ROOT" || exit 1
-
-npm run lint
-npm run test
diff --git a/AGENTS.md b/AGENTS.md
index ccdfa079f1..0f1fa7598d 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -111,7 +111,7 @@
- The repo should include a root `LICENSE` file to satisfy the incubator-program requirements.
- OpenHands repo bootstrap files live under `.openhands/`:
- `.openhands/setup.sh` installs `uv` (via `curl -LsSf https://astral.sh/uv/install.sh | sh`) if not present, installs frontend dependencies with `npm ci` when needed, creates `.env` from `.env.sample` if missing, appends `VITE_WORKING_DIR` for this repo when unset, and generates `src/i18n/declaration.ts` via `npm run make-i18n`.
- - `.openhands/pre-commit.sh` mirrors the repo's local quality gate with `npm run lint && npm run test`.
+ - `.openhands/hooks.json` registers `.openhands/hooks/on_stop.sh` as a Stop hook so OpenHands runs the local quality gate (`npm run lint` and `npm test`) before finishing.
- GitHub PR-review automation should stay aligned with the current OpenHands repo conventions: keep the review workflow at `.github/workflows/pr-review-by-openhands.yml`, keep the companion `.github/workflows/pr-review-evaluation.yml`, auto-run on newly opened non-draft PRs and `ready_for_review` events from established contributors, still support the `review-this` label / `openhands-agent` / `all-hands-bot` reviewer triggers, use the OpenHands app LLM proxy defaults, and use the dual-trigger pattern (`pull_request` for same-repo PRs, `pull_request_target` for forks) so workflow changes can self-verify without widening fork secret exposure.
- The repo now includes `.agents/skills/custom-codereview-guide.md`, adapted from `OpenHands/software-agent-sdk`, to force PR reviews to always leave either an APPROVE or COMMENT review instead of silently finishing with no review object.
diff --git a/__tests__/routes/changes-tab.test.tsx b/__tests__/routes/changes-tab.test.tsx
index 013507a473..fd706262a7 100644
--- a/__tests__/routes/changes-tab.test.tsx
+++ b/__tests__/routes/changes-tab.test.tsx
@@ -2,6 +2,7 @@ import { render, screen } from "@testing-library/react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { describe, expect, it, vi } from "vitest";
import { MemoryRouter } from "react-router";
+import { AxiosError } from "axios";
import GitChanges from "#/routes/changes-tab";
import { useUnifiedGetGitChanges } from "#/hooks/query/use-unified-get-git-changes";
import { useAgentState } from "#/hooks/use-agent-state";
@@ -94,7 +95,7 @@ describe("Changes Tab", () => {
isFetching: false,
isSuccess: false,
isError: true,
- error: { message: "fatal: not a git repository" } as unknown as Error,
+ error: new AxiosError("fatal: not a git repository"),
refetch: vi.fn(),
});
vi.mocked(useAgentState).mockReturnValue({
diff --git a/src/api/agent-server-compatibility.ts b/src/api/agent-server-compatibility.ts
index 359082f13f..24762d2aea 100644
--- a/src/api/agent-server-compatibility.ts
+++ b/src/api/agent-server-compatibility.ts
@@ -17,7 +17,8 @@ export interface AgentServerInfo extends BaseServerInfo {
let cachedAgentServerInfo: AgentServerInfo | null = null;
-const getServerVersion = (serverInfo: AgentServerInfo): string => serverInfo.version;
+const getServerVersion = (serverInfo: AgentServerInfo): string =>
+ serverInfo.version;
const getAdvertisedTools = (serverInfo: AgentServerInfo | null) => {
if (Array.isArray(serverInfo?.usable_tools)) {
diff --git a/src/api/cloud/secrets-service.api.ts b/src/api/cloud/secrets-service.api.ts
index 1d39bd62a2..637a1d779f 100644
--- a/src/api/cloud/secrets-service.api.ts
+++ b/src/api/cloud/secrets-service.api.ts
@@ -26,24 +26,26 @@ function getActiveCloudBackend(): Backend {
*/
export async function fetchCloudSecrets(): Promise<CustomSecretWithoutValue[]> {
const backend = getActiveCloudBackend();
- const all: CustomSecretWithoutValue[] = [];
+
+ const secrets: CustomSecretWithoutValue[] = [];
let pageId: string | null = null;
do {
const query = new URLSearchParams({ limit: String(PAGE_LIMIT) });
if (pageId) query.set("page_id", pageId);
- const page: CloudSecretsPage = await callCloudProxy<CloudSecretsPage>({
+ // eslint-disable-next-line no-await-in-loop
+ const page = await callCloudProxy<CloudSecretsPage>({
backend,
method: "GET",
path: `/api/v1/secrets/search?${query.toString()}`,
});
- all.push(...(page.items ?? []));
- pageId = page.next_page_id ?? null;
+ secrets.push(...(page.items ?? []));
+ pageId = page.next_page_id;
} while (pageId);
- return all;
+ return secrets;
}
export async function createCloudSecret(
diff --git a/src/api/cloud/skills-service.api.ts b/src/api/cloud/skills-service.api.ts
index c232250172..51d0f5eeef 100644
--- a/src/api/cloud/skills-service.api.ts
+++ b/src/api/cloud/skills-service.api.ts
@@ -27,22 +27,24 @@ function getActiveCloudBackend(): Backend {
*/
export async function fetchCloudSkills(): Promise<SkillInfo[]> {
const backend = getActiveCloudBackend();
- const all: SkillInfo[] = [];
+
+ const skills: SkillInfo[] = [];
let pageId: string | null = null;
do {
const query = new URLSearchParams({ limit: String(PAGE_LIMIT) });
if (pageId) query.set("page_id", pageId);
- const page: CloudSkillsPage = await callCloudProxy<CloudSkillsPage>({
+ // eslint-disable-next-line no-await-in-loop
+ const page = await callCloudProxy<CloudSkillsPage>({
backend,
method: "GET",
path: `/api/v1/skills/search?${query.toString()}`,
});
- all.push(...(page.items ?? []));
- pageId = page.next_page_id ?? null;
+ skills.push(...(page.items ?? []));
+ pageId = page.next_page_id;
} while (pageId);
- return all;
+ return skills;
}
diff --git a/src/api/config-service/config-service.api.ts b/src/api/config-service/config-service.api.ts
index b5353f248f..fed54c4a9e 100644
--- a/src/api/config-service/config-service.api.ts
+++ b/src/api/config-service/config-service.api.ts
@@ -107,10 +107,7 @@ class ConfigService {
]);
const verifiedProviders = new Set(Object.keys(verifiedMap ?? {}));
- const names = new Set<string>([
- ...verifiedProviders,
- ...(providers ?? []),
- ]);
+ const names = new Set<string>([...verifiedProviders, ...(providers ?? [])]);
const providerItems: LLMProvider[] = [...names].map((name) => ({
name,
verified: verifiedProviders.has(name),
diff --git a/src/api/conversation-service/agent-server-conversation-service.api.ts b/src/api/conversation-service/agent-server-conversation-service.api.ts
index d53f41c7e1..fd3c28b43c 100644
--- a/src/api/conversation-service/agent-server-conversation-service.api.ts
+++ b/src/api/conversation-service/agent-server-conversation-service.api.ts
@@ -1,6 +1,6 @@
+import { v4 as uuidv4 } from "uuid";
import { Provider } from "#/types/settings";
import { buildHttpBaseUrl } from "#/utils/websocket-url";
-import { v4 as uuidv4 } from "uuid";
import {
buildConversationWorkingDir,
getAgentServerWorkingDir,
@@ -106,7 +106,6 @@ class AgentServerConversationService {
return createCloudAppConversation(request);
}
-
const settings = await SettingsService.getSettings();
const conversationId = uuidv4();
const workingDir =
@@ -166,8 +165,11 @@ class AgentServerConversationService {
}
static async searchStartTasks(
- _limit: number = 100,
+ limit: number = 100,
): Promise<AppConversationStartTask[]> {
+ if (limit < 0) {
+ return [];
+ }
return [];
}
@@ -198,7 +200,7 @@ class AgentServerConversationService {
await this.resolveConversationWorkingDir(conversationId);
// Local mode: the typescript-client targets the local agent-server
// directly via the conversationUrl override.
- const vscode_url = await createVSCodeClient({
+ const vscodeUrl = await createVSCodeClient({
conversationUrl,
sessionApiKey,
}).getUrl({
@@ -207,7 +209,7 @@ class AgentServerConversationService {
workspaceDir,
});
- return { vscode_url };
+ return { vscode_url: vscodeUrl };
}
static async resolveConversationWorkingDir(
@@ -269,9 +271,7 @@ class AgentServerConversationService {
(DirectConversationInfo | null)[]
>("/api/conversations", { params: { ids } });
- return response.data.map((item) =>
- item ? toAppConversation(item) : null,
- );
+ return response.data.map((item) => (item ? toAppConversation(item) : null));
}
static async uploadFile(
@@ -363,7 +363,10 @@ class AgentServerConversationService {
return loadSkillsForConversation(conversation);
}
- static async getHooks(_conversationId: string): Promise<GetHooksResponse> {
+ static async getHooks(conversationId: string): Promise<GetHooksResponse> {
+ if (!conversationId) {
+ return emptyHooksResponse();
+ }
return emptyHooksResponse();
}
@@ -430,8 +433,7 @@ class AgentServerConversationService {
created_at: data.created_at,
updated_at: data.updated_at,
status:
- (data.execution_status as RuntimeConversationInfo["status"]) ??
- "idle",
+ (data.execution_status as RuntimeConversationInfo["status"]) ?? "idle",
stats: data.stats ?? { usage_to_metrics: {} },
};
}
diff --git a/src/api/conversation-service/conversation-service.api.ts b/src/api/conversation-service/conversation-service.api.ts
index 0fccaa7be8..9b161da5e0 100644
--- a/src/api/conversation-service/conversation-service.api.ts
+++ b/src/api/conversation-service/conversation-service.api.ts
@@ -11,6 +11,8 @@ import {
} from "../typescript-client";
import { AppConversation } from "./agent-server-conversation-service.types";
+const FILE_UPLOAD_CONCURRENCY = 5;
+
class ConversationService {
private static currentConversation: AppConversation | null = null;
@@ -47,7 +49,7 @@ class ConversationService {
? (this.currentConversation?.workspace?.working_dir ??
getAgentServerWorkingDir())
: getAgentServerWorkingDir();
- const vscode_url = await createVSCodeClient(
+ const vscodeUrl = await createVSCodeClient(
this.getClientOverrides(),
).getUrl({
baseUrl:
@@ -55,7 +57,7 @@ class ConversationService {
workspaceDir,
});
- return { vscode_url };
+ return { vscode_url: vscodeUrl };
}
static async getTrajectory(
@@ -73,23 +75,41 @@ class ConversationService {
_conversationId: string,
files: File[],
): Promise<FileUploadSuccessResponse> {
- const uploaded_files: string[] = [];
- const skipped_files: { name: string; reason: string }[] = [];
const workspace = createRemoteWorkspace(this.getClientOverrides());
-
- for (const file of files) {
+ const uploadFile = async (file: File) => {
try {
await workspace.fileUpload(file, `/workspace/${file.name}`);
- uploaded_files.push(file.name);
+ return { uploadedFile: file.name, skippedFile: null };
} catch (error) {
- skipped_files.push({
- name: file.name,
- reason: error instanceof Error ? error.message : "Upload failed",
- });
+ return {
+ uploadedFile: null,
+ skippedFile: {
+ name: file.name,
+ reason: error instanceof Error ? error.message : "Upload failed",
+ },
+ };
}
+ };
+
+ const results: Awaited<ReturnType<typeof uploadFile>>[] = [];
+ for (
+ let index = 0;
+ index < files.length;
+ index += FILE_UPLOAD_CONCURRENCY
+ ) {
+ const batch = files.slice(index, index + FILE_UPLOAD_CONCURRENCY);
+ // eslint-disable-next-line no-await-in-loop
+ results.push(...(await Promise.all(batch.map(uploadFile))));
}
- return { uploaded_files, skipped_files };
+ return {
+ uploaded_files: results.flatMap((result) =>
+ result.uploadedFile ? [result.uploadedFile] : [],
+ ),
+ skipped_files: results.flatMap((result) =>
+ result.skippedFile ? [result.skippedFile] : [],
+ ),
+ };
}
}
diff --git a/src/api/git-service/git-service.api.ts b/src/api/git-service/git-service.api.ts
index 96ae62171c..50ad2cab61 100644
--- a/src/api/git-service/git-service.api.ts
+++ b/src/api/git-service/git-service.api.ts
@@ -154,7 +154,9 @@ class GitService {
static async getGitChanges(conversationId: string): Promise<GitChange[]> {
const workingDir =
- await AgentServerConversationService.resolveConversationWorkingDir(conversationId);
+ await AgentServerConversationService.resolveConversationWorkingDir(
+ conversationId,
+ );
const changes = await createRemoteWorkspace({ workingDir }).gitChanges(
workingDir,
{ ref: "HEAD" },
diff --git a/src/api/open-hands.types.ts b/src/api/open-hands.types.ts
index 4d404c2c4e..8928daa5a8 100644
--- a/src/api/open-hands.types.ts
+++ b/src/api/open-hands.types.ts
@@ -92,7 +92,11 @@ export interface ResultSet<T> {
*/
export type GitChangeStatus = "M" | "A" | "D" | "R" | "U";
-export type AgentServerGitChangeStatus = "MOVED" | "ADDED" | "DELETED" | "UPDATED";
+export type AgentServerGitChangeStatus =
+ | "MOVED"
+ | "ADDED"
+ | "DELETED"
+ | "UPDATED";
export interface GitChange {
status: GitChangeStatus;
diff --git a/src/api/secrets-service.ts b/src/api/secrets-service.ts
index a494d696b2..0a48b2799f 100644
--- a/src/api/secrets-service.ts
+++ b/src/api/secrets-service.ts
@@ -50,20 +50,24 @@ async function withRetry<T>(
maxRetries: number = 3,
baseDelayMs: number = 500,
): Promise<T> {
- let lastError: unknown;
- for (let attempt = 0; attempt < maxRetries; attempt++) {
+ for (let attempt = 0; attempt < maxRetries; attempt += 1) {
try {
+ // eslint-disable-next-line no-await-in-loop
return await fn();
} catch (error) {
- lastError = error;
- if (attempt < maxRetries - 1) {
- // Exponential backoff: 500ms, 1000ms, 2000ms
- const delay = baseDelayMs * Math.pow(2, attempt);
- await new Promise((resolve) => setTimeout(resolve, delay));
+ if (attempt >= maxRetries - 1) {
+ throw error;
}
+
+ const delay = baseDelayMs * 2 ** attempt;
+ // eslint-disable-next-line no-await-in-loop
+ await new Promise<void>((resolve) => {
+ setTimeout(resolve, delay);
+ });
}
}
- throw lastError;
+
+ throw new Error("Retry attempts exhausted");
}
/**
@@ -294,46 +298,25 @@ export class SecretsService {
const storedProviders = readStoredGitProviders();
const nextProviders: StoredGitProviderTokens = { ...storedProviders };
- for (const [provider, value] of Object.entries(providers) as [
- Provider,
- ProviderToken,
- ][]) {
+ const entries = Object.entries(providers) as [Provider, ProviderToken][];
+
+ for (const [provider, value] of entries) {
const token = value.token.trim();
const host = normalizeHost(value.host);
+ const nextToken = token || nextProviders[provider]?.token;
+
+ if (nextToken) {
+ const secretName = getGitProviderSecretName(provider);
+ // eslint-disable-next-line no-await-in-loop
+ await this.createSecret(
+ secretName,
+ nextToken,
+ `Git provider token for ${provider}${host ? ` (${host})` : ""}`,
+ );
- if (!token) {
- // Just updating host for existing token - still need to update server
- const existing = nextProviders[provider];
- if (existing) {
- // Re-store to server with updated host in description
- // This ensures server metadata stays in sync with localStorage
- const secretName = getGitProviderSecretName(provider);
- await this.createSecret(
- secretName,
- existing.token,
- `Git provider token for ${provider}${host ? ` (${host})` : ""}`,
- );
-
- // Only update localStorage after server storage succeeds
- nextProviders[provider] = {
- token: existing.token,
- host,
- };
- }
- continue;
+ // Only update localStorage after server storage succeeds
+ nextProviders[provider] = { token: nextToken, host };
}
-
- // Store the token as a secret on the server for agent runtime use
- // This MUST succeed - no fallback to localStorage-only
- const secretName = getGitProviderSecretName(provider);
- await this.createSecret(
- secretName,
- token,
- `Git provider token for ${provider}${host ? ` (${host})` : ""}`,
- );
-
- // Only update localStorage after server storage succeeds
- nextProviders[provider] = { token, host };
}
// Update localStorage for frontend git API calls
@@ -347,18 +330,20 @@ export class SecretsService {
const storedProviders = readStoredGitProviders();
// Delete each provider's secret from the server
- for (const provider of Object.keys(storedProviders) as Provider[]) {
- const secretName = getGitProviderSecretName(provider);
- try {
- await this.deleteSecret(secretName);
- } catch (error) {
- // Log but continue - we still want to clear other providers
- console.warn(
- `Failed to delete git provider secret for ${provider}:`,
- error,
- );
- }
- }
+ await Promise.all(
+ (Object.keys(storedProviders) as Provider[]).map(async (provider) => {
+ const secretName = getGitProviderSecretName(provider);
+ try {
+ await this.deleteSecret(secretName);
+ } catch (error) {
+ // Log but continue - we still want to clear other providers
+ console.warn(
+ `Failed to delete git provider secret for ${provider}:`,
+ error,
+ );
+ }
+ }),
+ );
// Clear localStorage
writeStoredGitProviders({});
diff --git a/src/api/settings-service/settings-service.api.ts b/src/api/settings-service/settings-service.api.ts
index 6b22888a93..312e3ec0e9 100644
--- a/src/api/settings-service/settings-service.api.ts
+++ b/src/api/settings-service/settings-service.api.ts
@@ -58,20 +58,24 @@ async function withRetry<T>(
maxRetries: number = 3,
baseDelayMs: number = 500,
): Promise<T> {
- let lastError: unknown;
- for (let attempt = 0; attempt < maxRetries; attempt++) {
+ for (let attempt = 0; attempt < maxRetries; attempt += 1) {
try {
+ // eslint-disable-next-line no-await-in-loop
return await fn();
} catch (error) {
- lastError = error;
- if (attempt < maxRetries - 1) {
- // Exponential backoff: 500ms, 1000ms, 2000ms
- const delay = baseDelayMs * 2 ** attempt;
- await new Promise((resolve) => setTimeout(resolve, delay));
+ if (attempt >= maxRetries - 1) {
+ throw error;
}
+
+ const delay = baseDelayMs * 2 ** attempt;
+ // eslint-disable-next-line no-await-in-loop
+ await new Promise<void>((resolve) => {
+ setTimeout(resolve, delay);
+ });
}
}
- throw lastError;
+
+ throw new Error("Retry attempts exhausted");
}
/**
@@ -359,8 +363,8 @@ class SettingsService {
// The local agent-server PATCH /api/settings rejects unknown fields and
// requires at least one of the two diff fields. Strip disabled_skills
// and skip the request entirely if nothing else was changed.
- const { disabled_skills: _droppedDisabledSkills, ...localPayload } =
- payload;
+ const localPayload = { ...payload };
+ delete localPayload.disabled_skills;
if (
!localPayload.agent_settings_diff &&
!localPayload.conversation_settings_diff
diff --git a/src/components/conversation-events/chat/event-content-helpers/get-event-content.tsx b/src/components/conversation-events/chat/event-content-helpers/get-event-content.tsx
index a001df2f51..8c591bd6e8 100644
--- a/src/components/conversation-events/chat/event-content-helpers/get-event-content.tsx
+++ b/src/components/conversation-events/chat/event-content-helpers/get-event-content.tsx
@@ -1,6 +1,10 @@
import { Trans } from "react-i18next";
import React from "react";
-import { OpenHandsEvent, ObservationEvent, ActionEvent } from "#/types/agent-server/core";
+import {
+ OpenHandsEvent,
+ ObservationEvent,
+ ActionEvent,
+} from "#/types/agent-server/core";
import {
isActionEvent,
isObservationEvent,
diff --git a/src/components/conversation-events/chat/event-message-components/event-group.tsx b/src/components/conversation-events/chat/event-message-components/event-group.tsx
index fc76b53873..c1ee3ad866 100644
--- a/src/components/conversation-events/chat/event-message-components/event-group.tsx
+++ b/src/components/conversation-events/chat/event-message-components/event-group.tsx
@@ -3,7 +3,10 @@ import { useTranslation } from "react-i18next";
import ArrowDown from "#/icons/angle-down-solid.svg?react";
import ArrowUp from "#/icons/angle-up-solid.svg?react";
import { OpenHandsEvent, ActionEvent } from "#/types/agent-server/core";
-import { isActionEvent, isObservationEvent } from "#/types/agent-server/type-guards";
+import {
+ isActionEvent,
+ isObservationEvent,
+} from "#/types/agent-server/type-guards";
import { I18nKey } from "#/i18n/declaration";
import { SuccessIndicator } from "../../../features/chat/success-indicator";
import { getEventContent } from "../event-content-helpers/get-event-content";
diff --git a/src/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.tsx b/src/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.tsx
index bbdbceefdf..2ac9128191 100644
--- a/src/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.tsx
+++ b/src/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.tsx
@@ -4,14 +4,17 @@ import { getEventContent } from "../event-content-helpers/get-event-content";
import {
getACPToolCallResult,
getObservationResult,
+ ObservationResultStatus,
} from "../event-content-helpers/get-observation-result";
-import { isACPToolCallEvent, isObservationEvent } from "#/types/agent-server/type-guards";
+import {
+ isACPToolCallEvent,
+ isObservationEvent,
+} from "#/types/agent-server/type-guards";
import {
SkillReadyEvent,
isSkillReadyEvent,
} from "../event-content-helpers/create-skill-ready-event";
import { ConversationConfirmationButtons } from "#/components/shared/buttons/conversation-confirmation-buttons";
-import { ObservationResultStatus } from "../event-content-helpers/get-observation-result";
import { SkillReadyContentList } from "./skill-ready-content-list";
interface GenericEventMessageWrapperProps {
diff --git a/src/components/conversation-events/chat/event-message.tsx b/src/components/conversation-events/chat/event-message.tsx
index 94130d351d..791ea0730e 100644
--- a/src/components/conversation-events/chat/event-message.tsx
+++ b/src/components/conversation-events/chat/event-message.tsx
@@ -1,6 +1,13 @@
import React from "react";
-import { OpenHandsEvent, MessageEvent, ActionEvent } from "#/types/agent-server/core";
-import { FinishAction, ThinkAction } from "#/types/agent-server/core/base/action";
+import {
+ OpenHandsEvent,
+ MessageEvent,
+ ActionEvent,
+} from "#/types/agent-server/core";
+import {
+ FinishAction,
+ ThinkAction,
+} from "#/types/agent-server/core/base/action";
import {
isActionEvent,
isObservationEvent,
diff --git a/src/components/conversation-events/chat/event-thought-helpers.ts b/src/components/conversation-events/chat/event-thought-helpers.ts
index 807f55792d..74b018c8a8 100644
--- a/src/components/conversation-events/chat/event-thought-helpers.ts
+++ b/src/components/conversation-events/chat/event-thought-helpers.ts
@@ -1,5 +1,8 @@
import { ActionEvent, OpenHandsEvent } from "#/types/agent-server/core";
-import { isActionEvent, isObservationEvent } from "#/types/agent-server/type-guards";
+import {
+ isActionEvent,
+ isObservationEvent,
+} from "#/types/agent-server/type-guards";
/**
* Returns the displayable thought text of an `ActionEvent`, or an empty
diff --git a/src/components/features/analytics/telemetry-consent-banner.tsx b/src/components/features/analytics/telemetry-consent-banner.tsx
index 81f9ae77a7..d3d9781bac 100644
--- a/src/components/features/analytics/telemetry-consent-banner.tsx
+++ b/src/components/features/analytics/telemetry-consent-banner.tsx
@@ -54,6 +54,7 @@ export function TelemetryConsentBanner({
return () => clearTimeout(timer);
}
setIsReady(false);
+ return undefined;
}, [ready, showConsentPrompt]);
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
diff --git a/src/components/features/chat/chat-interface.tsx b/src/components/features/chat/chat-interface.tsx
index a38c2d5809..2f70c161d8 100644
--- a/src/components/features/chat/chat-interface.tsx
+++ b/src/components/features/chat/chat-interface.tsx
@@ -23,7 +23,7 @@ import { displayErrorToast } from "#/utils/custom-toast-handlers";
import { useErrorMessageStore } from "#/stores/error-message-store";
import { useOptimisticUserMessageStore } from "#/stores/optimistic-user-message-store";
import { ErrorMessageBanner } from "./error-message-banner";
-import { Messages as Messages } from "#/components/conversation-events/chat";
+import { Messages } from "#/components/conversation-events/chat";
import { useUnifiedUploadFiles } from "#/hooks/mutation/use-unified-upload-files";
import { validateFiles } from "#/utils/file-validation";
import { useConversationStore } from "#/stores/conversation-store";
@@ -121,7 +121,8 @@ export function ChatInterface() {
// pattern (useState + useEffect watching loading→loaded) which always showed
// skeleton on remount because local state initialized to false.
const showConversationMessages =
- allConversationEvents.length > 0 || !conversationWebSocket?.isLoadingHistory;
+ allConversationEvents.length > 0 ||
+ !conversationWebSocket?.isLoadingHistory;
const isReturningToConversation = !!conversationId;
// Only show loading skeleton when genuinely loading AND no events in store yet.
@@ -281,7 +282,10 @@ export function ChatInterface() {
)}
{showConversationMessages && conversationUserEventsExist && (
- <Messages messages={renderableEvents} allEvents={allConversationEvents} />
+ <Messages
+ messages={renderableEvents}
+ allEvents={allConversationEvents}
+ />
)}
</div>
diff --git a/src/components/features/sidebar/sidebar.tsx b/src/components/features/sidebar/sidebar.tsx
index e051265947..279bcedf3d 100644
--- a/src/components/features/sidebar/sidebar.tsx
+++ b/src/components/features/sidebar/sidebar.tsx
@@ -87,9 +87,7 @@ export function Sidebar() {
}
disabled={settings?.email_verified === false}
/>
- <AutomationsButton
- disabled={settings?.email_verified === false}
- />
+ <AutomationsButton disabled={settings?.email_verified === false} />
</div>
<div className="flex flex-row md:flex-col md:items-center gap-[26px]">
diff --git a/src/components/settings/index.ts b/src/components/settings/index.ts
index 8af30f5de5..2e627e44d3 100644
--- a/src/components/settings/index.ts
+++ b/src/components/settings/index.ts
@@ -3,7 +3,4 @@ export { AppSettingsScreen as AppSettings } from "../../routes/app-settings";
export { LlmSettingsScreen as LLMSettings } from "../../routes/llm-settings";
export { MCPSettingsScreen as MCPSettings } from "../../routes/mcp-settings";
export { SecretsSettingsScreen as SecretsSettings } from "../../routes/secrets-settings";
-export {
- SettingsLayout,
- SettingsLayout as SettingsPanel,
-} from "../features/settings/settings-layout";
+export { SettingsLayout as SettingsPanel } from "../features/settings/settings-layout";
diff --git a/src/components/shared/navigation-link.tsx b/src/components/shared/navigation-link.tsx
index 4456ef2e9f..c6edd4dae1 100644
--- a/src/components/shared/navigation-link.tsx
+++ b/src/components/shared/navigation-link.tsx
@@ -1,3 +1,4 @@
+/* eslint-disable react/jsx-props-no-spreading */
import React from "react";
import {
useNavigation,
@@ -92,3 +93,5 @@ export const NavigationLink = React.forwardRef<
);
},
);
+
+NavigationLink.displayName = "NavigationLink";
diff --git a/src/hooks/mutation/conversation-mutation-utils.ts b/src/hooks/mutation/conversation-mutation-utils.ts
index e85b8a1a20..e2fd3afd8b 100644
--- a/src/hooks/mutation/conversation-mutation-utils.ts
+++ b/src/hooks/mutation/conversation-mutation-utils.ts
@@ -13,9 +13,10 @@ const fetchConversationData = async (
sessionApiKey: string | null;
sandboxId: string | null;
}> => {
- const conversations = await AgentServerConversationService.batchGetAppConversations([
- conversationId,
- ]);
+ const conversations =
+ await AgentServerConversationService.batchGetAppConversations([
+ conversationId,
+ ]);
const appConversation = conversations[0];
if (!appConversation) {
diff --git a/src/hooks/mutation/use-create-conversation.ts b/src/hooks/mutation/use-create-conversation.ts
index 445b53b2b7..27c80344d2 100644
--- a/src/hooks/mutation/use-create-conversation.ts
+++ b/src/hooks/mutation/use-create-conversation.ts
@@ -46,21 +46,22 @@ export const useCreateConversation = () => {
agentType,
} = variables;
- const conversation = await AgentServerConversationService.createConversation(
- query,
- conversationInstructions,
- plugins,
- repository
- ? {
- selected_repository: repository.name,
- selected_branch: repository.branch ?? null,
- git_provider: repository.gitProvider,
- }
- : null,
- workingDir,
- parentConversationId,
- agentType,
- );
+ const conversation =
+ await AgentServerConversationService.createConversation(
+ query,
+ conversationInstructions,
+ plugins,
+ repository
+ ? {
+ selected_repository: repository.name,
+ selected_branch: repository.branch ?? null,
+ git_provider: repository.gitProvider,
+ }
+ : null,
+ workingDir,
+ parentConversationId,
+ agentType,
+ );
// OpenHands SaaS pattern: when the start task isn't immediately
// READY (cloud sandbox is still provisioning),
diff --git a/src/hooks/mutation/use-delete-conversation.ts b/src/hooks/mutation/use-delete-conversation.ts
index 0f026ce91e..4cec046d55 100644
--- a/src/hooks/mutation/use-delete-conversation.ts
+++ b/src/hooks/mutation/use-delete-conversation.ts
@@ -7,7 +7,9 @@ export const useDeleteConversation = () => {
return useMutation({
mutationFn: (variables: { conversationId: string }) =>
- AgentServerConversationService.deleteConversation(variables.conversationId),
+ AgentServerConversationService.deleteConversation(
+ variables.conversationId,
+ ),
onMutate: async (variables) => {
await queryClient.cancelQueries({ queryKey: ["user", "conversations"] });
const previousConversations = queryClient.getQueryData([
diff --git a/src/hooks/mutation/use-read-conversation-file.ts b/src/hooks/mutation/use-read-conversation-file.ts
index 443359a520..4628d45c1f 100644
--- a/src/hooks/mutation/use-read-conversation-file.ts
+++ b/src/hooks/mutation/use-read-conversation-file.ts
@@ -13,5 +13,8 @@ export const useReadConversationFile = () =>
conversationId,
filePath,
}: UseReadConversationFileVariables): Promise<string> =>
- AgentServerConversationService.readConversationFile(conversationId, filePath),
+ AgentServerConversationService.readConversationFile(
+ conversationId,
+ filePath,
+ ),
});
diff --git a/src/hooks/query/use-conversation-skills.ts b/src/hooks/query/use-conversation-skills.ts
index 2210a91183..7c3655ad0d 100644
--- a/src/hooks/query/use-conversation-skills.ts
+++ b/src/hooks/query/use-conversation-skills.ts
@@ -15,7 +15,8 @@ export const useConversationSkills = () => {
}
// Check if V1 is enabled and use the appropriate API
- const data = await AgentServerConversationService.getSkills(conversationId);
+ const data =
+ await AgentServerConversationService.getSkills(conversationId);
return data.skills;
},
enabled: !!executionStatus,
diff --git a/src/hooks/query/use-paginated-conversations.ts b/src/hooks/query/use-paginated-conversations.ts
index 4e2fb3a5ec..0a8f81cd62 100644
--- a/src/hooks/query/use-paginated-conversations.ts
+++ b/src/hooks/query/use-paginated-conversations.ts
@@ -30,8 +30,7 @@ export const usePaginatedConversations = (limit: number = 20) => {
return result;
},
enabled: !!userIsAuthenticated,
- getNextPageParam: (lastPage: AppConversationPage) =>
- lastPage.next_page_id,
+ getNextPageParam: (lastPage: AppConversationPage) => lastPage.next_page_id,
initialPageParam: undefined as string | undefined,
});
};
diff --git a/src/hooks/query/use-provider-models.ts b/src/hooks/query/use-provider-models.ts
index fb3e7eff47..8ac72981a4 100644
--- a/src/hooks/query/use-provider-models.ts
+++ b/src/hooks/query/use-provider-models.ts
@@ -1,4 +1,4 @@
-import { useQuery, useQueryClient } from "@tanstack/react-query";
+import { useQuery } from "@tanstack/react-query";
import ConfigService from "#/api/config-service/config-service.api";
import type { LLMModel } from "#/api/config-service/config-service.types";
import {
@@ -41,12 +41,11 @@ async function fetchPage(
return page.items;
}
-export const useProviderModels = (provider: string | null) => {
- const queryClient = useQueryClient();
- return useQuery({
+export const useProviderModels = (provider: string | null) =>
+ useQuery({
queryKey: ["config", "models", provider],
- queryFn: async () => {
- const verifiedByProvider = await queryClient.fetchQuery({
+ queryFn: async ({ client }) => {
+ const verifiedByProvider = await client.fetchQuery({
queryKey: VERIFIED_MODELS_QUERY_KEY,
queryFn: fetchVerifiedModelsByProvider,
staleTime: VERIFIED_MODELS_STALE_TIME,
@@ -57,4 +56,3 @@ export const useProviderModels = (provider: string | null) => {
staleTime: VERIFIED_MODELS_STALE_TIME,
gcTime: VERIFIED_MODELS_GC_TIME,
});
-};
diff --git a/src/hooks/query/use-search-providers.ts b/src/hooks/query/use-search-providers.ts
index 616112e99f..2bf93970a3 100644
--- a/src/hooks/query/use-search-providers.ts
+++ b/src/hooks/query/use-search-providers.ts
@@ -1,4 +1,4 @@
-import { useQuery, useQueryClient } from "@tanstack/react-query";
+import { useQuery } from "@tanstack/react-query";
import ConfigService from "#/api/config-service/config-service.api";
import type { LLMProvider } from "#/api/config-service/config-service.types";
import {
@@ -8,12 +8,11 @@ import {
fetchVerifiedModelsByProvider,
} from "./use-verified-models";
-export const useSearchProviders = () => {
- const queryClient = useQueryClient();
- return useQuery({
+export const useSearchProviders = () =>
+ useQuery({
queryKey: ["config", "providers"],
- queryFn: async (): Promise<LLMProvider[]> => {
- const verifiedByProvider = await queryClient.fetchQuery({
+ queryFn: async ({ client }): Promise<LLMProvider[]> => {
+ const verifiedByProvider = await client.fetchQuery({
queryKey: VERIFIED_MODELS_QUERY_KEY,
queryFn: fetchVerifiedModelsByProvider,
staleTime: VERIFIED_MODELS_STALE_TIME,
@@ -28,4 +27,3 @@ export const useSearchProviders = () => {
staleTime: VERIFIED_MODELS_STALE_TIME,
gcTime: VERIFIED_MODELS_GC_TIME,
});
-};
diff --git a/src/hooks/query/use-settings.ts b/src/hooks/query/use-settings.ts
index 73f73979d0..08975b2947 100644
--- a/src/hooks/query/use-settings.ts
+++ b/src/hooks/query/use-settings.ts
@@ -116,8 +116,12 @@ const normalizeSettingsResponse = (settings: Partial<Settings>): Settings => {
};
export const getSettingsQueryFn = async (
- _scope: SettingsScope = "personal",
+ scope: SettingsScope = "personal",
): Promise<Settings> => {
+ if (scope !== "personal") {
+ throw new Error(`Unsupported settings scope: ${scope}`);
+ }
+
const settings = await SettingsService.getSettings();
return normalizeSettingsResponse(settings);
};
diff --git a/src/hooks/query/use-user-conversation.ts b/src/hooks/query/use-user-conversation.ts
index 9ab6526bbb..538118312f 100644
--- a/src/hooks/query/use-user-conversation.ts
+++ b/src/hooks/query/use-user-conversation.ts
@@ -26,9 +26,8 @@ export const useUserConversation = (
if (!cid) return null;
// Use the V1 batch API endpoint to get a single conversation
- const results = await AgentServerConversationService.batchGetAppConversations([
- cid,
- ]);
+ const results =
+ await AgentServerConversationService.batchGetAppConversations([cid]);
return results[0] ?? null;
},
enabled: !!cid && !cid.startsWith("task-"),
diff --git a/src/hooks/use-download-conversation.ts b/src/hooks/use-download-conversation.ts
index 2eac94e40c..25b91f54e4 100644
--- a/src/hooks/use-download-conversation.ts
+++ b/src/hooks/use-download-conversation.ts
@@ -15,7 +15,9 @@ export const useDownloadConversation = () => {
mutationFn: async (conversationId: string) => {
posthog.capture("download_trajectory_button_clicked");
const blob =
- await AgentServerConversationService.downloadConversation(conversationId);
+ await AgentServerConversationService.downloadConversation(
+ conversationId,
+ );
downloadBlob(blob, `conversation_${conversationId}.zip`);
},
onError: () => {
diff --git a/src/hooks/use-filtered-events.ts b/src/hooks/use-filtered-events.ts
index bb4bc54ebf..53349c97f5 100644
--- a/src/hooks/use-filtered-events.ts
+++ b/src/hooks/use-filtered-events.ts
@@ -39,8 +39,9 @@ export function useFilteredEvents() {
[allConversationEvents],
);
- const conversationUserEventsExist =
- hasAgentServerUserEvent(allConversationEvents);
+ const conversationUserEventsExist = hasAgentServerUserEvent(
+ allConversationEvents,
+ );
return {
storeEvents,
diff --git a/src/hooks/use-handle-ws-events.ts b/src/hooks/use-handle-ws-events.ts
index dd7822fa11..5b3b78ac74 100644
--- a/src/hooks/use-handle-ws-events.ts
+++ b/src/hooks/use-handle-ws-events.ts
@@ -4,7 +4,10 @@ import { AgentState } from "#/types/agent-state";
import { displayErrorToast } from "#/utils/custom-toast-handlers";
import { useEventStore } from "#/stores/use-event-store";
import { useSendMessage } from "#/hooks/use-send-message";
-import { isAgentErrorEvent, isAgentServerEvent } from "#/types/agent-server/type-guards";
+import {
+ isAgentErrorEvent,
+ isAgentServerEvent,
+} from "#/types/agent-server/type-guards";
interface ServerError {
error: boolean | string;
diff --git a/src/hooks/use-has-permission.ts b/src/hooks/use-has-permission.ts
index 3d4d7258f1..f631b04b0c 100644
--- a/src/hooks/use-has-permission.ts
+++ b/src/hooks/use-has-permission.ts
@@ -1,6 +1,7 @@
// Simple permission hook for OSS agent-canvas
// In the OSS context, all authenticated users have full access
-export function useHasPermission(_permission: string): boolean {
- // In OSS mode, always return true - no permission restrictions
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
+export function useHasPermission(permission: string): boolean {
+ // In OSS mode, every permission string is granted.
return true;
}
diff --git a/src/hooks/use-task-list.ts b/src/hooks/use-task-list.ts
index e9e1c795b7..d476500f4e 100644
--- a/src/hooks/use-task-list.ts
+++ b/src/hooks/use-task-list.ts
@@ -11,7 +11,9 @@ export interface TaskListItem {
notes?: string;
}
-function getTaskListFromEvent(event: ReturnType<typeof useEventStore.getState>["events"][number]): TaskListItem[] | null {
+function getTaskListFromEvent(
+ event: ReturnType<typeof useEventStore.getState>["events"][number],
+): TaskListItem[] | null {
if (
isObservationEvent(event) &&
event.observation.kind === "TaskTrackerObservation"
diff --git a/src/mocks/secrets-handlers.ts b/src/mocks/secrets-handlers.ts
index 126d4b47c8..a8abf36d30 100644
--- a/src/mocks/secrets-handlers.ts
+++ b/src/mocks/secrets-handlers.ts
@@ -50,7 +50,7 @@ export const SECRETS_HANDLERS = [
description?: string;
} | null;
- if (!body || !body.name || !body.value) {
+ if (!body?.name || !body?.value) {
return HttpResponse.json(
{ detail: "name and value are required" },
{ status: 400 },
@@ -62,7 +62,10 @@ export const SECRETS_HANDLERS = [
description: body.description,
});
- return HttpResponse.json({ name: body.name, description: body.description });
+ return HttpResponse.json({
+ name: body.name,
+ description: body.description,
+ });
}),
// DELETE /api/settings/secrets/:name - Delete a secret by name
diff --git a/src/mocks/settings-handlers.ts b/src/mocks/settings-handlers.ts
index 5d8123481d..942cd0a11b 100644
--- a/src/mocks/settings-handlers.ts
+++ b/src/mocks/settings-handlers.ts
@@ -496,7 +496,9 @@ export const SETTINGS_HANDLERS = [
const exposeSecrets = request.headers.get("X-Expose-Secrets");
// Build agent_settings, handling secrets based on header
- const agentSettings = structuredClone(settings.agent_settings ?? {}) as Record<string, unknown>;
+ const agentSettings = structuredClone(
+ settings.agent_settings ?? {},
+ ) as Record<string, unknown>;
const llm = agentSettings.llm as Record<string, unknown> | undefined;
if (llm?.api_key) {
if (exposeSecrets === "encrypted") {
@@ -510,8 +512,16 @@ export const SETTINGS_HANDLERS = [
}
}
- const llmApiKeySet = !!settings.llm_api_key_set || !!(settings.agent_settings as Record<string, unknown> | undefined)?.llm &&
- !!(((settings.agent_settings as Record<string, unknown>).llm as Record<string, unknown>)?.api_key);
+ const llmApiKeySet =
+ !!settings.llm_api_key_set ||
+ (!!(settings.agent_settings as Record<string, unknown> | undefined)
+ ?.llm &&
+ !!(
+ (settings.agent_settings as Record<string, unknown>).llm as Record<
+ string,
+ unknown
+ >
+ )?.api_key);
return HttpResponse.json({
agent_settings: agentSettings,
@@ -534,12 +544,17 @@ export const SETTINGS_HANDLERS = [
if (!body.agent_settings_diff && !body.conversation_settings_diff) {
return HttpResponse.json(
- { error: "At least one of agent_settings_diff or conversation_settings_diff must be provided" },
- { status: 400 }
+ {
+ error:
+ "At least one of agent_settings_diff or conversation_settings_diff must be provided",
+ },
+ { status: 400 },
);
}
- const current = MOCK_USER_PREFERENCES.settings || structuredClone(MOCK_DEFAULT_USER_SETTINGS);
+ const current =
+ MOCK_USER_PREFERENCES.settings ||
+ structuredClone(MOCK_DEFAULT_USER_SETTINGS);
const nextSettings: Settings = { ...current };
if (body.agent_settings_diff) {
@@ -551,7 +566,11 @@ export const SETTINGS_HANDLERS = [
// Sync llm_api_key_set
const llm = merged.llm as Record<string, unknown> | undefined;
- if (llm?.api_key && typeof llm.api_key === "string" && llm.api_key.trim().length > 0) {
+ if (
+ llm?.api_key &&
+ typeof llm.api_key === "string" &&
+ llm.api_key.trim().length > 0
+ ) {
nextSettings.llm_api_key_set = true;
}
}
diff --git a/src/query-client-config.ts b/src/query-client-config.ts
index 8709b41adb..70453c1a3d 100644
--- a/src/query-client-config.ts
+++ b/src/query-client-config.ts
@@ -14,9 +14,7 @@ const handle401Error = (error: AxiosError, client: QueryClient) => {
const shownErrors = new Set<string>();
export const createAgentServerQueryClient = () => {
- let client: QueryClient;
-
- client = new QueryClient({
+ const client = new QueryClient({
queryCache: new QueryCache({
onError: (error, query) => {
const isAuthQuery =
diff --git a/src/routes/shared-conversation.tsx b/src/routes/shared-conversation.tsx
index e9ab55ffe8..108ebd204f 100644
--- a/src/routes/shared-conversation.tsx
+++ b/src/routes/shared-conversation.tsx
@@ -4,7 +4,7 @@ import { useTranslation } from "react-i18next";
import { I18nKey } from "#/i18n/declaration";
import { useSharedConversation } from "#/hooks/query/use-shared-conversation";
import { useSharedConversationEvents } from "#/hooks/query/use-shared-conversation-events";
-import { Messages as Messages } from "#/components/conversation-events/chat";
+import { Messages } from "#/components/conversation-events/chat";
import { shouldRenderEvent } from "#/components/conversation-events/chat/event-content-helpers/should-render-event";
import { LoadingSpinner } from "#/components/shared/loading-spinner";
import { handleEventForUI } from "#/utils/handle-event-for-ui";
@@ -118,7 +118,10 @@ export default function SharedConversation() {
>
<div className="max-w-4xl mx-auto p-4 border border-neutral-700 rounded">
{renderableEvents.length > 0 ? (
- <Messages messages={renderableEvents} allEvents={conversationEvents} />
+ <Messages
+ messages={renderableEvents}
+ allEvents={conversationEvents}
+ />
) : (
<div className="flex items-center justify-center h-full">
<div className="text-center text-neutral-400 py-8">
diff --git a/src/services/telemetry.ts b/src/services/telemetry.ts
index 47f4d5b096..be208df698 100644
--- a/src/services/telemetry.ts
+++ b/src/services/telemetry.ts
@@ -294,8 +294,7 @@ export async function trackInstall(): Promise<void> {
// Capture the install event
posthog.capture("canvas_install", {
- platform:
- typeof navigator !== "undefined" ? navigator.platform : "unknown",
+ platform: typeof navigator !== "undefined" ? navigator.platform : "unknown",
user_agent:
typeof navigator !== "undefined" ? navigator.userAgent : "unknown",
referrer: typeof document !== "undefined" ? document.referrer : "",
diff --git a/src/stores/use-event-store.ts b/src/stores/use-event-store.ts
index 76fd6ab210..53ee8c10a8 100644
--- a/src/stores/use-event-store.ts
+++ b/src/stores/use-event-store.ts
@@ -108,6 +108,7 @@ if (
typeof import.meta !== "undefined" &&
(import.meta as { env?: { DEV?: boolean } }).env?.DEV
) {
- (window as unknown as { __OH_EVENT_STORE__?: typeof useEventStore }).__OH_EVENT_STORE__ =
- useEventStore;
+ (
+ window as unknown as { __OH_EVENT_STORE__?: typeof useEventStore }
+ ).__OH_EVENT_STORE__ = useEventStore;
}
diff --git a/src/types/agent-server/type-guards.ts b/src/types/agent-server/type-guards.ts
index 1e2752c00c..5a9cbdcfc8 100644
--- a/src/types/agent-server/type-guards.ts
+++ b/src/types/agent-server/type-guards.ts
@@ -25,7 +25,6 @@ import { HookExecutionEvent } from "./core/events/hook-execution-event";
import { ACPToolCallEvent } from "./core/events/acp-tool-call-event";
import { SystemPromptEvent } from "./core/events/system-event";
-
/**
* Type guard to check if an unknown value is a valid BaseEvent
* @param value - The value to check
@@ -234,8 +233,6 @@ export const isACPToolCallEvent = (
* Type guard to check if an event is an agent-server OpenHandsEvent.
* Uses isBaseEvent to validate the complete event structure.
*/
-export function isAgentServerEvent(
- event: unknown,
-): event is OpenHandsEvent {
+export function isAgentServerEvent(event: unknown): event is OpenHandsEvent {
return isBaseEvent(event);
}
diff --git a/src/utils/git-status-mapper.ts b/src/utils/git-status-mapper.ts
index 050214de01..44e5228671 100644
--- a/src/utils/git-status-mapper.ts
+++ b/src/utils/git-status-mapper.ts
@@ -28,6 +28,8 @@ export function mapAnyGitStatusToClientStatus(
}
}
-export function mapAgentServerToClientGitStatus(agentServerStatus: AgentServerGitChangeStatus): GitChangeStatus {
+export function mapAgentServerToClientGitStatus(
+ agentServerStatus: AgentServerGitChangeStatus,
+): GitChangeStatus {
return mapAnyGitStatusToClientStatus(agentServerStatus);
}
diff --git a/src/utils/parse-git-remote-url.ts b/src/utils/parse-git-remote-url.ts
index 12f0e5c3c5..69015049fd 100644
--- a/src/utils/parse-git-remote-url.ts
+++ b/src/utils/parse-git-remote-url.ts
@@ -80,7 +80,11 @@ export function parseGitRemoteUrl(
// ssh://, https://, http://, git://
try {
const parsed = new URL(url);
- return buildParsedGitRemoteUrl(url, parsed.hostname || null, parsed.pathname);
+ return buildParsedGitRemoteUrl(
+ url,
+ parsed.hostname || null,
+ parsed.pathname,
+ );
} catch {
return null;
}
diff --git a/src/utils/status.ts b/src/utils/status.ts
index 69f9334d0f..1f45b0f172 100644
--- a/src/utils/status.ts
+++ b/src/utils/status.ts
@@ -28,9 +28,7 @@ export function isExecutionPaused(
export function isExecutionErrored(
status: ExecutionStatus | null | undefined,
): boolean {
- return (
- status === ExecutionStatus.ERROR || status === ExecutionStatus.STUCK
- );
+ return status === ExecutionStatus.ERROR || status === ExecutionStatus.STUCK;
}
export enum IndicatorColor {