Files
united-workforce/packages/workflow-agent-kit/__tests__/context.test.ts
T
xiaoju c2c849df7e fix(agent-kit): provide full thread context to first-time participating roles
When a role participates for the first time (e.g. committer), it previously
only received the system prompt + last step output, missing the full thread
history. This caused hallucination as the role had to guess what happened.

Changes:
- build-continuation-prompt.ts: detect first-time roles and include all
  steps' meta + content for last 2-3 steps (within quota)
- context.ts: add isFirstVisit detection helper
- types.ts: add isFirstVisit field to AgentContext
- hermes.ts: pass isFirstVisit through to prompt builder

Fixes #473
2026-05-24 15:56:39 +00:00

15 lines
674 B
TypeScript

import { describe, expect, test } from "vitest";
// We need to test buildHistory indirectly through buildContext
// since buildHistory is not exported. For now, we'll test the integration
// through the public API in a separate integration test.
describe("context module - content extraction", () => {
test("placeholder - content extraction will be tested via integration tests", () => {
// This test is a placeholder. The actual testing of content extraction
// will be done through integration tests in build-continuation-prompt.test.ts
// where we can verify that StepContext objects have the correct content field.
expect(true).toBe(true);
});
});