![]() |
Troubleshooting | ![]() |
Run the command by hand (see Installing and connecting an agent, “Checking that it works”). On macOS check the quotes around the path with spaces, and that the path exists. Look at system/mcp.log in the home folder.
The path must be absolute, and inside one of the folders of TEXMACS_MCP_ROOTS if it is set. A path with .. or with a colon is refused. The agent sees the real path of a file, after symbolic links.
The files must be shared (Edit\(\rightarrow\)Preferences\(\rightarrow\)Other\(\rightarrow\)Share files open in several TeXmacs windows), in the home that both programs use; then the agent opens the same path. The list of documents says which files are open elsewhere.
The answer of the agent says why. If the rule is “read only”, look at Tools\(\rightarrow\)Agents and at TEXMACS_MCP_READONLY. If it is one of the rules of content, see What an agent may not do: the definitions of the document cannot be changed by an agent, and links and files have to be plain. A “conflict” means that you changed the node after the agent read it: it must read it again.
Proposals exist when you have the file open and the mode is Propose edits (I accept or reject them). In the mode “direct” the edit is applied; if nobody has the file open, it is applied to the file in the agent's own copy, and the agent saves. The menu Tools\(\rightarrow\)Agents shows up only once an agent has joined the file.
The menu appears only while an agent is joined to the document of the current window, and only in the window that hosts the file: the first one that opened it. A second window of the file (another TeXmacs process, which joined the first) never shows it. To check, ask the agent for list_documents and look at the entry of the file:
shared with the role participant and agent_mode propose (or the mode you chose): the agent joined your window.
The role host with one participant: the agent holds the file alone, and your window did not join it (the file was opened in the agent first, or it was loaded before sharing was on).
shared null, agent_mode read-only and a note saying that the file is open in your TeXmacs but not joined: the agent could not join your window (the process does not answer, or the content cannot be shared). The agent neither edits nor saves the file then, and a Save in a window of yours that did not join is refused too (use Save as for a copy). This stays so until the agent closes the document and opens it again.
When you have the file open and the mode is not direct, you save the file. When the agent could not join your window (read-only, “not joined”), its save is refused whatever the mode: the file is yours, and it must close the document and open it again.
It ends when the agent closes its end. An idle server uses about 1.5 per cent of a processor (a few per cent at most). Use the process list to stop a program which has outlived its agent.