Summary
OpenCLI autofix repaired this adapter locally, and the retry passed.
Adapter
- Site:
instagram
- Command:
following
- OpenCLI version:
1.7.22
- File:
clis/instagram/following.js
Original failure
- Error code:
API_ERROR (surfaced as UNKNOWN / HTTP 400)
Error: Failed to fetch following: HTTP 400
opencli instagram following <user> --limit N succeeds for N up to ~200 but throws HTTP 400 for larger limits (250/296/300). Root cause: the adapter issues a single request to /api/v1/friendships/{userId}/following/?count={limit} with the user-supplied limit passed straight through as count. Instagram's friendships endpoint rejects large count values with HTTP 400, and the adapter never paginates — so any account followed by more than ~200 users cannot be fully listed.
Local fix summary
Replaced the single fetch with a pagination loop: fetch a safe page (count=50),
follow the `next_max_id` cursor, accumulate + dedupe by `pk`, with light pacing
(~400ms) between pages, until `limit` results are gathered or the cursor runs out.
Verified against an account following 296 — full list now returns (295 unique).
Issue filed by OpenCLI autofix after a verified local repair.
Summary
OpenCLI autofix repaired this adapter locally, and the retry passed.
Adapter
instagramfollowing1.7.22clis/instagram/following.jsOriginal failure
API_ERROR(surfaced asUNKNOWN/HTTP 400)opencli instagram following <user> --limit Nsucceeds forNup to ~200 but throwsHTTP 400for larger limits (250/296/300). Root cause: the adapter issues a single request to/api/v1/friendships/{userId}/following/?count={limit}with the user-suppliedlimitpassed straight through ascount. Instagram's friendships endpoint rejects largecountvalues with HTTP 400, and the adapter never paginates — so any account followed by more than ~200 users cannot be fully listed.Local fix summary
Issue filed by OpenCLI autofix after a verified local repair.