Add NoGraphics field to tart get command
I want to detect whether a VM is running with a window or without for ClodPod, a VM sandbox for AI agents, so I added a feature to tart:
- Added
NoGraphicsfield to thetart getcommand output - Returns
falsewhen window is present,truewhen window not present, andnullwhen VM is not running - Includes integration tests to verify the functionality
Glad to make changes; I agonized over whether the field should be NoGraphics: true/false or Graphics: false/true.
NOTE: this is an awkward feature to test because in CI mode (like GitHub actions), the CI environment never creates windows, so I can only test for "--no-graphics" and "not running".
I want to detect whether a VM is running with a window or without for ClodPod, a VM sandbox for AI agents
Have you considered storing this state in your software instead?
As far as I understand, it is ClodPod that invokes tart run with --no-graphics conditionally in the first place.
Since you also use SQLite, you can just store an additional no_graphics boolean column and set it at the time VM creation to achieve the same result.
That's a reasonable solution, though whatever cached state ClodPod has might not accurately reflect the actual state of the virtual machine.