Computer use CLI for AI agents
title: An AT-SPI error name is not proof an object is gone date: 2026-10-18 category: runtime-errors module: crates/linux/src/tree/properties/absence.rs, crates/linux/src/tree/resolve/resolve_errors.rs, crates/linux/src/tree/observe/node_evidence.rs, crates/linux/src/tree/resolve/mod.rs, crates/linux/src/tree/properties/toolkit_trust.rs problem_type: runtime_error component: atspi-resolver symptoms: - "A live element is reported destroyed because one read returned UnknownObject, UnknownMethod or UnknownInterface." - "A destroyed element still resolves because a read of its stored object path succeeded." - "An exited application is reported as a destroyed element, or a stopped one as an exited one." tags: [linux, at-spi, d-bus, stale-ref, resolution, error-names, toolkits]
Problem
Re-identifying a stored ref on Linux needs a verdict on whether the element still exists. The obvious rule reads the stored object path and treats the D-Bus error names UnknownObject / UnknownMethod as "gone". Measured against live GTK3, GTK4, Qt 6 and Chromium (probes/linux/FINDINGS.md L17-1 to L17-12), that rule is wrong in both directions.
What the toolkits actually do
- The same names mean "not implemented" on live objects (L17-2). Qt answers
UnknownObjecttoText.GetTexton 46 of 48 live nodes andUnknownInterfacetoProperties.GetofValue; GTK4 answersUnknownMethod; GTK3 answersFailed. Qt also answersUnknownInterfacetoProperties.GetAll(Accessible)on every live node (L17-3), so aGetAllfailure is no absence signal. The same holds on the application interface: GTK3 and Qt refuseProperties.GetAll(org.a11y.atspi.Application)while answeringGet(ToolkitName)andGet(Version)(L27-20, L27-32), sotoolkit_trust.rsreads the toolkit one property at a time and a refused group read leaves nothing to conclude. - Bulk reads can crash the bridge. A later raw Qt probe killed the app with
Properties.GetAll(Accessible)while individualProperties.Getcalls and an interface-guarded walk survived (L41-7). The reader therefore uses concurrent individual properties and checks advertised interfaces before optional reads. Earlier refusal results do not make a bulk read safe. - Destroyed objects keep answering. GTK3 and Chromium objects return their old values for about 16 s after destruction, then
UnknownObject(L17-6 to L17-8). A successful read of a stored path proves nothing in that window. GTK4 and Qt go quiet at once, withUnknownMethodandUnknownObject/UnknownInterfacerespectively (L17-1, L17-4). - A write to a destroyed GTK3 widget answers success with a zeroed
GetStateand an empty name (L30-2), so a successful write is no more proof of presence than a successful read.an-atspi-write-that-returns-success-has-not-changed-anything.mdcovers the write path. - An exited application is a different error. SIGKILL and clean quit both give
org.freedesktop.DBus.Error.ServiceUnknownon the call andNameHasNoOwneron a bus-daemon query; neverUnknownObject(L17-9). - A call in flight when the app is killed returns
NoReply, notServiceUnknown, for the 27 to 45 ms before the next call sees the app gone (L33-12).NoReplyis not anAppGonename, so a rootGetChildrenthat straddles a kill is a transient non-verdict: retry it, and let the next read returnServiceUnknown. - A closed or hidden Qt dialog stays in the tree. It keeps
ENABLED,RESIZABLEandSENSITIVEand losesSHOWINGandVISIBLE(L33-15), so a window list built from the registry reports a window that is gone. Minimized windows are not that shape: GTK 3, GTK 4, Qt and Chromium keepSHOWINGor gainICONIFIED(L33-55). A window with neither is a husk, andcrates/linux/src/system/window/ghost_window.rsleaves it out. A state census that filters by flags can hide the husk or hide a real minimized window, so count by the full state set. - A timeout carries no D-Bus error name (L17-10): a stopped process fails every read with a local
TIMED_OUTafter the client limit, and the registry still lists it. Registry presence is no liveness evidence. - A hidden GTK4 tab page leaves the tree while its objects still answer every universal read (L17-5), so a direct-path read can find what a descent cannot.
Solution
Classify in layers, as crates/linux/src/tree/properties/absence.rs does.
Failuresorts one failed call:AppGone(ServiceUnknown,NameHasNoOwner),Suspect(the three names above),TimedOut,Other.Suspectis never a verdict on its own.Livenessis read from the node's ownAccessible.GetRole, which every live node of every toolkit answers (L17-11). A field read that fails asSuspectbecomes "object gone" only whenGetRolealso fails in the suspect family; otherwise the failure stays on its field (read_failure).GetAllandGetChildAtIndexare not valid corroboration: Qt fails the first and GTK4 childless nodes fail the second.- Presence is decided by the parent's child list, not by the object's own reads (L17-12): the resolver follows the stored child-index path down from the verified window frame (
path_descent.rs), and a landing is accepted only if its evidence still matches the stored identity. A node that merely answers is not a positive. TheParentproperty is never climbed (L2-2). - Map to settled answers in
resolve_errors.rs: an app that left the bus isSTALE_REFkindresolve_owning_process_exitedonly when/procshows the process gone, andresolve_owner_unreachableotherwise (owner_unreachable), because a missing bus owner does not prove an exit; a destroyed object isresolve_target_destroyed; a full search with no match isresolve_no_candidate. After that mapping,resolve/mod.rschecks whether/procshows the owning process stopped when the error is a timeout or an incomplete identity observation (resolution_identity_unknown). With stopped-process evidence, both becomeAPP_UNRESPONSIVE(stopped_aware). Without it, a timeout stays unchanged, and an incomplete observation becomes a retryableSTALE_REF. Other errors pass through.
Process state needs independent evidence
The lifecycle path in crates/linux/src/system/process/process_state.rs asks a different question from element resolution. system/process/liveness.rs checks the expected process-instance token against /proc before and after the accessibility probes: a missing, zombie, dead or replaced process is Exited; an unreadable stat is conservatively alive. kill(pid, 0) succeeds on a zombie and cannot replace that check.
process_state_classify.rs keeps an answered probe, a timed-out probe and an unavailable probe distinct. A stopped process is Unresponsive unless it answered. A live process becomes Unresponsive after two consecutive accessibility probes time out (process_state.rs::observe); one timeout or unavailable evidence leaves it Running. The rule was measured against a blocked main loop and healthy applications under load (ledger L31-17, L31-18), not inferred from registry presence. Returning an error for an unavailable probe would let core mistake uncertainty for exit.
Prevention
- Do not branch on a D-Bus error name alone; ask what else the same name means on a live object, and measure it per toolkit.
- A read that succeeds against a stored path is not positive evidence of presence. Positive evidence is reaching the node by walking from a verified ancestor.
- Keep "app gone", "object gone", "timed out" and "not found" as separate answers; collapsing them turns a native failure into a confident verdict.
- Probe every toolkit before encoding a rule from one: Qt, GTK3, GTK4 and Chromium disagreed on every name here.