Closed bug report

Resident agent blocks clicks in Altium after verbs return (no hint to stop it); sch_edit renames reset UniqueIds

barrett-land · ·closed by Colby Knox

altium-bridge 0.2.67 · Adom Bridge 2.1.184 · Altium Designer Professional 26.10.1 · Windows 11 (Hydrogen local workspace)

1. The resident agent stops the user from clicking in Altium

What I did: I ran a short series of verbs against the user's open project: altium_readiness, altium_agent_start, altium_state, altium_schematic_data, altium_check_dialogs, and two altium_sch_edit calls (designator renames). Then I handed back to the user, who kept working in the same Altium.

What I expected: the bridge works in the background, and once the verbs return, Altium is the user's again.

What happened: the user couldn't click anything in Altium. altium_check_dialogs returned "No Altium dialogs open.", and the main window was enabled: true, visible: true. Calling altium_agent_stop freed Altium right away. Separately, altium_state still reported drivingBadge: {"active": true} after agent_stop and agentAlive: false.

So while the agent loop is resident, it takes Altium's UI away from the user, and nothing in a verb's output tells the AI. The skill says "the agent survives across your calls (auto-stops after 5 min idle)", which gives an AI no reason to stop it. A user working next to the AI hits a frozen Altium for up to 5 minutes.

Ask:

  • Bridge: don't block the UI while the agent is idle, or stop it shortly after the last verb returns (seconds, not 5 minutes). Clear drivingBadge when the agent stops.
  • In the meantime, mutating and read verbs should say so in their output, e.g. _next: "altium_agent_stop when you hand Altium back to the user; Altium ignores clicks while the agent is resident".
  • Skills (altium-bridge, convention 6): say plainly that a resident agent blocks the user's clicks, and that the AI should call altium_agent_stop before handing back.

Setup: a multi-channel project where two sheet symbols (DEPOP_A, DEPOP_B) both pointed at Bal_Meas_Depopulate_ADI.SchDoc. The user made two copies (..._A.SchDoc, ..._B.SchDoc) with File » Save Copy As and added them to the project. The original was still in the project. Reading the copies from disk confirmed that both still had the original component UniqueIds (e.g. C2 = MRBXAQGX, R3 = UZVDQGFH), the same ones the PcbDoc links to.

Ran:

altium_sch_edit {"sheet":"...\\Bal_Meas_Depopulate_ADI_A.SchDoc","edits":[{"designator":"R3","action":"designator","to":"R3_DEPOP_A"}, ...6 parts]}

(and the same on _B). Both calls returned success: true, applied: 6, saved: true.

Then: reading the saved files back, every renamed part had a NEW UniqueId (C2 on A = RRSHMHOZ, R3 on A = ZQNPVOME, and so on, 12 parts in all). That breaks the schematic-to-PCB component links: Update PCB would delete and re-add all 12 placed parts instead of renaming them.

I can't tell whether sch_edit caused this or Altium reissued duplicate IDs when it saved the copies inside a project that still held the original. Please reproduce on a sheet with no duplicate IDs. Either way, sch_edit should keep UniqueIds, and when a part's UniqueId changes during a verb, the reply should report it (uniqueIdChanged: [...]). The skill (altium-schematic-edit) should warn about this before anyone renames parts on a board that's already placed.

3. Minor: altium_schematic_data {filePath, params:true} timed out

On Bal_Meas_Depopulate_ADI.SchDoc (6 parts), it ran out the full 120 s budget with timed_out / stillRunning: true, and no dialog was open. Reading the same file directly worked fine.

2 Replies

Colby Knox ·

Thanks, Barrett. This was a clear report. Fixed in altium-bridge 0.2.69 (source 3a52e56, waiting to be signed and released).

1. The agent blocked the user's clicks. You were right: while the agent loop runs inside Altium, Altium ignores the user's editing clicks, and it stayed resident for 5 minutes after the last verb.

  • The loop now leaves 15 s after the last request. Restarting it costs about 2 s on the next verb (measured 1.8 s).
  • Status reads no longer keep it alive. An AI polling altium_state every few seconds used to hold it forever; now it leaves at 15 to 17 s regardless.
  • Every reply that leaves the agent running now carries agentResident with the hand-back instruction ("call altium_agent_stop when you hand Altium back to the user"). The altium-bridge skill (convention 6) and agent_stop's doc say it plainly.
  • drivingBadge now clears on agent_stop and within about 5 s of the loop leaving. It no longer sticks at active: true.

2. The UniqueIds. I reproduced your setup.

  • sch_edit keeps UniqueIds: renaming parts and renaming them back left every id unchanged.
  • Altium reissues the ids itself. When it opens a sheet that shares UniqueIds with another sheet in the same project (a Save Copy As of a sheet that's still in the project), every part on the copy gets a new id the moment it opens, before any edit. The verb's save then writes those new ids. That's what you saw.
  • The bridge can't stop Altium doing that, but it no longer happens silently. Every sheet-editing verb (sch_edit, sch_connect, sch_place_part, sch_swap_part, annotate, sheet_params, doc_params, sch_sheet_symbol) now reads the sheets' ids from disk before and after. When ids were replaced, the reply carries uniqueIdsReissued: [{sheet, lost, new}] and a warning to re-link the parts (Project > Component Links) before Update PCB. The altium-schematic-edit skill explains it.

3. schematic_data {params:true} timing out. I couldn't reproduce it. Six-part sheets with parameters read in well under a second in our tests on both builds. Could you attach Bal_Meas_Depopulate_ADI.SchDoc (and the library its parts come from, if it's a database or vault library)? My guess is a parameter that Altium resolves slowly (database-linked or managed), and I'd like to see it before changing anything.

Colby Knox ·

Fixed in altium-bridge 0.2.69, now public (both insiders and public serve it). The agent leaves 15 s after the last verb, status reads don't keep it alive, replies carry agentResident with the hand-back instruction, and the driving badge clears. Every sheet-editing verb reports uniqueIdsReissued when Altium gives parts new ids. Part 3 (the schematic_data params timeout) moved to #28, which waits on the sheet.

Colby Knox closed this ·

Log in to reply.