agent: add Core.Close() to manage session tmpdir lifecycle
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
c03f9386c1
commit
8b3b6bd281
|
|
@ -300,6 +300,13 @@ func NewAgentCore(cfg AgentCoreConfig) Core {
|
|||
}
|
||||
}
|
||||
|
||||
// Close releases resources for this session, including its tmpdir.
|
||||
func (s *agentCore) Close() {
|
||||
if s.sessionID != "" {
|
||||
os.RemoveAll("/tmp/ollie/" + s.sessionID) //nolint:errcheck
|
||||
}
|
||||
}
|
||||
|
||||
func (s *agentCore) prompt() string {
|
||||
return fmt.Sprintf("[%s :: %s] ", s.loopcfg.Backend.Name(), s.agentName)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,6 +93,10 @@ type Core interface {
|
|||
|
||||
// SystemPrompt returns the fully rendered system prompt for this session.
|
||||
SystemPrompt() string
|
||||
|
||||
// Close releases resources associated with the session, including its
|
||||
// temporary directory under /tmp/ollie/.
|
||||
Close()
|
||||
}
|
||||
|
||||
// PromptFIFO is a simple thread-safe FIFO for queued prompts.
|
||||
|
|
|
|||
Reference in New Issue