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
Test-only and documentation changes; no production runtime or API behavior is modified. Default
pnpm testfor trueforge-core will take longer because E2E runs after unit tests.Overview
Introduces a separate Jest E2E suite for
@truefoundry/trueforge-corethat exercisesAgentThreadOrchestratorandAgentThreaddirectly (mockedILLM, no store/HTTP), mirroring production’s send → execute turn contract.Tooling:
jest.e2e.config.cjsscopestests/e2e(60s timeout,maxWorkers: 1); unitjest.config.cjsignores that tree.pnpm test:e2e/ roottest:trueforge-core:e2ewere added; packagetestnow runs unit Jest then E2E.Coverage: Three scenarios with shared
runOrchestratorTurn/expectTurnhelpers (event trace, result, root context): text-only reply;create_sub_agentdelegation and parent tool routing; pause ontool.approval.requiredand resume afterUSER_TOOL_APPROVAL. Mock streams and approval-gatedwrite_notetooling live in E2E helpers; a longtests/e2e/README.mddocuments the harness.Reviewed by Cursor Bugbot for commit 9144a39. Bugbot is set up for automated code reviews on this repo. Configure here.