Skip to content

Commit 0132218

Browse files
sprklaiclaude
andcommitted
fix: rustfmt and websocket test assertions for CI
Fix rustfmt line-length violations in channel_tool.rs and update websocket.test.ts to match 2-arg onError signature (error, hint). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b50e14a commit 0132218

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

crates/zenii-core/src/tools/channel_tool.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,19 @@ impl Tool for ChannelSendTool {
150150
match self.registry.send(channel, msg.clone()).await {
151151
Ok(()) => {
152152
// Persist outgoing message in channel session + notify frontend
153-
let recipient_id = msg.metadata.get(recipient_metadata_key(channel)).cloned();
153+
let recipient_id =
154+
msg.metadata.get(recipient_metadata_key(channel)).cloned();
154155
if let Some(ref rid) = recipient_id {
155156
let channel_key = format!("{channel}:{rid}");
156-
if let Ok(sid) = self.session_map.resolve_session(&channel_key, channel).await {
157-
let _ = self.session_manager.append_message(&sid, "assistant", message).await;
157+
if let Ok(sid) = self
158+
.session_map
159+
.resolve_session(&channel_key, channel)
160+
.await
161+
{
162+
let _ = self
163+
.session_manager
164+
.append_message(&sid, "assistant", message)
165+
.await;
158166
let _ = self.event_bus.publish(AppEvent::ChannelMessageReceived {
159167
channel: channel.to_string(),
160168
sender: "agent".to_string(),

web/src/lib/api/websocket.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ describe("WebSocket chat streaming", () => {
105105
const ws = MockWebSocket.instances[0];
106106
ws.onmessage!({ data: JSON.stringify({ type: "error", error: "fail" }) });
107107

108-
expect(callbacks.onError).toHaveBeenCalledWith("fail");
108+
expect(callbacks.onError).toHaveBeenCalledWith("fail", undefined);
109109
expect(ws.closed).toBe(true);
110110
});
111111

@@ -117,6 +117,7 @@ describe("WebSocket chat streaming", () => {
117117

118118
expect(callbacks.onError).toHaveBeenCalledWith(
119119
"Failed to parse WebSocket message",
120+
undefined,
120121
);
121122
});
122123

0 commit comments

Comments
 (0)