Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
hirenko-v committed Sep 28, 2024
1 parent 88ec317 commit 1743bce
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions cmd/job/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 1743bce

Please sign in to comment.