sessions: require workdir on new session creation
No sensible default exists server-side. Clients must pass workdir=<path> explicitly. The TUI uses $PWD of the ollie process; shell users should pass workdir=$PWD or use a wrapper. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
088c43e4aa
commit
db7a1aa42d
|
|
@ -793,8 +793,8 @@ func (s *Server) handleRootCtl(input string) {
|
|||
}
|
||||
|
||||
// createSession parses key=value options and starts a new agent session.
|
||||
// Recognised keys: backend, model, agent, workdir. Unknown keys are rejected.
|
||||
// Example: new backend=ollama model=qwen3:8b agent=myagent workdir=/home/lkn/src/myproject
|
||||
// Recognised keys: backend, model, agent, workdir. workdir is required.
|
||||
// Example: new workdir=/home/lkn/src/myproject backend=ollama model=qwen3:8b agent=myagent
|
||||
func (s *Server) createSession(args []string) error {
|
||||
backendOverride := ""
|
||||
modelOverride := ""
|
||||
|
|
@ -820,6 +820,10 @@ func (s *Server) createSession(args []string) error {
|
|||
}
|
||||
}
|
||||
|
||||
if workdir == "" {
|
||||
return fmt.Errorf("workdir is required (e.g. new workdir=/path/to/project)")
|
||||
}
|
||||
|
||||
var (
|
||||
be backend.Backend
|
||||
err error
|
||||
|
|
|
|||
Reference in New Issue