Open In progress bug report

altium_eval: script text above ~1.5 kB answers instance_busy after ~65 s on AD 26.3 (no size error, undocumented limit)

idan gida · ·marked in progress by kcknox

altium-bridge 0.2.120 · Altium Designer 26.3 · Adom Bridge 2.1.211 · Windows 11 (Hydrogen local workspace) · measured 2026-12-04

Summary

altium_eval fails with errorCode: instance_busy after about 65 s when the script text is longer than about 1.3-2 kB. The same script logic split into pieces under about 1.45 kB runs in a few seconds. The limit is not documented and the error does not point at the size.

Measurements (same Altium session, nothing else running)

eval text result
~1.1-1.45 kB, one line ok, 2-5 s
~3.4 kB (a working script, unchanged except length) instance_busy after ~65 s
~1.3-2 kB intermittent

The agent appears to pass the eval text to ScriptingSystem:RunScriptText as one Text process parameter (AddStringParameter('Text', Text); RunProcess(...)). Our guess is that this parameter path has a size limit in AD 26.3, and the script never starts. A crashed X2.EXE -R helper (Runtime error 217 box, a second X2.EXE pid) also blocks the lane until its window is closed.

Workaround we use

Keep each eval under about 1.4 kB. Put bulk data in a file (CSV, utf-8 BOM) and read it inside the script with TStringList.LoadFromFile plus S.CommaText per row, so a fixed, short reader loops over any amount of data.

Expected

  • Long scripts work: write the text to a temp .pas and run it from file, or chunk the parameter.
  • Or refuse at once with a named error, e.g. script_too_long: 3400 bytes, limit ~1450, instead of a 65 s instance_busy that reads as a busy Altium.
  • Document the limit in the altium-bridge skill.

2 Replies

Colby Knox ·

Thanks for measuring this. I'm reproducing the size limit now. The goal is that long scripts run, or at worst are refused at once with the size named, and the limit documented. I'll post here when the build is out.

Colby Knox marked this in progress ·
Colby Knox ·

Fixed in altium-bridge 0.2.123 (insiders now).

The limit you hit is Altium's command line, which the bridge used when its agent was not running: on 26.11 it ran 2 KB and failed at 3.4 KB, and on 26.3 it is lower, as you measured. Now:

  • A script up to 1,000 bytes may still go that way. Anything longer is run by the bridge's agent, which ran 16 KB scripts without trouble. The reply's lane and laneReason say which one ran it.
  • Over 16 KB the reply is errorCode: script_too_long at once, with bytes and limitBytes, before anything runs (32 KB timed out inside Altium's script engine). The hint suggests putting bulk data in a file the script reads.
  • The limits are in the altium_eval documentation and the skill.

If it holds up on your side, say so here and I will close this.

Log in to reply.