@@ -211,119 +211,118 @@ async fn dispatch_client_method<
211211
212212 Span :: current ( ) . record ( "session_id" , parsed. session_id . as_str ( ) ) ;
213213
214- let response_bytes: Option < Result < Vec < u8 > , Box < dyn std:: error:: Error + Send + Sync > > > = match parsed. method {
215- ClientMethod :: FsReadTextFile => {
216- fs_read_text_file:: handle (
217- & payload,
218- ctx. client ,
219- reply. as_deref ( ) ,
220- ctx. nats ,
221- parsed. session_id . as_str ( ) ,
222- ctx. serializer ,
223- )
224- . await ;
225- None
226- }
227- ClientMethod :: FsWriteTextFile => {
228- fs_write_text_file:: handle (
229- & payload,
230- ctx. client ,
231- reply. as_deref ( ) ,
232- ctx. nats ,
233- parsed. session_id . as_str ( ) ,
234- ctx. serializer ,
235- )
236- . await ;
237- None
238- }
239- ClientMethod :: SessionRequestPermission => {
240- request_permission:: handle (
241- & payload,
242- ctx. client ,
243- reply. as_deref ( ) ,
244- ctx. nats ,
245- parsed. session_id . as_str ( ) ,
246- ctx. serializer ,
247- )
248- . await ;
249- None
250- }
251- ClientMethod :: SessionUpdate => {
252- if reply. is_some ( ) {
253- warn ! (
254- session_id = %parsed. session_id,
255- method = ?parsed. method,
256- "Unexpected reply subject on notification request"
257- ) ;
214+ let response_bytes: Option < Result < Vec < u8 > , Box < dyn std:: error:: Error + Send + Sync > > > =
215+ match parsed. method {
216+ ClientMethod :: FsReadTextFile => {
217+ fs_read_text_file:: handle (
218+ & payload,
219+ ctx. client ,
220+ reply. as_deref ( ) ,
221+ ctx. nats ,
222+ parsed. session_id . as_str ( ) ,
223+ ctx. serializer ,
224+ )
225+ . await ;
226+ None
258227 }
259- session_update:: handle ( & payload, ctx. client ) . await ;
260- None
261- }
262- ClientMethod :: ExtSessionPromptResponse => {
263- ext_session_prompt_response:: handle (
264- parsed. session_id . as_str ( ) ,
265- & payload,
266- reply. as_deref ( ) ,
267- ctx. bridge ,
268- )
269- . await ;
270- None
271- }
272- ClientMethod :: TerminalCreate => {
273- terminal_create:: handle (
274- & payload,
275- ctx. client ,
276- reply. as_deref ( ) ,
277- ctx. nats ,
278- parsed. session_id . as_str ( ) ,
279- ctx. serializer ,
280- )
281- . await ;
282- None
283- }
284- ClientMethod :: TerminalKill => {
285- terminal_kill:: handle (
286- & payload,
287- ctx. client ,
288- reply. as_deref ( ) ,
289- ctx. nats ,
290- parsed. session_id . as_str ( ) ,
291- ctx. serializer ,
292- )
293- . await ;
294- None
295- }
296- ClientMethod :: TerminalOutput => {
297- Some (
228+ ClientMethod :: FsWriteTextFile => {
229+ fs_write_text_file:: handle (
230+ & payload,
231+ ctx. client ,
232+ reply. as_deref ( ) ,
233+ ctx. nats ,
234+ parsed. session_id . as_str ( ) ,
235+ ctx. serializer ,
236+ )
237+ . await ;
238+ None
239+ }
240+ ClientMethod :: SessionRequestPermission => {
241+ request_permission:: handle (
242+ & payload,
243+ ctx. client ,
244+ reply. as_deref ( ) ,
245+ ctx. nats ,
246+ parsed. session_id . as_str ( ) ,
247+ ctx. serializer ,
248+ )
249+ . await ;
250+ None
251+ }
252+ ClientMethod :: SessionUpdate => {
253+ if reply. is_some ( ) {
254+ warn ! (
255+ session_id = %parsed. session_id,
256+ method = ?parsed. method,
257+ "Unexpected reply subject on notification request"
258+ ) ;
259+ }
260+ session_update:: handle ( & payload, ctx. client ) . await ;
261+ None
262+ }
263+ ClientMethod :: ExtSessionPromptResponse => {
264+ ext_session_prompt_response:: handle (
265+ parsed. session_id . as_str ( ) ,
266+ & payload,
267+ reply. as_deref ( ) ,
268+ ctx. bridge ,
269+ )
270+ . await ;
271+ None
272+ }
273+ ClientMethod :: TerminalCreate => {
274+ terminal_create:: handle (
275+ & payload,
276+ ctx. client ,
277+ reply. as_deref ( ) ,
278+ ctx. nats ,
279+ parsed. session_id . as_str ( ) ,
280+ ctx. serializer ,
281+ )
282+ . await ;
283+ None
284+ }
285+ ClientMethod :: TerminalKill => {
286+ terminal_kill:: handle (
287+ & payload,
288+ ctx. client ,
289+ reply. as_deref ( ) ,
290+ ctx. nats ,
291+ parsed. session_id . as_str ( ) ,
292+ ctx. serializer ,
293+ )
294+ . await ;
295+ None
296+ }
297+ ClientMethod :: TerminalOutput => Some (
298298 terminal_output:: handle ( & payload, ctx. client , parsed. session_id . as_str ( ) ) . await ,
299- )
300- }
301- ClientMethod :: TerminalRelease => {
302- terminal_release:: handle (
303- & payload,
304- ctx. client ,
305- reply. as_deref ( ) ,
306- ctx. nats ,
307- parsed. session_id . as_str ( ) ,
308- ctx. serializer ,
309- )
310- . await ;
311- None
312- }
313- ClientMethod :: TerminalWaitForExit => {
314- terminal_wait_for_exit:: handle (
315- & payload,
316- ctx. client ,
317- reply. as_deref ( ) ,
318- ctx. nats ,
319- parsed. session_id . as_str ( ) ,
320- ctx. bridge . config . operation_timeout ( ) ,
321- ctx. serializer ,
322- )
323- . await ;
324- None
325- }
326- } ;
299+ ) ,
300+ ClientMethod :: TerminalRelease => {
301+ terminal_release:: handle (
302+ & payload,
303+ ctx. client ,
304+ reply. as_deref ( ) ,
305+ ctx. nats ,
306+ parsed. session_id . as_str ( ) ,
307+ ctx. serializer ,
308+ )
309+ . await ;
310+ None
311+ }
312+ ClientMethod :: TerminalWaitForExit => {
313+ terminal_wait_for_exit:: handle (
314+ & payload,
315+ ctx. client ,
316+ reply. as_deref ( ) ,
317+ ctx. nats ,
318+ parsed. session_id . as_str ( ) ,
319+ ctx. bridge . config . operation_timeout ( ) ,
320+ ctx. serializer ,
321+ )
322+ . await ;
323+ None
324+ }
325+ } ;
327326
328327 if let ( Some ( reply_to) , Some ( result) ) = ( reply, response_bytes) {
329328 match result {
0 commit comments