session: use agent config backend/model as defaults; fix stubCore for ToolCallCount
This commit is contained in:
parent
c075964a1f
commit
5ec6ac6fe8
|
|
@ -365,6 +365,17 @@ func (s *SessionStore) createSession(args []string) error {
|
|||
return err
|
||||
}
|
||||
} else {
|
||||
cfg := LoadAgentConfig(s.cfg.AgentsDir, agentName, nil)
|
||||
if cfg != nil {
|
||||
allowTools = cfg.AllowTools
|
||||
if backendOverride == "" && cfg.Backend != "" {
|
||||
backendOverride = cfg.Backend
|
||||
}
|
||||
if modelOverride == "" && cfg.Model != "" {
|
||||
modelOverride = cfg.Model
|
||||
}
|
||||
}
|
||||
|
||||
be, err := backend.NewWithName(backendOverride)
|
||||
if err != nil {
|
||||
return fmt.Errorf("backend: %w", err)
|
||||
|
|
@ -381,11 +392,6 @@ func (s *SessionStore) createSession(args []string) error {
|
|||
return fmt.Errorf("sessions dir: %w", err)
|
||||
}
|
||||
|
||||
cfg := LoadAgentConfig(s.cfg.AgentsDir, agentName, nil)
|
||||
if cfg != nil {
|
||||
allowTools = cfg.AllowTools
|
||||
}
|
||||
|
||||
var execOpts []execute.Option
|
||||
if s.cfg.Strict {
|
||||
execOpts = append(execOpts, execute.WithStrict())
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ func (c *stubCore) WaitChange(ctx context.Context, _, _ string) (string, bool) {
|
|||
return "", false
|
||||
}
|
||||
func (c *stubCore) Close() { c.closed = true }
|
||||
func (c *stubCore) ToolCallCount() int64 { return 0 }
|
||||
|
||||
// publishCore wraps stubCore and emits a realistic event sequence on Submit.
|
||||
type publishCore struct {
|
||||
|
|
|
|||
Reference in New Issue