Skip to content

refactor: replace SessionManager.Create positional args with opts struct #375

Description

@d0ugal

Summary

SessionManager.Create() currently takes 14 positional string/bool parameters, making it error-prone and requiring every caller to be updated when a new option is added (as seen in #367 / #374).

Proposal

Replace the positional parameters with a CreateOpts struct:

type CreateOpts struct {
    Name            string
    AgentName       string
    RepoPath        string
    BaseBranch      string
    Prompt          string
    Model           string
    ParentID        string
    NoRepo          bool
    ShareWorktree   string
    AgentHooks      bool
    InPlace         bool
    AllowConcurrent bool
    Rows            uint16
    Cols            uint16
}

Benefits:

  • Self-documenting at call sites
  • New options use zero-value defaults — existing callers don't break
  • Harder to swap two adjacent string or bool params by accident

Metadata

Metadata

Assignees

No one assigned

    Labels

    daemonDaemon internals and protocolenhancementNew feature or requestsize: MNew command/subsystem across several files + state

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions