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).
Parameters
Section titled “Parameters”herdrAgentId
Section titled “herdrAgentId”string
string
worktreePath
Section titled “worktreePath”string
agents
Section titled “agents”Returns
Section titled “Returns”HerdrAgent | null