agentrepr state tests and fixes