Checkpoint: The Agent Control Loop

Camofox-browser becomes understandable when one request is followed across its boundaries instead of being reduced to a browser call. This checkpoint connects the browser identity, isolated session, accessibility snapshot, element ref, and changing page already established, then uses them to answer a practical question: what does an agent actually know at each point in an interaction, and what should it do when that knowledge stops being current? The result is a control loop that separates reachability, observation, action, state, and task success.

A request has more than one kind of success

Imagine an agent asked to find a product on a real website and select the matching result. Before the agent can choose anything, camofox-browser must get a page to the point where it can be observed. The browser identity assembled by Camoufox, the display environment, and the network path affects whether the site delivers a useful page at all. A blocked response, an unavailable proxy, or a challenge is a site-facing problem. It is not fixed by giving the agent a longer snapshot.

Suppose the page does arrive. The next success condition is different. The service must represent enough of the page's accessible surface for the agent to recognize the search control, result links, and relevant labels. An accessibility snapshot with refs is evidence about what the page exposes to the agent. It is not a copy of every element in the DOM, and it does not fill in information that the page does not make accessible.

The agent then selects a ref. That choice is a statement about the current observation: this role, this name, and this occurrence appear to be the control that matches the goal. It is not a permanent claim about the website. If the page rerenders, a modal opens, results are resorted, or navigation occurs, the relationship represented by the ref can change. The agent may still be holding the same string, but the string no longer guarantees the same meaning.

The user's session introduces another state distinction. The page belongs to a BrowserContext associated with an agent or user identity. That context owns cookies and storage separately from other contexts. If the agent is anonymous, a successful result does not become authenticated merely because the browser reached the page. If the agent is authenticated, the session state may explain why one context sees a control or result that another cannot. The observation and the identity that produced it must be considered together.

Finally, there is task success. A REST response can say that navigation completed. A snapshot can contain a result link. A click can return without an error. None of those facts alone proves that the agent selected the right product or completed the intended business action. Camofox-browser's interface is strongest when it helps the agent distinguish an action that ran from a state change that was verified by a new observation.