Kobra X (LAN mode): Pause/Stop not executed via agent, library upload fails with file_gone
Hi,
Two issues with the self-hosted agent and an Anycubic Kobra X in LAN mode, and one feature request.
Setup
- Agent: allmyprinters-agent 0.18.2 (Docker, ghcr.io/nolimitek/allmyprinters-agent@sha256:850d686d528e30c42a72b6e1fb51c047e7fc652316392f53323008b6c7b7d636), on the home LAN
- Android app: version 0.18.2, paired with the agent over the LAN tunnel ("Access from anywhere" off)
- Printer: Anycubic Kobra X, firmware 2.0.2.8, LAN mode, ACE unit attached
- Remote relay and push via allmyprinters.com are disabled. The plan is fetched normally (beta, valid).
## 1. Pause and Stop do nothing, Resume works
Tested on 2026-11-22 during a running print (task id 183774), standing at the printer:
| Action from the app | Result |
|---|---|
| Light on/off | works immediately |
| Pause | nothing happens, the print continues (we then paused on the printer's touchscreen) |
| Resume (after pausing on the screen) | works: the printer reheats, purges and continues |
| Stop (earlier print, task id 545420) | nothing happens, the print continues (we then stopped it on the screen) |
The printer state was followed in Home Assistant. No state change to pausing/stopping happened after the app commands, only after we pressed the buttons on the screen. The app showed no error.
From the agent code, printer_cmd for acl sends
{type: "print", action: "pause"|"stop"|"resume", data: {taskid: "-1"}} on
anycubic/anycubicCloud/v1/web/printer/<mainboard>/<serial>/print.
Resume is accepted with taskid "-1" but Pause and Stop are not. Perhaps the Kobra X needs the real task id (from info.project.taskid) for pause/stop, or a different action name or topic branch. We cannot see the printer's reply because the MQTT connection is TLS.
This matters for safety: Stop in the app (and in the Home Assistant integration) looks like it worked, but the printer keeps printing.
## 2. Uploading a file to the library from the app fails ("Upload failed.")
When adding haken.stl (approx. 0.1 MB) to a bookmarked model ("Does this file belong to a bookmarked model?"), the app shows "Upload failed.". "No, just print" with the same file works.
The agent's diagnostics (amp_diag) show the same entry for every attempt:
{"a":"lib","err":"IllegalStateException","d":"app"} 2026-11-21 16:06Z, 2026-11-22 08:07Z, 2026-11-22 14:18ZSo native('lib_put') → fileOf(token) throws file_gone on the agent. The stash token from the app does not exist on the agent: it looks like the app stashes the file on the phone (or on another instance) and then calls lib_upload / amp_lib_attach on the agent with that token. The agent's disk has plenty of free space, and the library directory is writable (earlier 3MF files are there).
Thanks for the app, it works well otherwise!