request method
The open state the work asks for when it moves from from to to, or
null when it asks for nothing.
This ignores the reader; AgentDisclosureController applies respectReaderToggle.
Implementation
bool? request(AgentWorkPhase from, AgentWorkPhase to) {
if (from == to) return null;
return switch (to) {
AgentWorkPhase.working => openWhileWorking ? true : null,
AgentWorkPhase.waiting => null,
AgentWorkPhase.settled => collapseWhenSettled ? false : null,
AgentWorkPhase.failed =>
!keepOpenOnFailure && collapseWhenSettled ? false : null,
};
}