The agent version history feature was broken. When you click “Version History” on an internal agent, it always shows empty history even after multiple edits.
Root Cause: AgentModel.update() is called on every agent update via the PUT /api/agents/:id route, but this method never increments promptVersion or appends to promptHistory. The updateWithVersion() method existed for this purpose but was never wired into the update route.
As a result, agent.promptHistory always remains [] (the default), making the version history dialog permanently empty.
Integrate version tracking directly into AgentModel.update() for internal agents (agentType='agent'). Before applying each update, the current agent state is saved as a history entry and promptVersion is incremented. This:
updateWithVersion() alone didn’t coverThe change is minimal and scoped only to internal agents — profile, mcp_gateway, and llm_proxy agents are unaffected.
Fixes #2579
/claim #2579
Kyle Tse
@shtse8
Archestra
@archestra-ai