fix: remove author_slug from sendMessage, clean client

This commit is contained in:
Markov 2026-02-25 11:10:49 +01:00
parent e4e604b049
commit ccdf1f21de
2 changed files with 3 additions and 7 deletions

View File

@ -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.', description: 'Send a message to a chat or add a comment to a task. Specify either chat_id or task_id.',
parameters: SendMessageParams, parameters: SendMessageParams,
async execute(_id: string, params: any) { 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)); return ok(JSON.stringify(msg, null, 2));
}, },
}, },

View File

@ -97,13 +97,9 @@ export class TrackerClient {
// --- Messages (unified: chat + task comments) --- // --- 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'); this.log.info({ chatId: payload.chat_id, taskId: payload.task_id, contentLength: payload.content.length }, 'Sending message');
return this.request('POST', '/api/v1/messages', { return this.request('POST', '/api/v1/messages', payload);
...payload,
author_type: 'agent',
author_slug: agentSlug || 'agent',
});
} }
async listMessages(params: Record<string, string>): Promise<Record<string, unknown>[]> { async listMessages(params: Record<string, string>): Promise<Record<string, unknown>[]> {