Navigation
The agent can only go where the app’s own nav can go, and Back undoes every move it makes.
The problem
Give a model a “navigate” tool and it will invent routes. /order-list looks plausible, so it tries it. That fails on the person’s screen, or it lands them on a blank page. Filters have the same problem: a made-up filter key does nothing, silently.
Showing every failure doesn’t fix it either. The person ends up reading “Cannot navigate to /order-list” for a mistake the model could have fixed itself in one more try.
What I concluded
Moving around the app is the agent’s most common action, so it gets the most care. Three things make it safe.
1. It can only name real places. The app publishes its site map: every page, what it’s for and which values its params accept. Navigate checks against that list before anything moves.
2. Mistakes go back to the model, not the person. The server checks each screen action before it reaches the browser. A bad call goes back to the model with the reason and the allowed values:
Cannot open "/order-list". Available: "/orders", "/customers", …
Unknown filter "colour". Allowed: status, customer, placedAfter.
With the list in hand, the second try almost always lands. The person only ever sees moves that work.
3. It moves the way a person does. Every agent move goes through the router, like a click. It changes the URL, so it shows in history and Back undoes it.
model: navigate("/order-list")
│
▼
server checks the site map ──✗──▶ back to the model: "Available: /orders"
│ ✓
▼
browser: router.go("/orders") ──▶ URL changes ──▶ Back undoes it
Rules
- One way to move. Opening a page is the only navigation action, and it always goes through the router.
- Moves run one at a time. “Filter to late orders, then sort by date” happens in that order, each step seeing the URL the last one left.
- A move is pinned to its page. If the person moved on before the agent’s action arrived, the action is dropped with “You’ve moved to another page since asking.”
- Moving ends the turn. Once something changes on screen, the agent waits for the person’s next message.
What you get
An agent that can take you somewhere without ever stranding you. If it gets it wrong, Back fixes it, and nothing it does is a state the app couldn’t reach by hand.
Part of UI as rendering engine. The URL side of this is URL state.