Add Jest E2E tests for trueforge-core - #431
Conversation
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a3b6b85. Configure here.
| type: 'function', | ||
| function: { | ||
| name: 'create_sub_agent', | ||
| arguments: JSON.stringify({ name: 'worker', input: 'do the delegated task [output]' }), |
There was a problem hiding this comment.
Mock tool-call arguments disagree
Medium Severity
createSubAgentStream streams create_sub_agent arguments with input do the delegated task, but the generator return uses do the delegated task [output]. AgentThread persists and executes result.value.output, so the child is spawned with a different task than the streamed delta. The [output] suffix looks like a leftover debug marker rather than a real completion.
Reviewed by Cursor Bugbot for commit a3b6b85. Configure here.
a3b6b85 to
f0a0848
Compare


Summary
Adds a Jest E2E harness for
@truefoundry/trueforge-corewith a mocked LLM and a first orchestrator loop test.Changes
tests/e2etree andjest.e2e.config.cjs, kept out of unit Jestpnpm test:e2e/pnpm test:trueforge-core:e2e; corepnpm testruns units then E2EAgentThreadOrchestratorHow was this tested?
pnpm --filter @truefoundry/trueforge-core test:e2epnpm --filter @truefoundry/trueforge-core typecheckChecklist
pnpm build,pnpm test,pnpm typecheck,pnpm lint:ci, andpnpm format:checkpass locallypackages/trueforge-sdk,.github/fern/openapi/openapi.json,docs/openapi.json) — fork PRs omit SDK regen; maintainers regenerate after merge.env.exampleupdated if configuration or behavior changedNote
Low Risk
Changes are limited to test configuration, fixtures, and documentation; no production runtime or API behavior is modified.
Overview
Introduces a separate Jest E2E suite under
packages/trueforge-core/tests/e2ethat exercisesAgentThreadOrchestratorandAgentThreadwith mockedILLMstreams and no session store, matching production’ssendthenexecuteflow.Tooling:
jest.e2e.config.cjs(60s timeout,maxWorkers: 1); unitjest.config.cjsignorestests/e2e/. Corepnpm testnow runs unit Jest then E2E;pnpm test:e2eand rootpnpm test:trueforge-core:e2erun E2E only.Tests & helpers: A text-only happy path asserts events, terminal result, and root context. A dynamic sub-agent scenario uses
DynamicSubAgents/create_sub_agent, withrunOrchestratorTurn+expectTurncomparing send types, compacted execute trace, result, and root context (child thread ids normalized to<child>). Mock LLM helpers and optional turn-flow logging support debugging. A longtests/e2e/README.mddocuments scope and planned programs.Reviewed by Cursor Bugbot for commit f0a0848. Bugbot is set up for automated code reviews on this repo. Configure here.