feat(v0.5): launch agent inside project subdirectory via launch_dir

LaunchOpts gains LaunchDir. session.Run resolves it via
workspace.ResolveLaunch, prints any fallback warning, and passes the
absolute path as the child process's working directory. Security
violations (absolute paths, .. escape) abort the session. The banner
gains a 'project dir: <name>/' line when launch_dir is set.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-22 19:49:29 -04:00
parent 509a6d64ea
commit 103f2cd33e
6 changed files with 68 additions and 20 deletions
+8 -7
View File
@@ -45,12 +45,13 @@ func runOpen(cmd *cobra.Command, args []string) error {
envVars := config.EnvVars(ws.Meta.Slug, ws.Meta.Mode, ws.Root, ws.Path, ws.Meta.Category, workspace.EffectiveType(ws.Meta), ws.Meta.LaunchDir)
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
Force: openForce,
WsDir: ws.Path,
EnvVars: envVars,
Agent: ws.Meta.Agent,
Mode: ws.Meta.Mode,
Slug: ws.Meta.Slug,
Shell: true, // open always launches shell
LaunchDir: ws.Meta.LaunchDir,
Force: openForce,
})
}