Make external session detection limits configurable (#34449)

## What changed

- Add `maxSessionAgeDays` and `maxSessions` to the external-agent config detection request.
- Apply the requested limits when discovering sessions from supported migration sources.
- Preserve the existing defaults of a 30-day maximum age and 50 sessions when either option is omitted.

GitOrigin-RevId: 46376e94b64f1f61d8776e34d82cdd2cdeb36ca0
This commit is contained in:
charlesgong-openai
2026-07-21 02:55:11 +00:00
committed by copyberry
parent 9078e32371
commit 3bc49e1721
18 changed files with 195 additions and 25 deletions
@@ -699,6 +699,12 @@ pub struct ExternalAgentConfigDetectParams {
/// Zero or more working directories to include for repo-scoped detection.
#[ts(optional = nullable)]
pub cwds: Option<Vec<PathBuf>>,
/// Maximum age in days for detected sessions. Missing values use the default limit.
#[ts(optional = nullable)]
pub max_session_age_days: Option<u32>,
/// Maximum number of sessions to detect. Missing values use the default limit.
#[ts(optional = nullable)]
pub max_sessions: Option<u32>,
/// Deprecated field retained for compatibility. This field is ignored; use `migrationSource`
/// to select the migration source.
#[ts(optional = nullable)]