agentListingProjection.test.ts 954 B

1234567891011121314151617181920
  1. import { describe, expect, it } from "vitest";
  2. import { zcodeSyntheticUserMessageSourceSchema } from "../src/zcode-protocol-legacy-types.js";
  3. import {
  4. getConversationMessageProjectionPolicy,
  5. getConversationModelOnlyTurnTriggerSource,
  6. } from "../src/conversation-message-projection-policy.js";
  7. describe("agent listing shared projection", () => {
  8. it("accepts the persisted source and keeps it as provider context without a turn trigger", () => {
  9. expect(zcodeSyntheticUserMessageSourceSchema.parse("agent_listing_delta")).toBe(
  10. "agent_listing_delta",
  11. );
  12. const message = {
  13. info: { role: "user", source: "agent_listing_delta", synthetic: true },
  14. parts: [{ type: "text", text: "Available agent types for the Agent tool:", synthetic: true }],
  15. };
  16. expect(getConversationMessageProjectionPolicy(message)).toBe("providerContextOnly");
  17. expect(getConversationModelOnlyTurnTriggerSource(message)).toBeNull();
  18. });
  19. });