Commit561b2a8
fix(agent-journey): activity feed endpoint returns a bare array
fix(agent-journey): activity feed endpoint returns a bare array
GET /api/v2/repos/:owner/:repo/activity returns the array directly
(c.json(activity)), not wrapped in {events:[]}/{activity:[]}. The
journey script's optional-chaining fallback silently produced an
empty array against a real, non-empty response, false-failing step 9
against production even though the activity feed was recording
correctly.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 file changed+4−1561b2a8bf5ce65be4393c8b8a23ca89cc94d903b
1 changed file+4−1
Modifiedscripts/agent-journey.ts+4−1View fileUnifiedSplit
@@ -195,7 +195,10 @@ async function main() {
195195 await step("9. activity feed recorded push + PR events", async () => {
196196 const r = await api("GET", `/api/v2/repos/${owner}/${REPO}/activity`);
197197 if (r.status !== 200) throw new Error(`HTTP ${r.status}`);
198 const events: Array<{ type?: string }> = r.json?.events ?? r.json?.activity ?? [];
198 // GET /api/v2/repos/:owner/:repo/activity returns a bare array.
199 const events: Array<{ type?: string }> = Array.isArray(r.json)
200 ? r.json
201 : r.json?.events ?? r.json?.activity ?? [];
199202 if (!Array.isArray(events) || events.length === 0) throw new Error("no activity events");
200203 });
201204 } finally {
202205