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
4 changes: 2 additions & 2 deletions packages/n8n-nodes-taskade/nodes/Taskade/Taskade.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ export class Taskade implements INodeType {
}
const agents = (await taskadeApiRequest.call(this, '/listAgents', body))
.items as IDataObject[];
// `taa` is the built-in Taskade agent. Only Prompt accepts it: Get and
// Add Project Knowledge look up a saved agent, so `taa` fails there.
// The API lists the built-in agent (Taskade EVE). Only Prompt accepts it:
// Get and Add Project Knowledge look up a saved agent, so it fails there.
const operation = this.getCurrentNodeParameter('operation') as string;
return {
results: (agents ?? [])
Expand Down
4 changes: 2 additions & 2 deletions packages/n8n-nodes-taskade/test/Taskade.node.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ describe('list search', () => {
]);
});

it('offers the built-in taa agent only for Prompt', async () => {
const agents = () => ({ ok: true, items: [{ id: 'taa', name: 'Taskade Agent (TAA)' }, { id: 'a1', name: 'Triage' }] });
it('offers the built-in agent only for Prompt', async () => {
const agents = () => ({ ok: true, items: [{ id: 'taa', name: 'Taskade EVE' }, { id: 'a1', name: 'Triage' }] });
const forGet = createContext({ authentication: 'accessToken', spaceId: 's1', operation: 'get' }, agents);
const forPrompt = createContext({ authentication: 'accessToken', spaceId: 's1', operation: 'prompt' }, agents);
const get = await node.methods.listSearch.searchAgents.call(forGet as unknown as ILoadOptionsFunctions);
Expand Down
9 changes: 5 additions & 4 deletions src/searches/findAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { Bundle, ZObject } from 'zapier-platform-core';
import { ApiResponse, parseOk, request } from '../client';
import { spaceField } from '../fields';

const TAA_AGENT_ID = 'taa';
// The id that the API gives the built-in agent (Taskade EVE).
const BUILT_IN_AGENT_ID = 'taa';

const perform = async (z: ZObject, bundle: Bundle) => {
const response = await request(z, bundle, {
Expand All @@ -20,9 +21,9 @@ const perform = async (z: ZObject, bundle: Bundle) => {
const query = String(bundle.inputData.query ?? '').toLowerCase();

const agents = (data.items ?? [])
// `taa` is the built-in Taskade agent that the API lists first. It is not
// one of the user's agents, so a name search must not pick it.
.filter((agent) => agent.id !== TAA_AGENT_ID)
// The API lists the built-in agent first. It is not one of the user's
// agents, so a name search must not pick it.
.filter((agent) => agent.id !== BUILT_IN_AGENT_ID)
.map((agent) => ({
id: agent.id as string,
name: (agent.name ?? '') as string,
Expand Down
4 changes: 2 additions & 2 deletions src/test/app.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,11 @@ describe('Taskade Genesis actions and searches', () => {
});

describe('Review fixes', () => {
it('skips the built-in TAA agent and puts an exact name match first', async () => {
it('skips the built-in agent and puts an exact name match first', async () => {
const { z } = fakeZ({
ok: true,
items: [
{ id: 'taa', name: 'Taskade Agent (TAA)', description: 'The general purpose agent', tools: {} },
{ id: 'taa', name: 'Taskade EVE', description: 'The general purpose agent', tools: {} },
{ id: 'agent-2', name: 'Sales Agent Follow-up', description: '', tools: {} },
{ id: 'agent-1', name: 'Sales Agent', description: '', tools: {} },
],
Expand Down
Loading