fix: remove author_slug from sendMessage, clean client
This commit is contained in:
parent
e4e604b049
commit
ccdf1f21de
@ -28,7 +28,7 @@ export function createMessageTools(ctx: ToolContext): ToolDefinition<any>[] {
|
||||
description: 'Send a message to a chat or add a comment to a task. Specify either chat_id or task_id.',
|
||||
parameters: SendMessageParams,
|
||||
async execute(_id: string, params: any) {
|
||||
const msg = await ctx.trackerClient.sendMessage(params, ctx.agentSlug);
|
||||
const msg = await ctx.trackerClient.sendMessage(params);
|
||||
return ok(JSON.stringify(msg, null, 2));
|
||||
},
|
||||
},
|
||||
|
||||
@ -97,13 +97,9 @@ export class TrackerClient {
|
||||
|
||||
// --- Messages (unified: chat + task comments) ---
|
||||
|
||||
async sendMessage(payload: { chat_id?: string; task_id?: string; content: string; mentions?: string[] }, agentSlug?: string): Promise<Record<string, unknown>> {
|
||||
async sendMessage(payload: { chat_id?: string; task_id?: string; content: string; mentions?: string[] }): Promise<Record<string, unknown>> {
|
||||
this.log.info({ chatId: payload.chat_id, taskId: payload.task_id, contentLength: payload.content.length }, 'Sending message');
|
||||
return this.request('POST', '/api/v1/messages', {
|
||||
...payload,
|
||||
author_type: 'agent',
|
||||
author_slug: agentSlug || 'agent',
|
||||
});
|
||||
return this.request('POST', '/api/v1/messages', payload);
|
||||
}
|
||||
|
||||
async listMessages(params: Record<string, string>): Promise<Record<string, unknown>[]> {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user