session: store remote target, expose in cfg read
The remote= field is now visible when reading s/{id}/cfg,
and stored on the Session struct for future persistence.
This commit is contained in:
parent
4f8e0c2768
commit
fce23afd28
|
|
@ -38,6 +38,7 @@ type Session struct {
|
|||
plan []byte
|
||||
prevPrompt []byte // last submitted prompt; overwritten on each new submission
|
||||
peers map[string]bool // peer session IDs (bidirectional links)
|
||||
remote string // SSH target for remote execution (empty = local)
|
||||
|
||||
// Cached model list (expensive API call; refreshed every 24h).
|
||||
modelsMu sync.Mutex
|
||||
|
|
@ -1043,6 +1044,7 @@ func (s *Manager) CreateSession(args []string) (string, error) {
|
|||
ctx, cancel := context.WithCancel(context.Background())
|
||||
sess := NewSession(sessID, core, ctx, cancel)
|
||||
sessPtr = sess
|
||||
sess.remote = remoteTarget
|
||||
|
||||
s.mu.Lock()
|
||||
sess.uname = uname
|
||||
|
|
|
|||
|
|
@ -272,6 +272,7 @@ func (h *sessionHelper) cfgContent() string {
|
|||
fmt.Fprintf(&sb, "model=%s\n", h.sess.Core.ModelName())
|
||||
fmt.Fprintf(&sb, "agent=%s\n", h.sess.Core.AgentName())
|
||||
fmt.Fprintf(&sb, "cwd=%s\n", h.sess.Core.CWD())
|
||||
fmt.Fprintf(&sb, "remote=%s\n", h.sess.remote)
|
||||
fmt.Fprintf(&sb, "maxTokens=%d\n", p.MaxTokens)
|
||||
fmt.Fprintf(&sb, "maxCompletionTokens=%d\n", p.MaxCompletionTokens)
|
||||
if p.Temperature != nil {
|
||||
|
|
|
|||
Reference in New Issue