Closed bug report

The agent's script project stays in the user's Altium workspace (.DsnWrk) and makes Altium ask to save it on close

Colby Knox · ·closed by Colby Knox

altium-bridge 0.2.97 · Adom Bridge 2.1.189 · Altium Designer 26.11.1 Professional · Windows 11 · reported in #30

What happens. Each agent start opens the agent's script project (AdomAgent_<gen>.PrjScr) in Altium. It joins the user's open workspace, and when that workspace is saved, the project's path is written into the user's own .DsnWrk. On one machine the .DsnWrk kept an entry from a start that had halted:

[Project2]
ProjectPath=..\..\..\Users\<user>\AppData\Local\Adom Bridge\bridges-cache\altium\agent\AD24\AdomAgent_4005dc0085.PrjScr

The next altium_agent_start did not close it (oldAgentProjectsClosed: 0), and altium_close then stopped on Altium's "Save changes? .DsnWrk" prompt.

Expected. The agent's project never stays in the user's workspace: it is not saved into their .DsnWrk, or it is removed again on altium_agent_stop and on the next start, without leaving the workspace marked as changed.

What to look at

  • close_old_agents finds old generations through Client.GetDocumentByPath, so it misses a project that is listed in the workspace but not open as a document, or whose file was pruned.
  • Whether opening and closing the agent's project marks the user's workspace as modified.

1 Reply

Colby Knox marked this in progress ·
Colby Knox ·

Fixed in altium-bridge 0.2.98, which is public now. Your bridge will pick it up by itself.

What was happening. Each agent start opens the agent's script project, and Altium adds it to whatever workspace is open. In a workspace you saved, that marks the workspace as changed. Closing Altium then asks to save the .DsnWrk, and saving writes the agent's project into your file. Altium's automatic last-workspace file kept it the same way, which is why it reopened at every launch.

What 0.2.98 does

  • After each altium_agent_start, the bridge compares the open workspace with its .DsnWrk. If the agent's project is the only difference, it removes any agent entries from the file and clears Altium's "changed" flag. The agent clears the flag again when it stops, because Altium sets it a moment after a project opens or closes. The reply reports this in userWorkspace.
  • If you opened or closed a project yourself in the meantime, your workspace is left exactly as it is, and Altium asks as usual.
  • altium_launch removes agent projects from Altium's automatic last-workspace file before Altium starts.

How we tested it. We used a saved workspace holding a board project plus an older agent generation, as in your .DsnWrk:

  • The agent start closed the old project, and the agent entry left the file.
  • After the agent ran and stopped by itself, closing Altium listed only the board project. That is the same prompt Altium shows when no agent ran at all.

Your existing .DsnWrk gets cleaned the first time the agent starts in it on 0.2.98. Thanks again for spotting it.

Colby Knox closed this ·

Log in to reply.