Release native chat runtimes on lifecycle changes
Ensure /new and chat close stop native foreground and background work before changing registry state. Preserve transcripts while surfacing release and recovery cleanup failures instead of reporting false success, with focused adapter and server regressions.
This commit is contained in:
@@ -550,6 +550,18 @@ func (c *Chat) Interrupt(ctx context.Context, id string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// ReleaseSession stops an active Codex turn while preserving the thread and
|
||||
// its transcript. Codex has no separate per-thread process to reap.
|
||||
func (c *Chat) ReleaseSession(ctx context.Context, id string) error {
|
||||
c.mu.Lock()
|
||||
turn := c.turns[id]
|
||||
c.mu.Unlock()
|
||||
if turn == "" {
|
||||
return nil
|
||||
}
|
||||
return c.Interrupt(ctx, id)
|
||||
}
|
||||
|
||||
// Create starts one Codex thread in directory.
|
||||
func (c *Chat) Create(ctx context.Context, title, directory string) (protocol.ChatSession, error) {
|
||||
if strings.TrimSpace(directory) == "" {
|
||||
|
||||
Reference in New Issue
Block a user