Agents: Fix compile error and allow agents to store id code