refactor!: rename chat providers to channels

This commit is contained in:
Peter Steinberger
2026-01-13 06:16:43 +00:00
parent 0cd632ba84
commit 90342a4f3a
393 changed files with 8004 additions and 6737 deletions

View File

@@ -8,7 +8,7 @@ import {
resolveStorePath,
} from "../config/sessions.js";
import { callGateway } from "../gateway/call.js";
import { INTERNAL_MESSAGE_PROVIDER } from "../utils/message-provider.js";
import { INTERNAL_MESSAGE_CHANNEL } from "../utils/message-channel.js";
import { AGENT_LANE_NESTED } from "./lanes.js";
import { readLatestAssistantReply, runAgentStep } from "./tools/agent-step.js";
import { resolveAnnounceTarget } from "./tools/sessions-announce-target.js";
@@ -139,7 +139,7 @@ async function buildSubagentStatsLine(params: {
export function buildSubagentSystemPrompt(params: {
requesterSessionKey?: string;
requesterProvider?: string;
requesterChannel?: string;
childSessionKey: string;
label?: string;
task?: string;
@@ -182,8 +182,8 @@ export function buildSubagentSystemPrompt(params: {
params.requesterSessionKey
? `- Requester session: ${params.requesterSessionKey}.`
: undefined,
params.requesterProvider
? `- Requester provider: ${params.requesterProvider}.`
params.requesterChannel
? `- Requester channel: ${params.requesterChannel}.`
: undefined,
`- Your session: ${params.childSessionKey}.`,
"",
@@ -195,7 +195,7 @@ export function buildSubagentSystemPrompt(params: {
function buildSubagentAnnouncePrompt(params: {
requesterSessionKey?: string;
requesterProvider?: string;
requesterChannel?: string;
announceChannel: string;
task: string;
subagentReply?: string;
@@ -205,10 +205,10 @@ function buildSubagentAnnouncePrompt(params: {
params.requesterSessionKey
? `Requester session: ${params.requesterSessionKey}.`
: undefined,
params.requesterProvider
? `Requester provider: ${params.requesterProvider}.`
params.requesterChannel
? `Requester channel: ${params.requesterChannel}.`
: undefined,
`Post target provider: ${params.announceChannel}.`,
`Post target channel: ${params.announceChannel}.`,
`Original task: ${params.task}`,
params.subagentReply
? `Sub-agent result: ${params.subagentReply}`
@@ -226,7 +226,7 @@ export async function runSubagentAnnounceFlow(params: {
childSessionKey: string;
childRunId: string;
requesterSessionKey: string;
requesterProvider?: string;
requesterChannel?: string;
requesterDisplayKey: string;
task: string;
timeoutMs: number;
@@ -269,8 +269,8 @@ export async function runSubagentAnnounceFlow(params: {
const announcePrompt = buildSubagentAnnouncePrompt({
requesterSessionKey: params.requesterSessionKey,
requesterProvider: params.requesterProvider,
announceChannel: announceTarget.provider,
requesterChannel: params.requesterChannel,
announceChannel: announceTarget.channel,
task: params.task,
subagentReply: reply,
});
@@ -280,7 +280,7 @@ export async function runSubagentAnnounceFlow(params: {
message: "Sub-agent announce step.",
extraSystemPrompt: announcePrompt,
timeoutMs: params.timeoutMs,
provider: INTERNAL_MESSAGE_PROVIDER,
channel: INTERNAL_MESSAGE_CHANNEL,
lane: AGENT_LANE_NESTED,
});
@@ -305,7 +305,7 @@ export async function runSubagentAnnounceFlow(params: {
params: {
to: announceTarget.to,
message,
provider: announceTarget.provider,
channel: announceTarget.channel,
accountId: announceTarget.accountId,
idempotencyKey: crypto.randomUUID(),
},