77 "time"
88
99 "github.com/github/gh-models/pkg/prompt"
10- "github.com/github/gh-models/pkg/util"
1110)
1211
1312// createContext creates a new PromptPexContext from a prompt file
@@ -29,11 +28,11 @@ func (h *generateCommandHandler) CreateContextFromPrompt() (*PromptPexContext, e
2928 runID := fmt .Sprintf ("run_%d" , time .Now ().Unix ())
3029 context := & PromptPexContext {
3130 // Unique identifier for the run
32- RunID : util . Ptr ( runID ) ,
31+ RunID : runID ,
3332 // The prompt content and metadata
3433 Prompt : prompt ,
3534 // Hash of the prompt messages, model, and parameters
36- PromptHash : util . Ptr ( promptHash ) ,
35+ PromptHash : promptHash ,
3736 // The options used to generate the prompt
3837 Options : h .options ,
3938 }
@@ -51,8 +50,7 @@ func (h *generateCommandHandler) CreateContextFromPrompt() (*PromptPexContext, e
5150 } else {
5251 sessionInfo = fmt .Sprintf ("reloading session file at %s" , * h .sessionFile )
5352 // Check if prompt hashes match
54- if existingContext .PromptHash != nil && context .PromptHash != nil &&
55- * existingContext .PromptHash != * context .PromptHash {
53+ if existingContext .PromptHash != context .PromptHash {
5654 return nil , fmt .Errorf ("prompt changed unable to reuse session file" )
5755 }
5856
0 commit comments