Skip to content

fix: use correct API endpoint /v1/graphs/supermodel#15

Merged
greynewell merged 1 commit intosupermodeltools:mainfrom
jonathanpopham:fix/api-endpoint-path
Apr 2, 2026
Merged

fix: use correct API endpoint /v1/graphs/supermodel#15
greynewell merged 1 commit intosupermodeltools:mainfrom
jonathanpopham:fix/api-endpoint-path

Conversation

@jonathanpopham
Copy link
Copy Markdown
Contributor

@jonathanpopham jonathanpopham commented Apr 2, 2026

Summary

  • The Analyze client method and the check-architecture script were hitting /v1/supermodel, which doesn't exist on the API
  • The correct endpoint is /v1/graphs/supermodel
  • This caused all supermodel analyze invocations to receive a 302 redirect to the OAuth login page, which the CLI reported as an opaque HTTP 400

Changes

  • internal/api/client.go:57 — fix endpoint path in Analyze()
  • scripts/check-architecture/main.go:238 — fix endpoint path in callAPI()
  • internal/api/types.go:43 — update comment to match

How I found it

$ curl -v -X POST "https://api.supermodeltools.com/v1/supermodel" \
  -H "X-Api-Key: ..." -H "Idempotency-Key: ..." -F "file=@repo.zip"
# → HTTP 302 → /oauth2/authorization/github

$ curl -v -X POST "https://api.supermodeltools.com/v1/graphs/supermodel" \
  -H "X-Api-Key: ..." -H "Idempotency-Key: ..." -F "file=@repo.zip"
# → HTTP 202 → {"status":"pending",...}

Test plan

  • supermodel analyze completes successfully against a real repo
  • go run ./scripts/check-architecture passes

Summary by CodeRabbit

  • Refactor
    • Updated the Supermodel API endpoint path to a unified /v1/graphs/supermodel for improved API consistency.
  • Documentation
    • Aligned related docs and schema references to the new endpoint path.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 2, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ffcab20f-196b-4e54-9524-d5302b5ce8dc

📥 Commits

Reviewing files that changed from the base of the PR and between 077802d and 4c1314e.

📒 Files selected for processing (3)
  • internal/api/client.go
  • internal/api/types.go
  • scripts/check-architecture/main.go

Walkthrough

This PR updates the API path from /v1/supermodel to /v1/graphs/supermodel in client code, a type doc comment, and a helper script; request construction, headers, response decoding, and public signatures remain unchanged.

Changes

Cohort / File(s) Summary
API client
internal/api/client.go
POST target changed to /v1/graphs/supermodel; multipart upload, headers (Idempotency-Key, X-Api-Key), and response decoding into Graph unchanged.
Types / docs
internal/api/types.go
Updated Graph type doc comment to reference /v1/graphs/supermodel instead of /v1/supermodel.
Scripts / tooling
scripts/check-architecture/main.go
Updated documented schema path and HTTP POST endpoint to /v1/graphs/supermodel; request construction and response handling unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

A tiny route, a gentle shove,
From /supermodel to graphs above,
Three files nudged, the bytes still stream,
Same headers, same multipart dream. ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description provides good context (the problem, the solution, how it was found, and reproduction steps), but it doesn't follow the required template structure with 'What', 'Why', and 'Test plan' sections. Restructure the description to match the template: add 'What' section, organize 'Why' section, and ensure 'Test plan' checkboxes are properly formatted as in the template.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: fixing the API endpoint path from /v1/supermodel to /v1/graphs/supermodel across multiple files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch fix/api-endpoint-path

Comment @coderabbitai help to get the list of available commands and usage tips.

@jonathanpopham jonathanpopham marked this pull request as draft April 2, 2026 16:43
The analyze endpoint was pointing to /v1/supermodel which does not
exist on the API. The correct path is /v1/graphs/supermodel. This
caused all analyze requests to receive a 302 redirect to the OAuth
login page instead of reaching the graph generation pipeline.

Fixes the endpoint in the API client, the architecture check script,
and the corresponding type comment.
@greynewell greynewell force-pushed the fix/api-endpoint-path branch from 077802d to 4c1314e Compare April 2, 2026 17:04
@greynewell greynewell marked this pull request as ready for review April 2, 2026 17:05
@greynewell greynewell merged commit ee742ca into supermodeltools:main Apr 2, 2026
6 of 8 checks passed
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.

2 participants