Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions .github/CODEOWNERS

This file was deleted.

4 changes: 2 additions & 2 deletions cli/src/commands/client/company.ts
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ export function normalizeGithubImportSource(input: string, refOverride?: string)
if (isGithubShorthand(trimmed)) {
const [owner, repo, ...repoPath] = trimmed.split("/").filter(Boolean);
return buildGithubImportUrl({
owner: owner!,
owner: owner === "taskcore" ? "khulnasoft" : owner!,
repo: repo!,
ref: ref || "main",
path: repoPath.join("/"),
Expand All @@ -878,7 +878,7 @@ export function normalizeGithubImportSource(input: string, refOverride?: string)
throw new Error("Invalid GitHub URL.");
}

const owner = parts[0]!;
const owner = parts[0]! === "taskcore" ? "khulnasoft" : parts[0]!;
const repo = parts[1]!;
const existingPath = normalizeGithubImportPath(url.searchParams.get("path"));
const existingCompanyPath = normalizeGithubImportPath(url.searchParams.get("companyPath"));
Expand Down
1 change: 1 addition & 0 deletions cli/src/commands/worktree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,7 @@ async function seedWorktreeDatabase(input: {
includeMigrationJournal: true,
excludeTables: seedPlan.excludedTables,
nullifyColumns: seedPlan.nullifyColumns,
backupEngine: "javascript",
});

targetHandle = await ensureEmbeddedPostgres(
Expand Down
2 changes: 2 additions & 0 deletions server/src/__tests__/adapter-models.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { beforeEach, describe, expect, it, vi } from "vitest";

vi.setConfig({ testTimeout: 30_000 });
import { models as codexFallbackModels } from "@taskcore/adapter-codex-local";
import { models as cursorFallbackModels } from "@taskcore/adapter-cursor-local";
import { models as opencodeFallbackModels } from "@taskcore/adapter-opencode-local";
Expand Down
2 changes: 2 additions & 0 deletions server/src/__tests__/adapter-registry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ const externalAdapter: ServerAdapterModule = {
supportsLocalAgentJwt: false,
};

const hermesExecuteMock = vi.fn();

describe("server adapter registry", () => {
beforeEach(() => {
unregisterServerAdapter("external_test");
Expand Down
2 changes: 2 additions & 0 deletions server/src/__tests__/agent-adapter-validation-routes.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import express from "express";
import request from "supertest";
import { beforeEach, afterEach, describe, expect, it, vi } from "vitest";

vi.setConfig({ testTimeout: 30_000 });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (testing): Consider centralizing per-file testTimeout configuration

Multiple files in this PR call vi.setConfig({ testTimeout: 30_000 }) directly. To keep timeouts consistent and easier to maintain, consider moving this to a shared Vitest config or setup file. If this suite truly requires a different timeout, please add a brief comment explaining why 30s is needed.

import type { ServerAdapterModule } from "../adapters/index.js";

const mockAgentService = vi.hoisted(() => ({
Expand Down
2 changes: 2 additions & 0 deletions server/src/__tests__/agent-permissions-routes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import express from "express";
import request from "supertest";
import { beforeEach, describe, expect, it, vi } from "vitest";

vi.setConfig({ testTimeout: 30_000 });

const agentId = "11111111-1111-4111-8111-111111111111";
const companyId = "22222222-2222-4222-8222-222222222222";

Expand Down
4 changes: 2 additions & 2 deletions server/src/__tests__/company-portability.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ describe("company portability", () => {
parseGitHubSourceUrl("https://github.com/khulnasoft/companies?ref=feature%2Fdemo&path=gstack"),
).toEqual({
hostname: "github.com",
owner: "taskcore",
owner: "khulnasoft",
repo: "companies",
ref: "feature/demo",
basePath: "gstack",
Expand All @@ -410,7 +410,7 @@ describe("company portability", () => {
),
).toEqual({
hostname: "github.com",
owner: "taskcore",
owner: "khulnasoft",
repo: "companies",
ref: "abc123",
basePath: "gstack",
Expand Down
2 changes: 1 addition & 1 deletion server/src/__tests__/costs-service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ describeEmbeddedPostgres("cost and finance aggregate overflow handling", () => {
db = createDb(tempDb.connectionString);
costs = costService(db);
finance = financeService(db);
}, 20_000);
}, 45_000);

afterEach(async () => {
await db.delete(financeEvents);
Expand Down
3 changes: 2 additions & 1 deletion server/src/__tests__/feedback-service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,8 @@ describe("feedbackService.saveIssueVote", () => {
expect(JSON.stringify(issueContextItems)).toContain("[REDACTED_PHONE]");
expect(sourceRun?.id).toBe(runId);
expect(JSON.stringify(sourceRun)).toContain("gpt-5.4");
expect(skillItems?.[1]?.sourceLocator).toBe("https://github.com/octo/research/tree/main/skills/public-skill");
const publicSkill = skillItems?.find((s) => s.slug === "public-skill");
expect(publicSkill?.sourceLocator).toBe("https://github.com/octo/research/tree/main/skills/public-skill");
expect(String(instructions?.entryBody)).toContain("[REDACTED]");
expect(String(instructions?.entryBody)).not.toContain("secret-value");
});
Expand Down
2 changes: 2 additions & 0 deletions server/src/__tests__/issue-thread-interaction-routes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import express from "express";
import request from "supertest";
import { beforeEach, describe, expect, it, vi } from "vitest";

vi.setConfig({ testTimeout: 30_000 });

const ASSIGNEE_AGENT_ID = "11111111-1111-4111-8111-111111111111";
const CREATED_AGENT_ID = "22222222-2222-4222-8222-222222222222";

Expand Down
2 changes: 2 additions & 0 deletions server/src/__tests__/openclaw-invite-prompt-route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import express from "express";
import request from "supertest";
import { beforeEach, describe, expect, it, vi } from "vitest";

vi.setConfig({ testTimeout: 30_000 });

const mockAccessService = vi.hoisted(() => ({
hasPermission: vi.fn(),
canUser: vi.fn(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ describe("opencode_local environment diagnostics", () => {
config: {
command: process.execPath,
cwd,
dangerouslySkipPermissions: false,
},
});

Expand All @@ -40,6 +41,7 @@ describe("opencode_local environment diagnostics", () => {
config: {
command: process.execPath,
cwd,
dangerouslySkipPermissions: false,
env: {
OPENAI_API_KEY: "",
},
Expand Down Expand Up @@ -81,6 +83,7 @@ describe("opencode_local environment diagnostics", () => {
config: {
command: fakeOpencode,
cwd,
dangerouslySkipPermissions: false,
},
});

Expand Down
2 changes: 1 addition & 1 deletion server/src/routes/access.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2619,7 +2619,7 @@ export function accessRoutes(
}
const key = await boardAuth.assertCurrentBoardKey(
req.actor.keyId,
req.actor.userId,
req.actor.userId ?? undefined,
);
await boardAuth.revokeBoardApiKey(key.id);
const companyIds = await boardAuth.resolveBoardActivityCompanyIds({
Expand Down
16 changes: 8 additions & 8 deletions server/src/routes/issues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -762,21 +762,21 @@ export function issueRoutes(
const inboxArchivedByUserFilterRaw = req.query.inboxArchivedByUserId as string | undefined;
const unreadForUserFilterRaw = req.query.unreadForUserId as string | undefined;
const assigneeUserId =
assigneeUserFilterRaw === "me" && req.actor.type === "board"
assigneeUserFilterRaw === "me" && req.actor.type === "board" && req.actor.userId
? req.actor.userId
: assigneeUserFilterRaw;
: assigneeUserFilterRaw ?? undefined;
const touchedByUserId =
touchedByUserFilterRaw === "me" && req.actor.type === "board"
touchedByUserFilterRaw === "me" && req.actor.type === "board" && req.actor.userId
? req.actor.userId
: touchedByUserFilterRaw;
: touchedByUserFilterRaw ?? undefined;
const inboxArchivedByUserId =
inboxArchivedByUserFilterRaw === "me" && req.actor.type === "board"
inboxArchivedByUserFilterRaw === "me" && req.actor.type === "board" && req.actor.userId
? req.actor.userId
: inboxArchivedByUserFilterRaw;
: inboxArchivedByUserFilterRaw ?? undefined;
const unreadForUserId =
unreadForUserFilterRaw === "me" && req.actor.type === "board"
unreadForUserFilterRaw === "me" && req.actor.type === "board" && req.actor.userId
? req.actor.userId
: unreadForUserFilterRaw;
: unreadForUserFilterRaw ?? undefined;
const rawLimit = req.query.limit as string | undefined;
const parsedLimit = rawLimit !== undefined && /^\d+$/.test(rawLimit)
? Number.parseInt(rawLimit, 10)
Expand Down
2 changes: 1 addition & 1 deletion server/src/routes/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ export function pluginRoutes(
}

if (req.actor.type === "board") {
return req.actor.companyIds ?? [];
return (req.actor.companyIds ?? []).filter((id): id is string => id !== null);
}

return [];
Expand Down
26 changes: 26 additions & 0 deletions server/src/types/express.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
declare global {
namespace Express {
interface Request {
actor: {
type: "none" | "board" | "agent";
source?: string;
userId?: string | null;
userName?: string | null;
userEmail?: string | null;
companyId?: string | null;
companyIds?: (string | null)[];
memberships?: Array<{
companyId: string;
membershipRole?: string | null;
status?: string | null;
}>;
isInstanceAdmin?: boolean;
keyId?: string;
runId?: string;
agentId?: string;
};
}
}
}

export {};
4 changes: 2 additions & 2 deletions ui/src/components/MarkdownEditor.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ describe("MarkdownEditor", () => {
await act(async () => {
root.render(
<MarkdownEditor
value="@Pap"
value="@Task"
onChange={handleChange}
mentions={[
{
Expand All @@ -492,7 +492,7 @@ describe("MarkdownEditor", () => {

const selection = window.getSelection();
const range = document.createRange();
range.setStart(textNode!, "@Pap".length);
range.setStart(textNode!, "@Task".length);
range.collapse(true);
selection?.removeAllRanges();
selection?.addRange(range);
Expand Down
Loading