Two Agents Can Claim the Same Task
Without a single-winner rule, both proceed, and now there are two conflicting implementations of the same thing.
Nexus enforces structural separation between claiming work, gating it for human approval, and recovering from a dead session. The dashboard below reproduces that run in the current Nexus interface, with local demo states for the surrounding product screens.
Interactive product demo with local mock data. Explore entities, conversations, handoffs and workspace health without credentials or a connection to the original workspace.
AI agents are good at doing work. They're not naturally good at not doing the same work twice, not touching something risky without asking, or remembering what happened after a session dies.
Without a single-winner rule, both proceed, and now there are two conflicting implementations of the same thing.
A schema change, a delete, a deploy: if nothing pauses it for a human, "the agent decided to" is the whole audit trail.
A dependency rule that only warns doesn't stop an agent from building against a schema that doesn't exist yet.
Kill an agent mid-task and whoever picks it up next is starting from zero, re-reading everything a human has to re-explain.
Every step below is a real mechanism in the coordination layer, not a convention either agent has to remember to follow.
SQL + reasoning placed directly in the description.
The call never creates the handoff; it returns pending_approval instead.
SQL and Schema Agent's reasoning sit visible for a human.
Approve replays the original call with a one-shot bypass; the handoff is now OPEN.
An atomic conditional update guarantees exactly one winner; the loser gets a clean rejection.
Skipped this run, see caveat belowAn early claim on a dependent handoff is refused with DEPENDENCY_NOT_MET, proven live.
Completion clears the dependency for whatever was waiting on it.
The connection is fully terminated mid-build: process exit, not idle.
Zero prior context, reconstructs the claimed state and full history from Nexus's own record.
A script reads the event log for claim latency, rejection count, time-to-approval; there's no built-in metrics tool for this.
Grounded in this workspace's actual event log, the same sequence the dashboard above is built from.
Operator attaches require_approval to Schema Agent's handoff_create; confirms feature_dag is on.
Schema Agent calls handoff_create for the migration, SQL in the description, intercepted automatically into the approvals queue.
Operator approves in the dashboard; handoff_create replays with a one-shot bypass. The migration handoff is now OPEN.
Deliberately skipped this run: the migration's target was scoped to role:api, leaving only api-agent eligible. Not a Nexus limitation, a consequence of how the proposal was scoped.
Proven live with a separate blocker/dependent pair, since the real migration had already completed by this stage. A genuine DEPENDENCY_NOT_MET response.
The claim winner applies the migration for real against the target app's Postgres DB, then calls handoff_complete.
handoff.unblocked fires; API Agent claims its handoff and builds the admin metrics endpoint against the now-real schema.
API Agent's session is terminated entirely mid-build. A brand-new connection with zero prior context reconstructs state from Nexus's own record and finishes the task.
handoff_get + event_get/event_cursorA close-out script pulls handoff.claimed/handoff.rejected/approval.requested/approval.granted timestamps and derives claim latency, rejection count, time-to-approval.
Two separate MCP connections, separate credentials (not one identity switching hats), plus the human who holds the approval gate.
handoff_create, SQL in the descriptionhandoff_create: a human-only decision once the policy intercepts itdepends_onhandoff_claim its own handoff while the migration isn't COMPLETED: DEPENDENCY_NOT_METrequire_approval to handoff_createThe real install commands, plus what actually gets configured in the dashboard's Policies screen before either agent connects.
pip install "okto-nexus[serve]"
okto-nexus serve
okto-nexus init is not a real subcommand; serve alone bootstraps the data dir on first run.
Open Policies → New policy, name it, and add one governance rule: handoff_create requires approval.
Bind the policy to schema-agent as a global, latest-mode rule, then connect Schema Agent and API Agent with separate MCP configs, same pattern as Pulse's Builder/Validator split.
require-approval-on-migration-handoffshandoff_create→require_approvalschema-agentlatestrequire_approval only applies to handoff_create/message_create, not artifact_put, which is why the gate sits on proposing the migration, not the later SQL write.
Both agents work through the same MCP surface. The tool calls this workflow actually makes:
| Tool | Used for |
|---|---|
handoff_create | Schema Agent proposes the migration handoff (SQL in the description): the call the require_approval policy intercepts; API Agent proposes its dependent handoff with depends_on |
handoff_claim | Both agents race on the now-approved migration handoff; API Agent's claim on its own dependent handoff (denied until unblocked) |
handoff_complete | Closes the migration handoff after it's applied, firing handoff.unblocked |
handoff_get | Recovered session reads current handoff state after a killed session |
event_get / event_cursor | Recovered session replays history; close-out script derives timing metrics |
artifact_put | Optional: the winner can record the applied SQL for the record; not policy-gated |
A bound require_approval policy intercepts handoff_create automatically: the agent never chooses to ask, Nexus decides to hold it.
An atomic conditional update guarantees exactly one winner on a claim, with a clean typed rejection for the loser.
depends_on structurally blocks a claim, not just a comment saying "do this after that": DEPENDENCY_NOT_MET, proven live.
A killed session's replacement reconstructs claimed state and full history entirely from Nexus's own durable record.
Free to run on your own machine. No account required.