GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(agiloft): identify attachments by their bytes, not the content type by waleedlatif1 · Pull Request #6573 · simstudioai/sim

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #6562, from the same customer report.

Agiloft serves most attachment downloads as application/octet-stream regardless of what the file is — the reporter saw six of seven documents that way, including PDFs. Any downstream block keyed on the reported type mis-handles them, and their advice was explicit: validate the magic bytes rather than trusting the header.

  • detectAttachmentMimeType recovers the type from the leading bytes (PDF, ZIP/OOXML, JPEG, PNG, GIF, legacy OLE)
  • A header that already says something specific is kept — sniffing only fills in for a missing or octet-stream header
  • Falls back to application/octet-stream when nothing matches

Type of Change

  • Bug fix

Testing

Three unit tests: recovery from an octet-stream header, preserving a specific header, and the unknown-bytes fallback. 68 Agiloft tests, typecheck, lint, tool-metadata:check all pass.

Not verified against a live instance — same caveat as #6562.

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)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@vercel

vercel Bot commented Aug 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 12, 2026 12:04am

Request Review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vercel
vercel Bot temporarily deployed to Preview August 11, 2026 23:49 Inactive
@cursor

cursor Bot commented Aug 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

PR Summary

Low Risk
Small bug fix that reuses an existing MIME helper and only changes how Agiloft attachment types are reported, with no auth or download-path changes.

Overview
Fixes Agiloft attachment downloads returning a useless application/octet-stream MIME type. Agiloft labels most attachments that way regardless of format, which breaks downstream consumers that key off the reported type.

The retrieve route now runs the response through existing resolveEffectiveMimeType, so a generic or missing Content-Type falls back to the filename from Content-Disposition (e.g. .docx → Word MIME). Specific Content-Type headers are still preserved.

Reviewed by Cursor Bugbot for commit 585dedf. Configure here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@greptile-apps

greptile-apps Bot commented Aug 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Greptile Summary

The Agiloft retrieval route now derives a useful attachment MIME type from the upstream content type and filename, avoiding ambiguous byte-signature classification.

  • Uses the shared resolveEffectiveMimeType helper before logging and returning attachment metadata.
  • Adds route coverage proving that an octet-stream .docx response is classified using its filename.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/app/api/tools/agiloft/retrieve/route.ts Replaces the raw upstream MIME value with the shared filename-aware resolution helper; no blocking issue remains from the prior thread.
apps/sim/app/api/tools/agiloft/retrieve/route.test.ts Adds focused regression coverage for resolving an OOXML attachment served as application/octet-stream.

Reviews (2): Last reviewed commit: "fix(agiloft): resolve attachment MIME ty..." | Re-trigger Greptile

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot]
greptile-apps Bot reviewed Aug 11, 2026
View reviewed changes
Comment thread apps/sim/tools/agiloft/utils.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Aug 11, 2026
View reviewed changes
Comment thread apps/sim/tools/agiloft/utils.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/tools/agiloft/utils.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@vercel
vercel Bot temporarily deployed to Preview August 11, 2026 23:54 Inactive
@waleedlatif1
fix(agiloft): resolve attachment MIME type instead of trusting the he…
585dedf
…ader

Agiloft labels most attachments application/octet-stream whatever they
actually are, so a downstream consumer keyed on the header mis-handles
them. Resolve the type through resolveEffectiveMimeType, the shared helper
the other tool routes already use, which prefers a header that names a
real format and otherwise falls back to the filename Agiloft sends in
Content-Disposition.
@waleedlatif1
waleedlatif1 force-pushed the fix/agiloft-attachment-mime branch from c5d0e61 to 585dedf Compare August 12, 2026 00:04
@vercel
vercel Bot temporarily deployed to Preview August 12, 2026 00:04 Inactive
@waleedlatif1

waleedlatif1 commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1

waleedlatif1 commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

@cursor review

cursor[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Aug 12, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 585dedf. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@waleedlatif1
waleedlatif1 merged commit 05de463 into staging Aug 12, 2026
29 of 30 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1
waleedlatif1 deleted the fix/agiloft-attachment-mime branch August 12, 2026 00:09
@waleedlatif1 waleedlatif1 mentioned this pull request Aug 12, 2026
v0.8.0: desktop app, workflow UI, v2 endpoints #6606
Merged

This branch was previously deployed

1 inactive deployment
Preview — 585dedf5 Deployed Aug 12, 2026 by vercel[bot]
View deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@greptile-apps greptile-apps[bot] greptile-apps[bot] left review comments
@cursor cursor[bot] cursor[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@waleedlatif1
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.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.