Uh oh!
There was an error while loading. Please reload this page.
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.
| import { NOOP_AGENT_TRACING } from '../../src/core/tracing/NoopAgentTracing'; | ||
| import { makeDummyLogger, makeRootLLM, makeTextLLM } from './helpers'; | ||
| function makeMainLLMThread(threadId: string, reply: string, title: string): AgentThread { |
There was a problem hiding this comment.
Helper takes three string parameters
Low Severity
makeMainLLMThread takes three positional string arguments (threadId, reply, title). The repo rule requires a single options object when more than one parameter shares the same type, so callers can swap reply and title without a type error.
Triggered by project rule: TrueForge review rules
Reviewed by Cursor Bugbot for commit a3b6b85. Configure here.


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, scripts, and new E2E tests; no production runtime or auth/data paths are modified.
Overview
Introduces a separate Jest E2E suite under
packages/trueforge-core/tests/e2ethat exercisesAgentThreadOrchestratorandAgentThreadwith mockedILLMstreams and no session store, mirroring production’ssend→executeturn flow without HTTP or persistence.Tooling:
jest.e2e.config.cjs(60s timeout, single worker); unitjest.config.cjsnow ignorestests/e2e/. Root and package scripts addtest:e2e/test:trueforge-core:e2e; default@truefoundry/trueforge-coretestruns unit Jest then E2E.Tests:
orchestration.test.tsasserts a text-only happy path (events, terminal result, thread snapshot).orchestrationWithTools.test.tsdrivescreate_sub_agent→ child thread → parent resume, with logging only (assertions called out as TODO in the README). Sharedhelpers.tsbuilds scripted streaming LLMs. A longtests/e2e/README.mddocuments design, event sequences, and planned programs 3–5.Reviewed by Cursor Bugbot for commit a3b6b85. Bugbot is set up for automated code reviews on this repo. Configure here.