Skip to content

fix(devin): add missing support for ATIF v1.7#570

Merged
iamtoruk merged 2 commits into
getagentseal:mainfrom
tvcsantos:fix/support-atif-v17
Jun 28, 2026
Merged

fix(devin): add missing support for ATIF v1.7#570
iamtoruk merged 2 commits into
getagentseal:mainfrom
tvcsantos:fix/support-atif-v17

Conversation

@tvcsantos

Copy link
Copy Markdown
Contributor

Summary

Devin now outputs in ATIF v1.7 format. This PR addresses that supporting the new format, while keeping backward compatible with the existing versions.

This PR relates and completes #526. Added @bmcdonough as co-author since the work was based on his work on the PR and also since he was actually the one finding the issues. Thanks for that @bmcdonough.

Closes #525

Testing

  • I have tested this locally against real data (not just unit tests)
  • npm test passes
  • npm run build succeeds

For new providers only:

  • I installed the tool and generated real sessions by using it
  • npm run dev -- today shows correct costs and session counts for this provider
  • npm run dev -- models --provider <name> shows correct model names and pricing
  • Screenshot or terminal output attached below proving it works with real data

Co-Authored-By: bmcdonough <18721778+bmcdonough@users.noreply.github.com>
@bmcdonough

Copy link
Copy Markdown
Contributor

@tvcsantos Thank you for your efforts getting this over the finish line. I haven't had time to get back to this.

@tvcsantos tvcsantos changed the title fix: add mssing support for ATIF v1.7 fix(devin): add mssing support for ATIF v1.7 Jun 26, 2026
@iamtoruk iamtoruk changed the title fix(devin): add mssing support for ATIF v1.7 fix(devin): add missing support for ATIF v1.7 Jun 28, 2026
… fallback

- Remove the @modelcontextprotocol/sdk JsonSchemaType import and the unused
  ToolDefinition/FunctionDefinition types it served; type Agent.tool_definitions
  as unknown since the parser never reads it (no dependency warranted).
- Remove isImageContentPart: unused, and its `"image" in part` check could never
  be true (image parts carry `source`/`type`, not `image`).
- Use the `type` discriminant in isTextContentPart instead of property presence.
- getMetricsFromStep: fall back to legacy metadata.metrics when step.metrics is
  present but empty, so a partial metrics object cannot silently zero usage.
- Tests: cover the empty step.metrics fallback and image-only message normalization.
@iamtoruk iamtoruk force-pushed the fix/support-atif-v17 branch from ebf7c32 to 74dc032 Compare June 28, 2026 16:59
@iamtoruk

Copy link
Copy Markdown
Member

Thanks for this, @tvcsantos (and @bmcdonough) — solid, well-tested ATIF v1.7 support. 🙌

I pushed one small follow-up commit on top with a few review nits:

  • Dropped the @modelcontextprotocol/sdk JsonSchemaType import and the ToolDefinition/FunctionDefinition types it served. They only existed to type Agent.tool_definitions, which the parser never reads — so this removes an unnecessary dependency from the Devin provider. tool_definitions is now unknown.
  • Removed isImageContentPart — it was unused, and its "image" in part check could never be true (image parts carry source/type, not image).
  • isTextContentPart now uses the type discriminant instead of property presence.
  • getMetricsFromStep: falls back to legacy metadata.metrics when step.metrics is present but empty, so a partial metrics object can't silently zero out usage.
  • Added two tests (empty-step.metrics fallback, image-only message) and fixed the title typo.

Validation: tsc --noEmit clean, full suite 1313/1313 passing, tsup build OK. Merging now.

@iamtoruk iamtoruk merged commit b424bf1 into getagentseal:main Jun 28, 2026
3 checks passed
@tvcsantos

Copy link
Copy Markdown
Contributor Author
  • Dropped the @modelcontextprotocol/sdk JsonSchemaType import and the ToolDefinition/FunctionDefinition types it served. They only existed to type Agent.tool_definitions, which the parser never reads — so this removes an unnecessary dependency from the Devin provider. tool_definitions is now unknown.

Makes sense, it was not used anyway 👍

  • Removed isImageContentPart — it was unused, and its "image" in part check could never be true (image parts carry source/type, not image).

Ups :D, also it was not working as expected yup 👍

  • isTextContentPart now uses the type discriminant instead of property presence.

Yup that is it. The method was broken. Should have been like you did 👍

  • getMetricsFromStep: falls back to legacy metadata.metrics when step.metrics is present but empty, so a partial metrics object can't silently zero out usage.
  • Added two tests (empty-step.metrics fallback, image-only message) and fixed the title typo.

Makes sense 👍

Thanks for reviewing it.

@tvcsantos tvcsantos deleted the fix/support-atif-v17 branch June 28, 2026 17:08
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.

devin schema version changed to ATIF-v1.7

3 participants