Discard work
discard_workClose an open intent you won't accept to release its claims and dismiss blocking conflicts, optionally recording a Git ref where unfinished work landed.
Instructions
Close one of your own intents that you will not take through accept_changeset. Call it before you stop working, whenever the intent is still open: an intent never closes itself, and an open one is compared against every later intent on the same scopes. Two cases. Work that will not be finished, for example a duplicate or work another agent took over: pass a reason. Work that reached Git without a passing named check, so it cannot be accepted: pass landed_ref as well, naming the commit or branch it landed in. Either way it sets the intent to DISCARDED, releases all of its active claims, and dismisses its OPEN or COORDINATING conflicts so they stop blocking the other party. With landed_ref the commit is checked and recorded, but the intent still ends DISCARDED, not ACCEPTED: nothing here says the work was verified. The history stays in the event log, but a discarded intent cannot be resumed; publish a new intent instead. Only the owner may discard, and not once the intent is ACCEPTED, COMMITTED or already DISCARDED. Returns the updated intent. To agree that two intents can coexist, use resolve_conflict instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reason | Yes | Why the work is being closed: why it was abandoned, or how it landed. Required and recorded in the event log. | |
| agent_id | Yes | Your agent id (agt_...). Must own the intent. | |
| intent_id | Yes | The intent (int_...) to discard. | |
| landed_ref | No | Only for work that reached Git: the commit, branch or tag it landed in. Refused with INVALID_INPUT if it does not resolve to a commit, with TARGET_DIVERGED if the intent published a ChangeSet whose changes it does not hold, by ancestry or by content as record_commit checks, and with STALE_CHANGESET if that ChangeSet was published with uncommitted changes or before the repository's first commit. |