From 1743bce7135ac71e89153458c50dde222c5025c5 Mon Sep 17 00:00:00 2001 From: hirenko-v Date: Sun, 29 Sep 2024 01:46:41 +0300 Subject: [PATCH] test --- cmd/job/main.go | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/cmd/job/main.go b/cmd/job/main.go index 4cb804e..eb1bed1 100644 --- a/cmd/job/main.go +++ b/cmd/job/main.go @@ -117,20 +117,23 @@ func (e *MsgExecutor) Execute(ctx context.Context, in executor.ExecuteInput) (ex // Parse the action and value from the command action, value := parseCommand(in.Command) - // sessionID, ok := ctx.Value("sessionID").(string) - // if ok { - // // Initialize session state if not already present - // if _, ok := e.state[sessionID]; !ok { - // e.state[sessionID] = make(map[string]string) - // } - // } + sessionID, ok := ctx.Value("sessionID").(string) + if ok { + return executor.ExecuteOutput{ + Message: api.NewCodeBlockMessage(fmt.Sprintf("Session ID is %s", sessionID), true), + }, nil + // Initialize session state if not already present + // if _, ok := e.state[sessionID]; !ok { + // e.state[sessionID] = make(map[string]string) + // } + } - sessionID := "default_session" // Replace with an actual identifier if available + // sessionID := "default_session" // Replace with an actual identifier if available // Initialize session state if not already present - if _, ok := e.state[sessionID]; !ok { - e.state[sessionID] = make(map[string]string) - } + // if _, ok := e.state[sessionID]; !ok { + // e.state[sessionID] = make(map[string]string) + // } switch action { case "select_first": if e.state[sessionID]["first"] != value {