@@ -255,15 +255,15 @@ func NewServer(ctx context.Context, config ServerConfig) (*Server, error) {
255255 }
256256
257257 conversation := st .NewPTY (ctx , st.PTYConversationConfig {
258- AgentType : config .AgentType ,
259- AgentIO : config .Process ,
260- Clock : config .Clock ,
261- SnapshotInterval : snapshotInterval ,
262- ScreenStabilityLength : 2 * time .Second ,
263- FormatMessage : formatMessage ,
264- ReadyForInitialPrompt : isAgentReadyForInitialPrompt ,
265- FormatToolCall : formatToolCall ,
266- InitialPrompt : initialPrompt ,
258+ AgentType : config .AgentType ,
259+ AgentIO : config .Process ,
260+ Clock : config .Clock ,
261+ SnapshotInterval : snapshotInterval ,
262+ ScreenStabilityLength : 2 * time .Second ,
263+ FormatMessage : formatMessage ,
264+ ReadyForInitialPrompt : isAgentReadyForInitialPrompt ,
265+ FormatToolCall : formatToolCall ,
266+ InitialPrompt : initialPrompt ,
267267 Logger : logger ,
268268 StatePersistenceConfig : config .StatePersistenceConfig ,
269269 }, emitter )
@@ -591,8 +591,7 @@ func (s *Server) Start() error {
591591 return s .srv .ListenAndServe ()
592592}
593593
594- // Stop gracefully stops the HTTP server. It is safe to call multiple times;
595- // only the first call will perform the shutdown, subsequent calls are no-ops.
594+ // Stop gracefully stops the HTTP server. It is safe to call multiple times.
596595func (s * Server ) Stop (ctx context.Context ) error {
597596 var err error
598597 s .stopOnce .Do (func () {
@@ -615,8 +614,6 @@ func (s *Server) cleanupTempDir() {
615614 }
616615}
617616
618- // SaveState saves the conversation state if configured. This can be called from signal handlers.
619- // The source parameter indicates what triggered the save (e.g., "SIGTERM", "SIGUSR1").
620617func (s * Server ) SaveState (source string ) error {
621618 if err := s .conversation .SaveState (); err != nil {
622619 s .logger .Error ("Failed to save conversation state" , "source" , source , "error" , err )
0 commit comments