mirror of
https://github.com/Twigpine/zero.git
synced 2026-11-09 18:08:31 -10:00
* feat(tui): add isolated btw conversations Add /btw with inline-question support, isolated non-resumable session forks, background main-run routing, and safe return behavior. Refs #637 * test(tui): cover btw return controls Preserve drafts when Ctrl+C is pressed during an active BTW run and cover returning to the parent through the documented /btw toggle. * Address BTW isolation review feedback * Reject explicit resumes of side sessions * Harden BTW isolation lifecycle
27 lines
888 B
Go
27 lines
888 B
Go
package cli
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/Gitlawb/zero/internal/sessions"
|
|
)
|
|
|
|
func TestPreflightRejectsSideSessions(t *testing.T) {
|
|
t.Setenv("XDG_DATA_HOME", t.TempDir())
|
|
store := sessions.NewStore(sessions.StoreOptions{})
|
|
if _, err := store.Create(sessions.CreateInput{SessionID: "side", SessionKind: sessions.SessionKindSide}); err != nil {
|
|
t.Fatalf("create side session: %v", err)
|
|
}
|
|
|
|
err := preflightExecSession(execOptions{resumeLatest: true})
|
|
if err == nil || !strings.Contains(err.Error(), "No Zero sessions available to resume") {
|
|
t.Fatalf("preflightExecSession error = %v, want no resumable sessions", err)
|
|
}
|
|
|
|
err = preflightExecSession(execOptions{resume: "side"})
|
|
if err == nil || !strings.Contains(err.Error(), "Zero session is not resumable: side") {
|
|
t.Fatalf("explicit side-session preflight error = %v, want non-resumable rejection", err)
|
|
}
|
|
}
|