Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

♻️ refactor(channel): rename jev routing source and mode to decision (#21892)

AmAzing-1c4c4b934b5e
diff --git a/apps/server/src/services/channel/ChannelService.routing.test.ts b/apps/server/src/services/channel/ChannelService.routing.test.ts
index 8eb074fa64e..c884ee9badb 100644
--- a/apps/server/src/services/channel/ChannelService.routing.test.ts
+++ b/apps/server/src/services/channel/ChannelService.routing.test.ts
@@ -32,10 +32,10 @@ beforeEach(() => {
describe('Channel routing ingress', () => {
const service = () => new ChannelService({} as never, 'sender', 'workspace');
const input = { content: 'Help with code', requestKey: 'key' };
- it('enqueues unmentioned messages for Jev when configured', async () => {
+ it('enqueues unmentioned messages for the decision model when configured', async () => {
mocks.config.mockResolvedValue({ model: 'jev-1.14.0', provider: 'typesafe' });
await service().send('channel', input);
- expect(mocks.send).toHaveBeenCalledWith('channel', { ...input, routing: 'jev' });
+ expect(mocks.send).toHaveBeenCalledWith('channel', { ...input, routing: 'decision' });
expect(mocks.wake).toHaveBeenCalledWith('channel');
});
it('preserves the existing fallback when not configured', async () => {
diff --git a/apps/server/src/services/channel/ChannelService.ts b/apps/server/src/services/channel/ChannelService.ts
index a3e13d4f040..b6eeeecd8da 100644
--- a/apps/server/src/services/channel/ChannelService.ts
+++ b/apps/server/src/services/channel/ChannelService.ts
@@ -213,7 +213,7 @@ export class ChannelService {
const config = await resolveChannelRoutingConfig(this.db, this.userId);
const message = await this.repository.send(channelId, {
...input,
- routing: config ? 'jev' : 'fallback',
+ routing: config ? 'decision' : 'fallback',
});
// Do not swallow a queue failure: the client can retry the SAME request key safely.
await Promise.all([wakeChannel(channelId), this.changed(channelId)]);
diff --git a/packages/database/src/repositories/channel/__tests__/ChannelRoutingRepository.test.ts b/packages/database/src/repositories/channel/__tests__/ChannelRoutingRepository.test.ts
index bc5fdad2cd3..5c458a9c0a5 100644
--- a/packages/database/src/repositories/channel/__tests__/ChannelRoutingRepository.test.ts
+++ b/packages/database/src/repositories/channel/__tests__/ChannelRoutingRepository.test.ts
@@ -17,7 +17,7 @@ import { ChannelExecutionRepository, ChannelRoutingRepository } from '..';
import { createChannelFixture, jobsOf } from './testUtils';
const db: LobeChatDatabase = await getTestDB();
-const fixture = createChannelFixture(db, 'channel-jev-input');
+const fixture = createChannelFixture(db, 'channel-decision-input');
const routing = new ChannelRoutingRepository(db);
const execution = new ChannelExecutionRepository(db);
beforeEach(async () => {
@@ -40,7 +40,7 @@ const prepare = async () => {
const message = await team.asMember.send(team.channel.id, {
content: 'Implement a parser',
requestKey: 'request',
- routing: 'jev',
+ routing: 'decision',
});
return { ...team, coder, reviewer, message };
};
@@ -81,7 +81,7 @@ describe('Channel routing input and lease', () => {
const reply = await asMember.send(channel.id, {
content: 'Follow-up',
requestKey: 'thread-request',
- routing: 'jev',
+ routing: 'decision',
threadId: thread.id,
});
expect(reply.routingStatus).toBe('pending');
@@ -124,7 +124,7 @@ describe('Channel routing input and lease', () => {
content: '@Coder',
mentions: [coder.id],
requestKey: 'directed',
- routing: 'jev',
+ routing: 'decision',
});
expect(await routing.claim(channel.id, directed.id)).toBeNull();
await routing.claim(channel.id, message.id);
@@ -224,7 +224,7 @@ describe('Channel routing input and lease', () => {
const request = await asMember.send(channel.id, {
content: 'Continue the parser',
requestKey: 'thread',
- routing: 'jev',
+ routing: 'decision',
threadId: thread.id,
});
await asMember.send(channel.id, {
@@ -253,7 +253,7 @@ describe('Channel routing input and lease', () => {
const message = await asMember.send(channel.id, {
content: 'Now',
requestKey: 'latest',
- routing: 'jev',
+ routing: 'decision',
});
const input = await routing.claim(channel.id, message.id);
expect(input?.history).toHaveLength(20);
diff --git a/packages/database/src/repositories/channel/__tests__/asyncRouting.test.ts b/packages/database/src/repositories/channel/__tests__/asyncRouting.test.ts
index c53436d721c..03704c7c014 100644
--- a/packages/database/src/repositories/channel/__tests__/asyncRouting.test.ts
+++ b/packages/database/src/repositories/channel/__tests__/asyncRouting.test.ts
@@ -29,7 +29,7 @@ const setup = async () => {
const root = await team.asMember.send(team.channel.id, {
content: 'Make a change',
requestKey: 'root',
- routing: 'jev',
+ routing: 'decision',
});
return { ...team, agent, other, root };
};
@@ -54,7 +54,7 @@ describe('asynchronous Channel routing', () => {
content: 'Undo the change',
mentions: [agent.id],
requestKey: 'undo',
- routing: 'jev',
+ routing: 'decision',
});
const [nextJob] = await jobsOf(db, next.id);
expect(await routing.claim(channel.id, root.id)).toBeNull();
@@ -88,7 +88,7 @@ describe('asynchronous Channel routing', () => {
content: 'Explicit request',
mentions: [agent.id],
requestKey: 'next',
- routing: 'jev',
+ routing: 'decision',
});
const [job] = await jobsOf(db, next.id);
expect(await execution.claim(channel.id, job.id, lease)).toBeNull();
@@ -108,13 +108,13 @@ describe('asynchronous Channel routing', () => {
content: 'Other branch',
rootMessageId: root.id,
requestKey: 'branch',
- routing: 'jev',
+ routing: 'decision',
});
const next = await asMember.send(channel.id, {
content: 'Independent',
mentions: [agent.id],
requestKey: 'next',
- routing: 'jev',
+ routing: 'decision',
});
const [job] = await jobsOf(db, next.id);
expect(await execution.claim(channel.id, job.id, lease)).not.toBeNull();
@@ -134,7 +134,7 @@ describe('asynchronous Channel routing', () => {
content: 'Earlier branch',
rootMessageId: root.id,
requestKey: 'branch',
- routing: 'jev',
+ routing: 'decision',
});
const next = await asMember.send(channel.id, {
content: 'Later main',
@@ -161,7 +161,7 @@ describe('asynchronous Channel routing', () => {
expect(await execution.claim(channel.id, job.id, lease)).not.toBeNull();
});
- it.each(['jev', 'fallback'] as const)(
+ it.each(['decision', 'fallback'] as const)(
'keeps the first %s thread reply pending until it can inherit the root responders',
async (mode) => {
const { agent, asMember, channel, other, root } = await setup();
@@ -205,7 +205,7 @@ describe('asynchronous Channel routing', () => {
expect(await messageById(reply.id)).toMatchObject({
recipientMemberIds: [agent.id],
routingStatus: 'assigned',
- routingSource: mode === 'fallback' ? 'fallback' : 'jev',
+ routingSource: mode === 'fallback' ? 'fallback' : 'decision',
});
expect(await jobsOf(db, reply.id)).toHaveLength(1);
const next = await asMember.send(channel.id, {
@@ -224,7 +224,7 @@ describe('asynchronous Channel routing', () => {
content: 'Continue',
requestKey: 'reply',
rootMessageId: root.id,
- routing: 'jev',
+ routing: 'decision',
});
expect(reply.routingStatus).toBe('pending');
await asOwner.stop(channel.id, { threadId: reply.threadId });
@@ -244,7 +244,7 @@ describe('asynchronous Channel routing', () => {
content: 'Continue',
requestKey: 'reply',
rootMessageId: root.id,
- routing: 'jev',
+ routing: 'decision',
});
await execution.resolveRouting(channel.id, root.id, 1, {
reason: 'Provider unavailable',
diff --git a/packages/database/src/repositories/channel/__tests__/attachments.test.ts b/packages/database/src/repositories/channel/__tests__/attachments.test.ts
index f6d000525ca..e26882ceabd 100644
--- a/packages/database/src/repositories/channel/__tests__/attachments.test.ts
+++ b/packages/database/src/repositories/channel/__tests__/attachments.test.ts
@@ -49,7 +49,7 @@ describe('channel message attachments', () => {
fileIds: [first, second],
mentions: [agent.id],
requestKey: 'req-1',
- routing: 'jev' as const,
+ routing: 'decision' as const,
};
const message = await asMember.send(channel.id, input);
@@ -71,7 +71,7 @@ describe('channel message attachments', () => {
fileIds: [kept, deleted],
mentions: [agent.id],
requestKey: 'req-1',
- routing: 'jev',
+ routing: 'decision',
});
await db.delete(files).where(eq(files.id, deleted));
const [job] = await jobsOf(db, message.id);
diff --git a/packages/database/src/repositories/channel/__tests__/claimGuards.test.ts b/packages/database/src/repositories/channel/__tests__/claimGuards.test.ts
index 53b089762e2..745ff66d434 100644
--- a/packages/database/src/repositories/channel/__tests__/claimGuards.test.ts
+++ b/packages/database/src/repositories/channel/__tests__/claimGuards.test.ts
@@ -32,7 +32,7 @@ const request = async (
content: key,
mentions: [agentId],
requestKey: key,
- routing: 'jev',
+ routing: 'decision',
});
const [job] = await jobsOf(db, message.id);
return { job, message };
@@ -130,7 +130,7 @@ describe('claim guards', () => {
const unmentioned = await asMember.send(channel.id, {
content: 'Who can help?',
requestKey: 'unmentioned',
- routing: 'jev',
+ routing: 'decision',
});
await execution.resolveRouting(channel.id, unmentioned.id, 1, {
reason: 'Decision unavailable',
diff --git a/packages/database/src/repositories/channel/__tests__/dispatchSafety.test.ts b/packages/database/src/repositories/channel/__tests__/dispatchSafety.test.ts
index a508d89d503..7c9ab82a910 100644
--- a/packages/database/src/repositories/channel/__tests__/dispatchSafety.test.ts
+++ b/packages/database/src/repositories/channel/__tests__/dispatchSafety.test.ts
@@ -160,7 +160,7 @@ describe('Channel dispatch reservation', () => {
content: 'Waits for a device',
mentions: [offline.id],
requestKey: 'blocked',
- routing: 'jev',
+ routing: 'decision',
});
const [first] = await jobsOf(db, blocked.id);
await db.insert(channelJobs).values(
@@ -175,7 +175,7 @@ describe('Channel dispatch reservation', () => {
content: 'Answer me',
mentions: [healthy.id],
requestKey: 'fresh',
- routing: 'jev',
+ routing: 'decision',
});
const [freshJob] = await jobsOf(db, fresh.id);
diff --git a/packages/database/src/repositories/channel/__tests__/execution.test.ts b/packages/database/src/repositories/channel/__tests__/execution.test.ts
index ce176192849..43ca534d9a6 100644
--- a/packages/database/src/repositories/channel/__tests__/execution.test.ts
+++ b/packages/database/src/repositories/channel/__tests__/execution.test.ts
@@ -55,7 +55,7 @@ const mentionAgent = async (config = deviceConfig()) => {
content: 'Fix it',
mentions: [agent.id],
requestKey: 'req-1',
- routing: 'jev',
+ routing: 'decision',
});
const [job] = await jobsOf(db, message.id);
@@ -153,7 +153,7 @@ describe('ChannelExecutionRepository', () => {
content: 'Again',
mentions: [agent.id],
requestKey: 'req-2',
- routing: 'jev',
+ routing: 'decision',
});
const [nextJob] = await jobsOf(db, next.id);
const second = (await execution.claim(channel.id, nextJob.id, lease))!;
@@ -169,7 +169,7 @@ describe('ChannelExecutionRepository', () => {
const mainAgent = await fixture.addAgent(channel.id, 'Main', nativeConfig);
const threadAgent = await fixture.addAgent(channel.id, 'Thread', nativeConfig);
const send = (requestKey: string, input: Partial<ChannelSendInput> = {}) =>
- asMember.send(channel.id, { content: requestKey, requestKey, routing: 'jev', ...input });
+ asMember.send(channel.id, { content: requestKey, requestKey, routing: 'decision', ...input });
const root = await send('root', { mentions: [member.id] });
const [thread] = await db
.insert(channelThreads)
@@ -218,7 +218,7 @@ describe('ChannelExecutionRepository', () => {
content: 'Second',
mentions: [agent.id],
requestKey: 'req-2',
- routing: 'jev',
+ routing: 'decision',
});
const [nextJob] = await jobsOf(db, next.id);
@@ -243,7 +243,7 @@ describe('ChannelExecutionRepository', () => {
content: 'Together',
mentions: [first.id, second.id, native.id],
requestKey: 'parallel',
- routing: 'jev',
+ routing: 'decision',
});
const jobs = await jobsOf(db, message.id);
const claims = await Promise.all(jobs.map((job) => execution.claim(channel.id, job.id, lease)));
@@ -267,7 +267,7 @@ describe('ChannelExecutionRepository', () => {
content: 'Same repo',
mentions: [otherAgent.id],
requestKey: 'req-1',
- routing: 'jev',
+ routing: 'decision',
});
const [job] = await jobsOf(db, message.id);
@@ -299,7 +299,7 @@ describe('ChannelExecutionRepository', () => {
content: 'Same repo',
mentions: [otherAgent.id],
requestKey: 'req-1',
- routing: 'jev',
+ routing: 'decision',
});
const [job] = await jobsOf(db, message.id);
@@ -445,7 +445,7 @@ describe('ChannelExecutionRepository', () => {
content: 'Next',
mentions: [agent.id],
requestKey: 'req-2',
- routing: 'jev',
+ routing: 'decision',
});
const [nextJob] = await jobsOf(db, next.id);
expect(await execution.claim(channel.id, nextJob.id, lease)).not.toBeNull();
diff --git a/packages/database/src/repositories/channel/__tests__/history.test.ts b/packages/database/src/repositories/channel/__tests__/history.test.ts
index 8790c5f483a..6177557a043 100644
--- a/packages/database/src/repositories/channel/__tests__/history.test.ts
+++ b/packages/database/src/repositories/channel/__tests__/history.test.ts
@@ -36,7 +36,7 @@ const setup = async () => {
threadId,
mentions: [team.owner.id],
requestKey: `history-${++key}`,
- routing: 'jev',
+ routing: 'decision',
});
const run = async (threadId?: string) => {
const request = await team.asMember.send(team.channel.id, {
@@ -44,7 +44,7 @@ const setup = async () => {
threadId,
mentions: [agent.id],
requestKey: `run-${++key}`,
- routing: 'jev',
+ routing: 'decision',
});
const [job] = await jobsOf(db, request.id);
const claim = (await execution.claim(team.channel.id, job.id, lease))!;
diff --git a/packages/database/src/repositories/channel/__tests__/identity.test.ts b/packages/database/src/repositories/channel/__tests__/identity.test.ts
index 448017c2de4..ff9df6dada2 100644
--- a/packages/database/src/repositories/channel/__tests__/identity.test.ts
+++ b/packages/database/src/repositories/channel/__tests__/identity.test.ts
@@ -15,7 +15,7 @@ const execution = new ChannelExecutionRepository(db);
beforeEach(fixture.setup);
afterEach(fixture.cleanup);
-const sendInput = { content: 'Hello', requestKey: 'hello', routing: 'jev' as const };
+const sendInput = { content: 'Hello', requestKey: 'hello', routing: 'decision' as const };
const createAgent = async (workspaceId: string | null = fixture.workspaceId) => {
const [agent] = await db
.insert(agents)
diff --git a/packages/database/src/repositories/channel/__tests__/remove.test.ts b/packages/database/src/repositories/channel/__tests__/remove.test.ts
index d99f17d3677..f7fd1a2e999 100644
--- a/packages/database/src/repositories/channel/__tests__/remove.test.ts
+++ b/packages/database/src/repositories/channel/__tests__/remove.test.ts
@@ -115,7 +115,7 @@ describe('Channel soft deletion', () => {
const pending = await asOwner.send(channel.id, {
content: 'Who?',
requestKey: 'pending',
- routing: 'jev',
+ routing: 'decision',
});
const writers = await asOwner.remove(channel.id);
diff --git a/packages/database/src/repositories/channel/__tests__/removeThread.test.ts b/packages/database/src/repositories/channel/__tests__/removeThread.test.ts
index 21a57769a3a..6e8d011ee0f 100644
--- a/packages/database/src/repositories/channel/__tests__/removeThread.test.ts
+++ b/packages/database/src/repositories/channel/__tests__/removeThread.test.ts
@@ -147,7 +147,7 @@ describe('Thread deletion', () => {
content: 'Route me',
requestKey: 'pending',
threadId: thread.id,
- routing: 'jev',
+ routing: 'decision',
});
await asOwner.removeThread(channel.id, thread.id);
diff --git a/packages/database/src/repositories/channel/__tests__/routingStop.test.ts b/packages/database/src/repositories/channel/__tests__/routingStop.test.ts
index e16ce265a27..64a8dc87161 100644
--- a/packages/database/src/repositories/channel/__tests__/routingStop.test.ts
+++ b/packages/database/src/repositories/channel/__tests__/routingStop.test.ts
@@ -24,14 +24,14 @@ const messageById = async (messageId: string) => {
};
describe('routing write-back', () => {
- it('delivers a current Jev decision to the chosen candidates only', async () => {
+ it('delivers a current routing decision to the chosen candidates only', async () => {
const { asMember, channel, member } = await fixture.createTeamChannel();
const coder = await fixture.addAgent(channel.id, 'Coder');
await fixture.addAgent(channel.id, 'Reviewer');
const message = await asMember.send(channel.id, {
content: 'Who knows?',
requestKey: 'req-1',
- routing: 'jev',
+ routing: 'decision',
});
expect(
@@ -44,7 +44,7 @@ describe('routing write-back', () => {
expect(await messageById(message.id)).toMatchObject({
recipientMemberIds: [coder.id],
- routingSource: 'jev',
+ routingSource: 'decision',
routingStatus: 'assigned',
});
expect(await jobsOf(db, message.id)).toEqual([
@@ -58,7 +58,7 @@ describe('routing write-back', () => {
const message = await asMember.send(channel.id, {
content: 'Who knows?',
requestKey: 'req-1',
- routing: 'jev',
+ routing: 'decision',
});
await execution.resolveRouting(channel.id, message.id, 1, {
reason: 'Unclear',
@@ -83,7 +83,7 @@ describe('routing write-back', () => {
const message = await asOwner.send(channel.id, {
content: 'Who knows?',
requestKey: 'req-1',
- routing: 'jev',
+ routing: 'decision',
});
await execution.resolveRouting(channel.id, message.id, 1, {
reason: 'Unclear',
@@ -107,7 +107,7 @@ describe('stop', () => {
content: 'Do it',
mentions: [coder.id],
requestKey: 'req-1',
- routing: 'jev',
+ routing: 'decision',
});
const [job] = await jobsOf(db, message.id);
await execution.claim(channel.id, job.id, lease);
@@ -143,7 +143,7 @@ describe('stop', () => {
content: 'Root',
mentions: [coder.id],
requestKey: 'root',
- routing: 'jev',
+ routing: 'decision',
});
const [thread] = await db
.insert(channelThreads)
@@ -158,13 +158,13 @@ describe('stop', () => {
content: 'In thread',
mentions: [coder.id],
requestKey: 'thread',
- routing: 'jev',
+ routing: 'decision',
threadId: thread.id,
});
const pending = await asOwner.send(channel.id, {
content: 'Anyone?',
requestKey: 'pending',
- routing: 'jev',
+ routing: 'decision',
});
await asOwner.stop(channel.id, { threadId: null });
@@ -193,23 +193,23 @@ describe('stop', () => {
content: 'Owner asks',
mentions: [coder.id],
requestKey: 'owner',
- routing: 'jev',
+ routing: 'decision',
});
const memberRequest = await asMember.send(channel.id, {
content: 'Member asks',
mentions: [coder.id],
requestKey: 'member',
- routing: 'jev',
+ routing: 'decision',
});
const ownerPending = await asOwner.send(channel.id, {
content: 'Owner: anyone?',
requestKey: 'owner-pending',
- routing: 'jev',
+ routing: 'decision',
});
const memberPending = await asMember.send(channel.id, {
content: 'Member: anyone?',
requestKey: 'member-pending',
- routing: 'jev',
+ routing: 'decision',
});
const [ownerJob] = await jobsOf(db, ownerRequest.id);
const [memberJob] = await jobsOf(db, memberRequest.id);
diff --git a/packages/database/src/repositories/channel/__tests__/send.test.ts b/packages/database/src/repositories/channel/__tests__/send.test.ts
index 956b6b3f92f..769442c3a13 100644
--- a/packages/database/src/repositories/channel/__tests__/send.test.ts
+++ b/packages/database/src/repositories/channel/__tests__/send.test.ts
@@ -38,7 +38,7 @@ describe('ChannelRepository.send', () => {
content: 'Fix the bug',
mentions: [coder.id],
requestKey: 'req-1',
- routing: 'jev',
+ routing: 'decision',
});
expect(message).toMatchObject({
@@ -67,14 +67,14 @@ describe('ChannelRepository.send', () => {
content: 'Can you review this?',
mentions: [owner.id],
requestKey: 'req-1',
- routing: 'jev',
+ routing: 'decision',
});
expect(message).toMatchObject({ recipientMemberIds: [], routingStatus: 'directed' });
expect(await jobsOf(db, message.id)).toEqual([]);
});
- it('leaves an unmentioned message to Jev, or to every Agent without a decision model', async () => {
+ it('leaves an unmentioned message to the decision model, or to every Agent without a decision model', async () => {
const { asMember, channel } = await fixture.createTeamChannel();
const coder = await fixture.addAgent(channel.id, 'Coder');
const reviewer = await fixture.addAgent(channel.id, 'Reviewer');
@@ -82,7 +82,7 @@ describe('ChannelRepository.send', () => {
const routed = await asMember.send(channel.id, {
content: 'Anyone?',
requestKey: 'req-1',
- routing: 'jev',
+ routing: 'decision',
});
expect(routed).toMatchObject({ routingAttempt: 1, routingStatus: 'pending' });
expect(await jobsOf(db, routed.id)).toEqual([]);
@@ -103,7 +103,7 @@ describe('ChannelRepository.send', () => {
const message = await asMember.send(channel.id, {
content: 'Hello',
requestKey: 'req-1',
- routing: 'jev',
+ routing: 'decision',
});
expect(message.routingStatus).toBe('skipped');
@@ -117,7 +117,7 @@ describe('ChannelRepository.send', () => {
content: 'Root',
mentions: [coder.id],
requestKey: 'root',
- routing: 'jev',
+ routing: 'decision',
});
const [thread] = await db
.insert(channelThreads)
@@ -141,7 +141,7 @@ describe('ChannelRepository.send', () => {
content: 'Join us',
mentions: [reviewer.id.toUpperCase(), reviewer.id],
requestKey: 'join',
- routing: 'jev',
+ routing: 'decision',
threadId: thread.id,
});
const [joined] = await db.select().from(channelThreads).where(eq(channelThreads.id, thread.id));
@@ -163,7 +163,7 @@ describe('ChannelRepository.send', () => {
content: 'Once',
mentions: [coder.id.toUpperCase(), coder.id],
requestKey: 'req-1',
- routing: 'jev' as const,
+ routing: 'decision' as const,
};
const first = await asMember.send(channel.id, input);
@@ -179,7 +179,7 @@ describe('ChannelRepository.send', () => {
it('rejects empty or oversized content, unknown mentions and foreign files', async () => {
const { asMember, channel } = await fixture.createTeamChannel();
- const base = { requestKey: 'req-1', routing: 'jev' as const };
+ const base = { requestKey: 'req-1', routing: 'decision' as const };
await expect(asMember.send(channel.id, { ...base, content: ' ' })).rejects.toMatchObject({
code: 'BAD_REQUEST',
diff --git a/packages/database/src/repositories/channel/__tests__/topicContinuation.test.ts b/packages/database/src/repositories/channel/__tests__/topicContinuation.test.ts
index 90402006064..51020ad8ca7 100644
--- a/packages/database/src/repositories/channel/__tests__/topicContinuation.test.ts
+++ b/packages/database/src/repositories/channel/__tests__/topicContinuation.test.ts
@@ -152,7 +152,7 @@ describe('Channel topic continuation', () => {
const early = await state.asMember.send(state.channel.id, {
content: 'Delayed request',
requestKey: 'delayed',
- routing: 'jev',
+ routing: 'decision',
});
await execution.resolveRouting(state.channel.id, early.id, early.routingAttempt, {
reason: 'Decision unavailable',
diff --git a/packages/database/src/repositories/channel/execution.ts b/packages/database/src/repositories/channel/execution.ts
index ca2578f14ed..94a9e5859ac 100644
--- a/packages/database/src/repositories/channel/execution.ts
+++ b/packages/database/src/repositories/channel/execution.ts
@@ -169,7 +169,7 @@ export class ChannelExecutionRepository {
return true;
});
- /** Writes back a Jev decision for `attempt`; false when the result is stale. */
+ /** Writes back a routing decision for `attempt`; false when the result is stale. */
resolveRouting = async (
channelId: string,
messageId: string,
diff --git a/packages/database/src/repositories/channel/index.ts b/packages/database/src/repositories/channel/index.ts
index 5ca143050a6..652e68482cc 100644
--- a/packages/database/src/repositories/channel/index.ts
+++ b/packages/database/src/repositories/channel/index.ts
@@ -473,7 +473,7 @@ export class ChannelRepository {
{ minRole: 'admin' },
);
- /** Sends an unassigned message back to Jev. Its author or an admin may retry. */
+ /** Sends an unassigned message back to the decision model. Its author or an admin may retry. */
retryRouting = async (channelId: string, messageId: string): Promise<ChannelMessageItem> =>
this.write(channelId, async (tx, { member }) => {
if (!hasRole(member.role, 'admin')) {
diff --git a/packages/database/src/repositories/channel/routing.ts b/packages/database/src/repositories/channel/routing.ts
index f101f701eb0..e50f4df7e24 100644
--- a/packages/database/src/repositories/channel/routing.ts
+++ b/packages/database/src/repositories/channel/routing.ts
@@ -25,7 +25,7 @@ const findMessage = async (tx: Transaction, channelId: string, messageId: string
};
/**
- * Writes back a Jev decision. Applies only while the message is still `pending` at the same
+ * Writes back a routing decision. Applies only while the message is still `pending` at the same
* attempt, so a late answer can never overwrite a retry or a stop. Chosen members that are
* no longer candidates are dropped. Returns false when the result was stale.
*/
@@ -73,7 +73,7 @@ export const resolveRouting = async (
: requester
? 'Chosen Agents are no longer available'
: 'The message sender is no longer available',
- routingSource: message.routingSource === 'fallback' ? 'fallback' : 'jev',
+ routingSource: message.routingSource === 'fallback' ? 'fallback' : 'decision',
routingStatus: status,
})
.where(eq(channelMessages.id, messageId));
@@ -107,7 +107,7 @@ export const resolveRouting = async (
return true;
};
-/** Sends an `unassigned` message back to Jev under a new attempt number. */
+/** Sends an `unassigned` message back to the decision model under a new attempt number. */
export const retryRouting = async (
tx: Transaction,
channelId: string,
diff --git a/packages/database/src/repositories/channel/send.ts b/packages/database/src/repositories/channel/send.ts
index 1b5e6f42927..ad369fb23ac 100644
--- a/packages/database/src/repositories/channel/send.ts
+++ b/packages/database/src/repositories/channel/send.ts
@@ -62,7 +62,7 @@ export const validateSendInput = (input: ChannelSendInput) => {
*
* - @mentioned Agents get jobs in this transaction (`directed`, source `explicit`).
* - @mentioning only people wakes no Agent.
- * - Without mentions, `jev` leaves the message `pending` for the routing task, and
+ * - Without mentions, `decision` leaves the message `pending` for the routing task, and
* `fallback` hands it to every candidate Agent at once.
*/
export const sendMessage = async (
@@ -159,7 +159,7 @@ export const sendMessage = async (
? ({ reason: 'No Agent can answer here', source: null, status: 'skipped' } as const)
: direct
? ({ reason: 'Direct conversation', source: 'explicit', status: 'directed' } as const)
- : input.routing === 'jev'
+ : input.routing === 'decision'
? ({ reason: null, source: null, status: 'pending' } as const)
: ({
reason: 'No decision model configured',
diff --git a/packages/database/src/repositories/channel/stop.ts b/packages/database/src/repositories/channel/stop.ts
index 6b39604a1db..64076408886 100644
--- a/packages/database/src/repositories/channel/stop.ts
+++ b/packages/database/src/repositories/channel/stop.ts
@@ -29,7 +29,7 @@ interface StopCandidate {
/**
* Cancels queued and running jobs in the scope and revokes the publication of every claimed
* job that has not both published and released its writer. Pending routing in a branch is
- * closed and its attempt bumped, so a late Jev answer is ignored.
+ * closed and its attempt bumped, so a late decision model answer is ignored.
*
* `requester` narrows a branch stop to that member's own requests and pending routing; admins
* stop the whole branch.
diff --git a/packages/types/src/channel.ts b/packages/types/src/channel.ts
index f72cdf93799..5bc0d82239a 100644
--- a/packages/types/src/channel.ts
+++ b/packages/types/src/channel.ts
@@ -103,10 +103,10 @@ export interface ChannelExecutionConfig extends LobeAgentConfig, ChannelMemberCo
/**
* - `directed`: carried explicit @mentions; jobs were created in the send transaction.
- * - `pending`: waiting for Jev to pick responders.
- * - `assigned`: Jev (or the no-model fallback) picked at least one Agent.
+ * - `pending`: waiting for the decision model to pick responders.
+ * - `assigned`: the decision model (or the no-model fallback) picked at least one Agent.
* - `unassigned`: routing could not complete; no Agent was woken and the user may retry.
- * - `skipped`: Jev decided nobody needs to reply. Not a failure.
+ * - `skipped`: the decision model decided nobody needs to reply. Not a failure.
* - `reply`: an Agent's published reply; replies never enter routing.
*/
export type ChannelMessageRoutingStatus =
@@ -114,16 +114,16 @@ export type ChannelMessageRoutingStatus =
/**
* - `explicit`: recipients came from @mentions, Thread followers or a bound direct Agent.
- * - `jev`: recipients came from a `decide()` call.
+ * - `decision`: recipients came from a `decide()` call.
* - `fallback`: no decision model is configured, so every available Agent was picked.
*/
-export type ChannelMessageRoutingSource = 'explicit' | 'fallback' | 'jev';
+export type ChannelMessageRoutingSource = 'decision' | 'explicit' | 'fallback';
/**
- * How a human message without @mentions is routed: `jev` when a decision model is
+ * How a human message without @mentions is routed: `decision` when a decision model is
* configured, otherwise `fallback` to every candidate Agent.
*/
-export type ChannelRoutingMode = 'fallback' | 'jev';
+export type ChannelRoutingMode = 'decision' | 'fallback';
/**
* - `queued`: waiting at the member's FIFO.