buildSessionOpts returns the canonical set of session options derived from CLI flags and agent configuration. Both the initial session and spawned sessions use this method so their options never drift apart.
(agt *agent.Agent, req runtime.CreateSessionRequest)
| 1024 | // CLI flags and agent configuration. Both the initial session and spawned |
| 1025 | // sessions use this method so their options never drift apart. |
| 1026 | func (f *runExecFlags) buildSessionOpts(agt *agent.Agent, req runtime.CreateSessionRequest) []session.Opt { |
| 1027 | return []session.Opt{ |
| 1028 | session.WithMaxIterations(agt.MaxIterations()), |
| 1029 | session.WithMaxConsecutiveToolCalls(agt.MaxConsecutiveToolCalls()), |
| 1030 | session.WithMaxOldToolCallTokens(agt.MaxOldToolCallTokens()), |
| 1031 | session.WithToolsApproved(req.ToolsApproved), |
| 1032 | session.WithHideToolResults(req.HideToolResults), |
| 1033 | session.WithWorkingDir(req.WorkingDir), |
| 1034 | } |
| 1035 | } |
| 1036 | |
| 1037 | // createSessionSpawner creates a function that can spawn new sessions with different working directories. |
| 1038 | func (f *runExecFlags) createSessionSpawner(agentSource config.Source, sessStore session.Store) tui.SessionSpawner { |
no test coverage detected