Commit 1a81429
fix: handle async 202 job polling and nested graph response
The /v1/graphs/supermodel endpoint returns HTTP 202 with an async job
envelope (status, jobId, retryAfter, result). The client was treating
this as a completed response and unmarshalling directly into Graph,
resulting in 0 nodes/relationships.
Changes:
- Add JobResponse and jobResult types for the async envelope
- Poll with the same idempotency key until status is "completed"
- Extract graph from the nested result.graph path
- Extract postZip helper to avoid duplicating multipart construction
Tested live against api.supermodeltools.com — correctly returns
362 files, 1527 functions, 7741 relationships for supermodel-public-api.1 parent cc523eb commit 1a81429
2 files changed
+65
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
36 | 39 | | |
37 | | - | |
| 40 | + | |
38 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
39 | 82 | | |
40 | 83 | | |
41 | 84 | | |
| |||
53 | 96 | | |
54 | 97 | | |
55 | 98 | | |
56 | | - | |
57 | | - | |
| 99 | + | |
| 100 | + | |
58 | 101 | | |
59 | 102 | | |
60 | | - | |
| 103 | + | |
61 | 104 | | |
62 | 105 | | |
63 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
4 | 7 | | |
5 | 8 | | |
6 | 9 | | |
| |||
90 | 93 | | |
91 | 94 | | |
92 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
93 | 110 | | |
94 | 111 | | |
95 | 112 | | |
| |||
0 commit comments