Skip to content

matchAgent

matchAgent(s, agents): HerdrAgent | null

Defined in: src/herdr.ts:108

Resolve a session to its live herdr agent by a STABLE key. terminalId is the fast path but is volatile across a herdr daemon restart, so on a miss we fall back to the immutable worktree cwd. A cwd shared by 2+ agents (non-isolated same-repo sessions) is disambiguated by agent name; still ambiguous → no match (never risk mis-pairing).

string

string

string

HerdrAgent[]

HerdrAgent | null