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:
+8
-7
@@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user