Skip to content

Commit 2bb7c4d

Browse files
committed
fix(runtime): re-point #4058's new /ai/agents assertion at the enveloped body
Semantic conflict, not a textual one. #4058 step 2 (#4086) landed on main while this branch was open and added `http-dispatcher.test.ts`'s "a stub slot 404s per route and keeps the /ai/agents empty list", which asserts the body is exactly `{ agents: [] }` — the shape #4053 enveloped one commit earlier. The two merge cleanly and the test fails, which is why CI caught it and the merge did not. The courtesy that test pins is unchanged: a stub-occupied AI slot still answers an empty list rather than a fault. The list just travels under `data` now, and the assertion says so — plus that no `agents` key survives at the top level, so a revert to the bare body fails here too. Also swept the repo for any other reader of the old shape. Three hits, all correct: the two negative assertions above, and `client/src/index.ts`'s `body?.agents` — which is exactly what the relocation variant keeps working. Merged main in rather than rebasing, per the branch's history so far. Verified against the full suite the way Test Core runs it — `turbo run test --filter='!@objectstack/dogfood'`: 129/129 packages, runtime 924. Two worktree-staleness traps on the way, both reading as code failures: - `plugin-auth` could not resolve `hono` — the merge moved the lockfile and I had not reinstalled. `pnpm install --frozen-lockfile` fixed it. - `runtime` failed under turbo but passed standalone — the gitignored `.objectstack/data/memory-driver.json` accumulating rows again. Neither is CI-visible; CI installs clean and checks out fresh. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CYbS3kS8xzsHNXFTzp4e2z
1 parent 6164355 commit 2bb7c4d

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

packages/runtime/src/http-dispatcher.test.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2523,7 +2523,14 @@ describe('HttpDispatcher', () => {
25232523
const agents = await dispatcher.handleAI('/ai/agents', 'GET', undefined, {}, { request: {} });
25242524
expect(agents.handled).toBe(true);
25252525
expect(agents.response?.status).toBe(200);
2526-
expect(agents.response?.body).toEqual({ agents: [] });
2526+
// #4053 enveloped this body while #4058 was in flight. The courtesy
2527+
// this test pins is unchanged — an empty list rather than a fault —
2528+
// it just travels under `data` now. `AiAgentsResponseSchema`'s
2529+
// `{ agents }` is RELOCATED, not flattened to the bare array, so
2530+
// `client.ai.agents.list()` still reads `.agents` off what
2531+
// `unwrapResponse` returns.
2532+
expect(agents.response?.body).toEqual({ success: true, data: { agents: [] }, meta: undefined });
2533+
expect(agents.response?.body?.agents).toBeUndefined();
25272534
});
25282535

25292536
// Discovery must say exactly what the domains do — one predicate feeds

0 commit comments

Comments
 (0)