Skip to content

fix(incidentio): align declared outputs and enum hints with the v2 API - #7306

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/tools-inc
Aug 31, 2026
Merged

fix(incidentio): align declared outputs and enum hints with the v2 API#7306
waleedlatif1 merged 2 commits into
stagingfrom
fix/tools-inc

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

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 undefined

Tool(s) Declared Actually returned
incidents_list / _create / _update / _show incident_url permalink
same description no such field — IncidentV2 has summary
incident_updates_list new_status new_incident_status
same updated_at not returned at all
same flat updater.{id,name,email} updater is ActorV2 = {alert, api_key, user, workflow}
escalations_list / _show / _create name title

IncidentV2's property list contains permalink and no incident_url; IncidentUpdateV2's required set is ['created_at','id','incident_id','new_incident_status','updater']; EscalationV2's required set includes title, status, description, priority and has no name.

Corroborating signal: incidents_show.ts already read incident.permalink correctly while also carrying a vestigial incident_url declaration.

message on incident_updates_list was declared required but is optional in the spec, and escalations_* now declare the status and updated_at the 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_incidents and workflows_update.runs_on_incidents advertised active and all. 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_type advertised datetime, user, team. The spec enum is ['single_select','multi_select','text','link','numeric'].

Refuted while checking: incident_mode on actions_list / follow_ups_list advertises standard, retrospective, test, tutorial, stream, which matches GET /v2/actions and /v2/follow_ups exactly. (The v1 enum is ['real','test','tutorial'], but neither tool targets v1.) sort_by / filter_mode on incidents_list and visibility on incidents_create also match verbatim. No change to any of them.

Backwards compatibility

Every removed field was undefined at 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> returned undefined before and still does — what changes is the reference picker, which now offers the fields that actually exist.

No tool ids, param names, required flags or visibility values changed. Consumers were grepped before every rename: the only readers of the old names were the tools' own transformResponse and types.ts. connectors/incidentio/incidentio.ts independently reads update.new_incident_status?.name ?? update.new_status?.name and is unaffected.

Type of Change

  • Bug fix

Testing

apps/sim/tools/incidentio/output_drift.test.ts — 13 tests; 17 pass in tools/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:

Reverted fix Red
permalink 2
description removal 2
new_incident_status (+ updater, updated_at) 3
escalation title 1
workflows_create.runs_on_incidents 1
workflows_update.runs_on_incidents 1
custom_fields_create.field_type 1

Each revert reddened only tests in its own describe. Assertions are exact — toEqual on property-name lists, toBe on exact description strings, no bare toThrow.

One honest caveat: under the escalation revert the declaration test goes red but its companion pass-through test stays green, because escalations_list passes 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:check and check-block-registry.ts origin/staging all 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_at and external_issue_reference are not on ActionV2; creator.{id,name,email} is the same actor-wrapper bug fixed here for updater
  • follow_ups_list / _show — same actor-wrapper bug on creator
  • incident_roles_* (4 tools) — declared required, absent from IncidentRoleV2
  • incident_timestamps_list / _show — declared created_at/updated_at; IncidentTimestampV2 is only {id, name, rank}
  • users_listpagination_meta.total_record_count is not returned by /v2/users
  • ~34 missing optional: true on fields the spec marks non-required

Cleared as intentional, not drift: on_call_now's on_call/next_on_call and incident_participants_list's active/passive are synthesized aggregates; incidents.*.status is a deliberate incident_statusstatus rename in transformResponse. The eight tools with no 2xx JSON body in the spec were left untouched rather than guessed at.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…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.
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 31, 2026 9:14pm

Request Review

@greptile-apps

greptile-apps Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR aligns incident.io workflow-facing output declarations and parameter guidance with the v2 API.

  • Exposes the actual incident permalink, incident-update actor variants, and escalation fields.
  • Removes unsupported workflow dropdown choices and corrects custom-field enum guidance.
  • Updates generated metadata, documentation, shared types, and drift-focused tests.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

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

Comment thread apps/sim/tools/incidentio/incident_updates_list.ts
Comment thread apps/sim/tools/incidentio/escalations_list.ts
Comment thread apps/sim/tools/incidentio/workflows_create.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 16 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/tools/incidentio/escalations_create.ts
Comment thread apps/sim/tools/incidentio/incident_updates_list.ts
Comment thread apps/sim/tools/incidentio/incident_updates_list.ts
Comment thread apps/sim/tools/incidentio/workflows_create.ts
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic review

@cubic-dev-ai

cubic-dev-ai Bot commented Aug 31, 2026

Copy link
Copy Markdown

@cubic review

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 17 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit f3fb445 into staging Aug 31, 2026
27 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/tools-inc branch August 31, 2026 21:19
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic review

@cubic-dev-ai

cubic-dev-ai Bot commented Aug 31, 2026

Copy link
Copy Markdown

@cubic review

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 17 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant