@@ -33,14 +33,6 @@ local WINDOW_MARGIN = 3 -- Additional margin for window borders and spacing
33
33
local UI_ELEMENTS_HEIGHT = 2 -- Reserve space for statusline and tabline
34
34
local SAFETY_MARGIN = 2 -- Extra margin to prevent "Not enough room" errors
35
35
36
- --- @param sidebar eca.Sidebar
37
- --- @return fun ( message : table )
38
- local function make_handler (sidebar )
39
- return function (message )
40
- sidebar :handle_chat_content (message )
41
- end
42
- end
43
-
44
36
--- @param id integer Tab ID
45
37
--- @return eca.Sidebar
46
38
function M .new (id )
@@ -64,7 +56,9 @@ function M.new(id)
64
56
instance ._response_start_time = 0
65
57
instance ._max_response_length = 50000 -- 50KB max response
66
58
67
- require (" eca.observer" ).subscribe (id , make_handler (instance ))
59
+ require (" eca.observer" ).subscribe (id , function (message )
60
+ instance :handle_chat_content (message )
61
+ end )
68
62
return instance
69
63
end
70
64
@@ -1170,7 +1164,7 @@ function M:_send_message(message)
1170
1164
-- Include active contexts in the message
1171
1165
local contexts = self :get_contexts ()
1172
1166
eca .server :send_request (" chat/prompt" , {
1173
- chatId = nil ,
1167
+ chatId = self . id ,
1174
1168
requestId = tostring (os.time ()),
1175
1169
message = message ,
1176
1170
contexts = contexts or {},
0 commit comments