Repository navigation
feat: allow user message when turn is running - #778
Closed
sr07asthana wants to merge 29 commits into
Closed
sr07asthana wants to merge 29 commits into
sr07asthana wants to merge 29 commits into
Conversation
sr07asthana
requested review from
bhaveshpatel640,
chiragjn,
debajyoti-truefoundry,
heerambavi1998 and
thesujai
as code owners
September 17, 2026 03:52
🦋 Changeset detectedLatest commit: 9f88cdc The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # python/trueforge_sdk/.fern/metadata.json
Resolve the session test imports while preserving steering validation and main's active executor coverage. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
There are 3 total unresolved issues (including 2 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 64133f2. Configure here.
| export interface CreateTurnInput<TTurnCustom extends object = Record<string, never>> { | ||
| turn: TurnRecordWithoutSnapshot<TTurnCustom>; | ||
| /** Threads absent on the previous turn (turn 1: the root thread; else empty). */ | ||
| /** Live threads absent on the previous turn (turn 1: the root thread; else usually empty). */ |
Contributor
There was a problem hiding this comment.
Suggested change
| /** Live threads absent on the previous turn (turn 1: the root thread; else usually empty). */ | |
| /** Threads absent on the previous turn (turn 1: the root thread; else empty). */ |
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Closes #
Changes
How was this tested?
Checklist
pnpm build,pnpm test,pnpm typecheck,pnpm lint:ci, andpnpm format:checkpass locallypackages/trueforge-sdk,python/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
Medium Risk
Changes core turn/send semantics, LLM context repair, and which threads survive across turns—easy to regress multi-thread sessions or pending-action flows if callers assumed the old blocking behavior.
Overview
Users can start a new turn with a user message while a turn is still waiting on tool approval, a client-side tool response, or an in-flight sub-agent—instead of being blocked or forced to finish pending work first.
Runtime behavior: On a user-message send, the orchestrator drops non-root threads (pending sub-agents) and the main thread runs interrupt-mode open-tool-call repair: unmatched calls on the last assistant message get synthetic tool responses saying the call was cancelled. Resume (empty send or approval/tool batches) still auto-closes only ordinary dangling tools and leaves approval/client-side/sub-agent creation calls open. Validation no longer rejects user messages while those items are pending; interrupt repair runs before validation.
Persistence:
capability_statesoncreateTurnis now the authoritative live thread set—threads omitted from it are not copied into the next turn snapshot (in-memory, Postgres, and SQLite). Homogeneous send validation errors useInvalidAgentSendInputError.Other: Root
AGENT_DONEwithstatus: 'error'no longer surfaces as turn output in the orchestrator terminal mapping. Tests cover steering over approvals/sub-agents, live-thread snapshots, and closure modes.Reviewed by Cursor Bugbot for commit 9f88cdc. Bugbot is set up for automated code reviews on this repo. Configure here.