feat: session lifecycle wrapper with manifest capture and session logging

Refactor new/resume/open to use session.Run() which wraps child process launch with pre/post manifest capture and append-only session logging to logs/sessions.log. Bump version to 0.2.0.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-06 09:56:21 -04:00
parent 57f345ae2b
commit 10ab9efc80
7 changed files with 435 additions and 32 deletions
+9 -3
View File
@@ -7,7 +7,7 @@ import (
"github.com/spf13/cobra"
"github.com/warrenronsiek/ctask/internal/config"
"github.com/warrenronsiek/ctask/internal/shell"
"github.com/warrenronsiek/ctask/internal/session"
"github.com/warrenronsiek/ctask/internal/workspace"
)
@@ -40,6 +40,12 @@ func runOpen(cmd *cobra.Command, args []string) error {
envVars := config.EnvVars(ws.Meta.Slug, ws.Meta.Mode, root, ws.Path, ws.Meta.Category)
// Spawn interactive subshell (not agent, not cd in parent)
return shell.ExecShell(ws.Path, envVars, ws.Meta.Slug, ws.Meta.Mode)
return session.Run(session.LaunchOpts{
WsDir: ws.Path,
EnvVars: envVars,
Agent: ws.Meta.Agent,
Mode: ws.Meta.Mode,
Slug: ws.Meta.Slug,
Shell: true, // open always launches shell
})
}