fix(incidentio): align declared outputs and enum hints with the v2 API - #7306
Merged
Conversation
…v2 API Four declared outputs could never be populated because the v2 API names the field differently, and three param descriptions advertised enum values the API rejects. Verified against https://api.incident.io/v1/openapiV3.json, which serves the v1/v2/v3 schemas in one document. - IncidentV2 has `permalink`, not `incident_url`, and no `description` at all: incidents list/create/update/show now declare and map `permalink` and drop `description`. - IncidentUpdateV2 has `new_incident_status` (required), not an optional `new_status`; `message` is optional, `updated_at` is not returned, and `updater` is an actor wrapper whose user lives under `updater.user`. - EscalationV2 has `title` and `status`, not `name`. - WorkflowsCreate/UpdateWorkflowPayloadV2 accept only `newly_created` and `newly_created_and_active` for `runs_on_incidents`, and CustomFieldsCreatePayloadV2 accepts only text, link, numeric, single_select and multi_select for `field_type`. Renaming a declared output changes the reference-picker surface for these tools; nothing in the repo read the old names.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Greptile SummaryThe PR aligns incident.io workflow-facing output declarations and parameter guidance with the v2 API.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/sim/tools/incidentio/incident_updates_list.ts | The updater declaration now exposes user, API-key, workflow, and alert actors, resolving the prior workflow-output omission. |
| apps/sim/tools/incidentio/escalations_list.ts | The escalation list output now declares title, status, description, priority, and timestamps, resolving the prior incomplete schema. |
| apps/sim/tools/incidentio/escalations_show.ts | The escalation show output is aligned with the expanded EscalationV2 declaration. |
| apps/sim/tools/incidentio/escalations_create.ts | The escalation create output is aligned with the expanded EscalationV2 declaration. |
| apps/sim/blocks/blocks/incidentio.ts | Unsupported Active and All workflow options were removed from the selectable block configuration. |
| apps/sim/tools/incidentio/output_drift.test.ts | Regression coverage verifies the corrected output names, actor branches, escalation fields, and workflow options. |
Reviews (3): Last reviewed commit: "fix(incidentio): stop the block offering..." | Re-trigger Greptile
There was a problem hiding this comment.
All reported issues were addressed across 16 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
…lare every actor branch
Collaborator
Author
Collaborator
Author
|
@cubic review |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Collaborator
Author
Collaborator
Author
|
@cubic review |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Declared tool outputs and param enum hints in the incident.io integration that do not match the API. Verified field-by-field against
https://api.incident.io/v1/openapiV3.json— despite the/v1/path, that single document serves the v1, v2 and v3 schemas, and every tool here targets a path inside it.Outputs that were always
undefinedincidents_list/_create/_update/_showincident_urlpermalinkdescriptionIncidentV2hassummaryincident_updates_listnew_statusnew_incident_statusupdated_atupdater.{id,name,email}updaterisActorV2={alert, api_key, user, workflow}escalations_list/_show/_createnametitleIncidentV2's property list containspermalinkand noincident_url;IncidentUpdateV2's required set is['created_at','id','incident_id','new_incident_status','updater'];EscalationV2's required set includestitle,status,description,priorityand has noname.Corroborating signal:
incidents_show.tsalready readincident.permalinkcorrectly while also carrying a vestigialincident_urldeclaration.messageonincident_updates_listwas declared required but is optional in the spec, andescalations_*now declare thestatusandupdated_atthe spec marks required.Param descriptions advertising values the API rejects
Three, and exactly three — a model reading these is steered straight into a 422:
workflows_create.runs_on_incidentsandworkflows_update.runs_on_incidentsadvertisedactiveandall. The spec enum is['newly_created','newly_created_and_active']. The TypeScript unions carried the same two bogus members and are narrowed to match.custom_fields_create.field_typeadvertiseddatetime,user,team. The spec enum is['single_select','multi_select','text','link','numeric'].Refuted while checking:
incident_modeonactions_list/follow_ups_listadvertisesstandard, retrospective, test, tutorial, stream, which matchesGET /v2/actionsand/v2/follow_upsexactly. (The v1 enum is['real','test','tutorial'], but neither tool targets v1.)sort_by/filter_modeonincidents_listandvisibilityonincidents_createalso match verbatim. No change to any of them.Backwards compatibility
Every removed field was
undefinedat runtime before this change, so nothing that resolved to a value stops resolving. Runtime reference resolution walks the real response object, so a saved<incidentio.incidents[0].incident_url>returnedundefinedbefore and still does — what changes is the reference picker, which now offers the fields that actually exist.No tool ids, param names,
requiredflags orvisibilityvalues changed. Consumers were grepped before every rename: the only readers of the old names were the tools' owntransformResponseandtypes.ts.connectors/incidentio/incidentio.tsindependently readsupdate.new_incident_status?.name ?? update.new_status?.nameand is unaffected.Type of Change
Testing
apps/sim/tools/incidentio/output_drift.test.ts— 13 tests; 17 pass intools/incidentio.Verified red-first per fix, reverting each change individually rather than the diff as a whole, because a test can go red for a neighbouring reason while the mechanism it names stays uncovered:
permalinkdescriptionremovalnew_incident_status(+updater,updated_at)titleworkflows_create.runs_on_incidentsworkflows_update.runs_on_incidentscustom_fields_create.field_typeEach revert reddened only tests in its own
describe. Assertions are exact —toEqualon property-name lists,toBeon exact description strings, no baretoThrow.One honest caveat: under the escalation revert the declaration test goes red but its companion pass-through test stays green, because
escalations_listpasses the raw API array through — the runtime value was always right, only the declaration was wrong.bun run lint,type-check,check:audits(39 audits),tool-metadata:check,docs:check,integration-catalog:checkandcheck-block-registry.ts origin/stagingall pass. Regenerated artifacts are committed.Deferred — same defect class, own review
A machine sweep of all 65 tools against the spec found a second tranche. Real, sampled and verified, but out of scope here because fixing them roughly triples the diff:
actions_*—due_atandexternal_issue_referenceare not onActionV2;creator.{id,name,email}is the same actor-wrapper bug fixed here forupdaterfollow_ups_list/_show— same actor-wrapper bug oncreatorincident_roles_*(4 tools) — declaredrequired, absent fromIncidentRoleV2incident_timestamps_list/_show— declaredcreated_at/updated_at;IncidentTimestampV2is only{id, name, rank}users_list—pagination_meta.total_record_countis not returned by/v2/usersoptional: trueon fields the spec marks non-requiredCleared as intentional, not drift:
on_call_now'son_call/next_on_callandincident_participants_list'sactive/passiveare synthesized aggregates;incidents.*.statusis a deliberateincident_status→statusrename intransformResponse. The eight tools with no 2xx JSON body in the spec were left untouched rather than guessed at.Checklist