Skip to content

Commit a70ca89

Browse files
asselstineexe.dev user
andauthored
fix: preserve configured exe.dev VM tags (#285)
Co-authored-by: exe.dev user <exedev@factorize-5ea6dc47-7399-4966-8420-be9269ebf34c.exe.xyz>
1 parent 0f839a5 commit a70ca89

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

‎packages/api/src/postgres/integration-service.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export class IntegrationService {
9393
const connectionsPromise = this.connections.all(["linear", "clickup", "exe:", "amp:", "cloudflare-tail:"]);
9494
const [connections, tails] = await Promise.all([connectionsPromise, this.tails(connectionsPromise)]);
9595
const linear = connections.get("linear"), clickup = connections.get("clickup");
96-
const exeConnections = [...connections].filter(([kind]) => kind.startsWith("exe:")).map(([kind, value]) => { const agentKind = value?.agentKind; return { connectionId: kind.slice(4), credentialStatus: "connected" as const, accountTags: tags(value?.availableTags ?? value?.tags), ...(agentKind ? { agentKind } : {}), models: (agentKind && (value?.modelsByAgent?.[agentKind] ?? value?.models)) ?? [], efforts: agentKind ? effortOptions[agentKind as keyof typeof effortOptions] ?? [] : [] }; });
96+
const exeConnections = [...connections].filter(([kind]) => kind.startsWith("exe:")).map(([kind, value]) => { const agentKind = value?.agentKind; return { connectionId: kind.slice(4), credentialStatus: "connected" as const, accountTags: [...new Set([...tags(value?.availableTags), ...tags(value?.tags)])].sort((a, b) => a.localeCompare(b)), ...(agentKind ? { agentKind } : {}), models: (agentKind && (value?.modelsByAgent?.[agentKind] ?? value?.models)) ?? [], efforts: agentKind ? effortOptions[agentKind as keyof typeof effortOptions] ?? [] : [] }; });
9797
const ampConnections = [...connections].filter(([kind]) => kind.startsWith("amp:")).map(([kind, value]) => ({ connectionId: kind.slice(4), project: text(value?.project) ?? "Unnamed Amp project", ...(text(value?.apiBaseUrl) ? { apiBaseUrl: text(value.apiBaseUrl) } : {}) }));
9898
return { linear: linear ? { organizationName: text(linear.organizationName) ?? null, viewerEmail: text(linear.viewerEmail) ?? null } : null, clickup: clickup ? { teamName: text(clickup.teamName) ?? null } : null, exe: exeConnections[0] ?? null, exeConnections, ampConnections, cloudflareTail: { count: tails.length, installations: tails } };
9999
}

‎packages/api/test/loading-parallel.test.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ describe("independent loading", () => {
3232
connections.resolve(new Map()); counts.resolve({ rows: [] });
3333
expect(await result).toMatchObject({ exeConnections: [], ampConnections: [], cloudflareTail: { count: 0, installations: [] } });
3434
});
35+
36+
it("keeps configured exe.dev tags visible when inventory refresh omits them", async () => {
37+
vi.spyOn(ConnectionRepository.prototype, "all").mockResolvedValue(new Map([
38+
["exe:vm", { availableTags: ["current"], tags: ["anarack", "current"], agentKind: "codex" }],
39+
]));
40+
vi.spyOn(IntegrationService.prototype, "tails").mockResolvedValue([]);
41+
const result = await new IntegrationService({ pool: { query: vi.fn(async () => ({ rows: [] })) } } as any, "tenant", "key").status();
42+
expect(result.exeConnections[0].accountTags).toEqual(["anarack", "current"]);
43+
});
3544
it("propagates a failed integration read without leaving an unhandled sibling promise", async () => {
3645
vi.spyOn(ConnectionRepository.prototype, "all").mockRejectedValue(new Error("Connection read failed"));
3746
const query = vi.fn(async () => ({ rows: [] }));

0 commit comments

Comments
 (0)