Skip to content

Commit be544fa

Browse files
ericdalloeca-agent
andcommitted
Support trust toggle via chat/update for immediate effect
Wire chat/update through the bridge so trust changes reach the ECA server immediately and apply to the next tool call without a new prompt. 🤖 Generated with [eca](https://eca.dev) Co-Authored-By: eca-agent <git@eca.dev>
1 parent adc74bc commit be544fa

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

src/bridge/api.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,14 @@ export class EcaRemoteApi {
222222
});
223223
}
224224

225+
/** Update chat metadata (title, trust). */
226+
async updateChat(chatId: string, params: { title?: string; trust?: boolean }): Promise<void> {
227+
return this.request(`/chats/${chatId}/update`, {
228+
method: 'POST',
229+
body: params,
230+
});
231+
}
232+
225233
// ---------------------------------------------------------------------------
226234
// Trust
227235
// ---------------------------------------------------------------------------

src/bridge/outbound-handler.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,15 @@ export async function handleOutbound(
150150
dispatch('chat/queryFiles', { chatId: data.chatId, files: [] });
151151
break;
152152

153+
// --- Chat update ---
154+
case 'chat/update': {
155+
const { chatId, ...params } = data as { chatId: string; title?: string; trust?: boolean };
156+
if (chatId) {
157+
await api.updateChat(chatId, params);
158+
}
159+
break;
160+
}
161+
153162
// --- Trust mode ---
154163
case 'server/setTrust':
155164
await api.setTrust(data);

0 commit comments

Comments
 (0)