fix: align agent id normalization

This commit is contained in:
Peter Steinberger
2026-01-24 12:10:08 +00:00
parent ef9ba66798
commit 298901208d
4 changed files with 4 additions and 4 deletions

View File

@@ -162,7 +162,7 @@ describe("cron cli", () => {
const updateCall = callGatewayFromCli.mock.calls.find((call) => call[0] === "cron.update");
const patch = updateCall?.[2] as { patch?: { agentId?: unknown } };
expect(patch?.patch?.agentId).toBe("Ops");
expect(patch?.patch?.agentId).toBe("ops");
callGatewayFromCli.mockClear();
await program.parseAsync(["cron", "edit", "job-2", "--clear-agent"], {

View File

@@ -38,7 +38,7 @@ describe("normalizeCronJobCreate", () => {
},
}) as unknown as Record<string, unknown>;
expect(normalized.agentId).toBe("Ops");
expect(normalized.agentId).toBe("ops");
const cleared = normalizeCronJobCreate({
name: "agent-clear",

View File

@@ -665,7 +665,7 @@ async function handleSendAction(ctx: ResolvedActionContext): Promise<MessageActi
threadId: threadId ?? slackAutoThreadId,
})
: null;
if (outboundRoute && !dryRun) {
if (outboundRoute && !dryRun && agentId) {
await ensureOutboundSessionEntry({
cfg,
agentId,

View File

@@ -180,7 +180,7 @@ describe("resolveAgentRoute", () => {
accountId: undefined,
peer: { kind: "dm", id: "+1000" },
});
expect(defaultRoute.agentId).toBe("defaultAcct");
expect(defaultRoute.agentId).toBe("defaultacct");
expect(defaultRoute.matchedBy).toBe("binding.account");
const otherRoute = resolveAgentRoute({