feat(FN-940): allow terminated agents to restart as active or running

- Remove blanket block on terminated→any state transitions in agent-store
- Add active and running as valid transitions from terminated state in types
- Update tests to verify terminated→active and terminated→running succeed
- Add tests for invalid terminated transitions (idle, paused) still throwing
This commit is contained in:
gsxdsm
2026-04-04 17:40:31 -07:00
parent 9a8d68fce8
commit e5497db55a
3 changed files with 24 additions and 10 deletions

View File

@@ -244,10 +244,6 @@ export class AgentStore extends EventEmitter {
return agent; // No change needed
}
if (currentState === "terminated") {
throw new Error(`Cannot transition from terminated state to ${newState}`);
}
const validTransitions = AGENT_VALID_TRANSITIONS[currentState];
if (!validTransitions.includes(newState)) {
throw new Error(