Repository navigation
docs(agents): document trigger status_reason and resume 409 (MARSOHS-2525) - #1336
nveerdixit wants to merge 2 commits into
Conversation
…2525) The service now pauses a trigger whose agent config was deleted and tells the customer why. Add status_reason and status_message to the trigger schema, and document that re-enabling such a trigger without a new session_template returns 409. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sanpj2292
left a comment
There was a problem hiding this comment.
This matches the service behavior. One gap is noted inline. Client follow-ups (dots, the MCP server, the console) are tracked in MARSOHS-2525.
| '409': | ||
| description: Duplicate name, or an attempt to change an immutable field (kind, provider). | ||
| description: >- | ||
| Duplicate name, an attempt to change an immutable field (kind, provider), or status active |
There was a problem hiding this comment.
This 409 isn't only for status: active. If the trigger gets paused for a deleted agent config while any PATCH is in flight (a rename, for example), the service refuses the whole update with the same 409. Suggest adding something like: "…or the trigger was paused because its agent config was deleted while this update was in flight."
There was a problem hiding this comment.
You are right that any PATCH can hit this. Every ordinary update runs a compare-and-swap on status_reason (storer_mysql.go:410), so a rename that races the pause is refused as a whole. One detail from the service: only a request that sets status active gets the resume message. Any other update gets "the trigger was modified concurrently; please retry" (updateMissErr, handlers.go:736-743). The description now says nothing is applied in that case and tells clients to re-read and retry (8badfab).
A PATCH that races a deleted-config pause is refused whole with a 409, not only one that sets status active. Only a resume gets the resume message; any other update is told to retry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Why
The trigger API now pauses a trigger whose agent config was deleted, says why on every read, and refuses a plain resume. Public clients (godo, doctl, the control panel) cannot show the reason or explain the 409 until this spec documents them. This is part 1 of MARSOHS-2525.
What changed
triggergainsstatus_reasonandstatus_message.status_reasonis a string, not a closed enum, liketrigger_execution.status_reason. The known value isagent_config_deleted. Both fields are present only while the service has paused the trigger.PATCH /v2/harness-runtime/triggers/{trigger_id}documents the new 409:status: activewithout a newsession_templatewhilestatus_reasonisagent_config_deleted. The error message is the same text asstatus_message.session_templateandstatus: activeresumes the trigger. Asession_templatealone clears the reason and leaves the trigger paused.session_templateon reads is omitted while the reason is set, because the deleted config cannot be read back.Scope
Spec only. godo, doctl and the control panel follow in separate changes.
Verification
make lint(theValidate specCI job, which also runsmake bundle) exits 0. Both Spectral passes report 0 errors and 8 warnings, all in files this PR does not touch.This needs API Engineering review. Merge once the service returns these fields in production.
🤖 Generated with Claude Code