Clone
3
assistant_live_mode
ispyisail edited this page 2026-10-02 16:17:22 +13:00

Live mode: an AI assistant working in the open project

Normally an AI assistant connected through the MCP server works on files: it reads a .qet, tests changes on copies, and never touches the drawing you have open. Live mode adds a second way of working: the assistant on one screen, QElectroTech on the other, and each thing it does happens in front of you, in the project you have open — where you can watch it, refuse it, undo it, or carry on by hand.

Status: merged on 2 October 2026. Everything on this page is in development builds made since then; it is not in a release yet. The pull requests:

PR What it adds Builds on
#1222 the setting, the startup warning, the status-bar indicator, running scripts live #1221 (script buttons)
#1223 the Assistant panel, ask-first, the allowed commands, the screenshot #1222
#1225 the qet_live_* MCP tools #1224

The proposal is discussion #1226.

Menu and option names are given in French, as QElectroTech shows them until the translations are updated, with an English gloss in italics.


The two ways an assistant works

Headless (the usual way) Live
works on .qet files and copies of them the project open in your QElectroTech
QElectroTech running? no — started in the background for each call yes, your own window
MCP tools qet_*, qet_script_* qet_live_* only
what you must switch on QET_ENABLE_SCRIPTING=1 that, and the live setting, and the warning at this start
undo nothing of yours changed one Ctrl+Z per assistant action

A script tested headless runs the same way live; only where it runs changes. The tools are kept apart so one can never be taken for the other.


Switching it on: three switches

  1. The MCP server is started with QET_ENABLE_SCRIPTING=1, as for the editing tools (see Scripting gate).

  2. The setting. In Configurer QElectroTech > Général (Settings > General): Autoriser un assistant IA à agir sur le projet ouvert (mode direct) (Allow an AI assistant to act on the open project (live mode)). Off by default. It takes effect at the next start; unticking it cuts the connection at once.

  3. The warning, at every start. While the setting is on, each time QElectroTech starts it shows, before anything can connect:

    Le mode direct est activé : un assistant IA connecté pourra exécuter des scripts sur le projet ouvert. Chaque action s'annule d'un Ctrl+Z, et le bouton « Arrêter » de la barre d'état coupe la connexion.

    (Live mode is on: a connected AI assistant will be able to run scripts on the open project. Each action is undone with Ctrl+Z, and the "Stop" button on the status bar cuts the connection.)

    Button Does
    Continuer (Continue) opens the connection for this session
    Pas pour cette session (Not this session) stays closed until the next start
    Désactiver (Turn off) stays closed and turns the setting off

    So a setting you forgot about can never leave the door open silently.

    The startup warning: live mode is on, each action is undone with Ctrl+Z, the Arrêter button cuts the connection; buttons Désactiver, Pas pour cette session and Continuer

With the setting off, QElectroTech opens nothing at all and behaves exactly as it does without this feature; the qet_live_* tools answer that live mode is off and do nothing. When they cannot connect, they say which of the three switches is missing.


While the assistant is connected

The status bar

Shows Mode direct : en attente d'un assistant (Live mode: waiting for an assistant) or Mode direct : assistant connecté (assistant connected), then the last thing it did, with ✓ or ✗ and the time. Hover it for the error, if there was one.

Arrêter (Stop) beside it cuts the connection for the rest of the session.

The Assistant panel

A panel called Assistant opens on the right while live mode is open. It lists every action, newest first: the time, ✓ or ✗, and its undo step's name. Hover an entry, or double-click it, for the details: the error, what the script logged, and the script itself.

The Assistant panel during a test session (ask-first unticked): a list of timed actions with ticks and crosses — screenshot, undo_last refused, show_folio, a refused diagrameditor.delete_selection, zoom_fit — and below it the status bar reading 'Mode direct : ✓ screenshot à 10:36:25' with the Arrêter button

At the top: Demander avant d'exécuter un script écrit par l'assistant (Ask before running a script the assistant wrote), ticked at every start. While it is ticked, a script the assistant wrote on the spot is shown to you first, in a box titled L'assistant veut exécuter un script (The assistant wants to run a script):

Button Does
Exécuter (Run) runs it
Refuser (Refuse) nothing happens; the assistant is told you refused
Toujours pour cette session (Always this session) runs it and stops asking until the next start

The ask-first box: the assistant's one-line script that adds a text on the sheet on screen, with Toujours pour cette session, Refuser and Exécuter

Stored scripts — the script buttons you already have — run without asking: you put them there.

Undo

Each assistant action is one undo step, named Assistant : <what it did>, in the same undo history as your own work. Ctrl+Z takes it back.

The assistant can undo too (qet_live_undo_last), but only its own last step. If the newest step is something you did, it is refused: what you do by hand stays yours to undo.


What the assistant can do

Tool Does Needs QET_ENABLE_SCRIPTING=1
qet_live_status is QElectroTech there and live mode open; the project and sheet on screen, how many sheets, what is selected, the last undo step; the stored scripts; whether a macro recording is under way no
qet_live_run_script runs script text on the open project (asks you first, see above); returns what it logged, its error, and the undo step's name yes
qet_live_run_stored presses one of your stored script buttons, by its id yes
qet_live_command runs one editor command from a fixed list (below) no
qet_live_show_folio shows another sheet of the open project no
qet_live_undo_last undoes the newest step, only if it was the assistant's no
qet_live_screenshot an image of the sheet on screen, so the assistant sees what you see no

The commands it may use

Only commands that open no window, so nothing can end up waiting for an answer nobody gives. Everything else — saving, deleting, exporting, printing — is refused; for edits it runs a script, which you can undo.

Command id (diagrameditor.…)
select_all, select_nothing, select_invert, select_all_conductors, select_all_text_fields selection
zoom_in, zoom_out, zoom_content, zoom_fit, zoom_reset view
rotate_selection, rotate_texts, snap_selection_to_grid arrange
group_selection, ungroup_selection groups
conductor_reset redraw the selected wires' path

What it cannot do

  • Click on the screen. Clicking at coordinates breaks at every layout change and can be steered by anything drawn on a sheet. The assistant acts only through the same calls a script button uses.
  • Open a dialog. qet.showMessage() in a live script goes to the log instead of opening a box.
  • Run two things at once. One request at a time; a second one meanwhile is answered "busy". A script still stops after 30 seconds.
  • Reach you over the network. The connection is a local socket (a named pipe on Windows), on your own machine only.

How the assistant finds QElectroTech

When you press Continuer, QElectroTech adds the connection's name and a random token to qet-assistant.json (see script buttons), readable only by you, and removes them on Arrêter or when it closes. The MCP server reads them from there; a connection without the token is closed.

The token keeps out other users of the computer and stale connections. A program already running as you could read your projects anyway, which is why what you can see — the indicator, the panel, ask-first, undo — matters more than the token.


The risk, stated plainly

Live mode is the one place an assistant changes the project you have open. The risk it adds: text inside a project you received (a label, a note, a title-block field) could try to steer the assistant into editing your drawing. The answers are ask-first for anything the assistant writes itself, the log, and one Ctrl+Z per action. If you do not need it, leave the setting off.


A session, start to finish

  1. Tick the live setting, restart QElectroTech, press Continuer. The status bar says en attente d'un assistant; the Assistant panel opens.
  2. Open your project. In the assistant's chat: "number the wires on the sheet I'm looking at, starting at 100".
  3. The assistant calls qet_live_status, sees the project and sheet, and may take a qet_live_screenshot.
  4. It writes a script and sends it with qet_live_run_script. The ask-first box shows it; you press Exécuter.
  5. The wires are numbered; the panel shows Assistant : … with ✓. Not what you wanted? Ctrl+Z.
  6. Arrêter when you are done.

Limitations

  • macOS has not been tested. Linux, and a Windows build under Wine with a Windows-side client, have.
  • No questions back. A live script cannot ask you for a value; the assistant asks in its chat instead.

See also