You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make department routing discoverable + add a clarifying turn to the editor
The conversational editor didn't scale: only one department (Product) was
demonstrable, nothing told the user which departments/conditions exist, and the
model accepted any department string — so "add a Finance review" created a gate
that never fired. Three changes fix that:
- Seed three departments (Product, Operations, Finance) on real POs, each mapping
to a real org head, so a department-scoped gate is demonstrable.
- Discoverability in the editor: the org's REAL departments render as coloured
chips ("Route by department") you can click to route on, and the condition
fields (amount / department / variance / verdict) are listed in the "What can I
change?" popover. The chips' departments are sent to the edit agent.
- A clarifying turn the model chooses ONLY when needed: a new `clarify` op lets
the planner ask "which department?" (with the valid options) instead of guessing
or inventing a dead gate, when an instruction is missing or names an unknown one.
The agent short-circuits on it (workflow unchanged), the oRPC EditResult carries
it, and the UI shows the same chips; picking one re-submits the completed
instruction. A complete instruction still applies directly.
Verified live in the browser (e2e/edit-clarify.e2e.ts): "add a department review"
→ the agent asks which one → pick Finance → a Finance gate is proposed. The model
even omits a department the workflow already gates. Gate green, 194 tests.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments