feat: Write paused instead of done on HITL - #815
sr07asthana wants to merge 5 commits into
Conversation
🦋 Changeset detectedLatest commit: 095ddcc The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 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 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 095ddcc. Configure here.
| | TrueForge.TurnStateCancelled | ||
| | TrueForge.TurnStateDone | ||
| | TrueForge.TurnStateError | ||
| | TrueForge.TurnStatePaused |
There was a problem hiding this comment.
SDK pause types break UI adapter
High Severity
Regenerated TurnState now includes paused, and TurnStateDone no longer has requiredActions. The in-repo UI adapter still treats HITL as done plus requiredActions and does not map paused, so trueforge-ui typecheck fails and paused turns cannot be shown in chat.
Additional Locations (1)
Triggered by project rule: TrueForge review rules
Reviewed by Cursor Bugbot for commit 095ddcc. Configure here.


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
This is a breaking API/SDK shape change to turn lifecycle and store CAS rules; clients that relied on
done+required_actionsmust switch topaused+turn.update.Overview
Human-in-the-loop turns now end in
pausedwith aturn.updateevent, notdonecarrying pending approvals.TurnHandlemaps orchestratorrequired_actionstoaction_required_on_events(event ids only) and persists via the sameupdateTurnStatepath, emittingturn.updateinstead ofturn.done.The public turn model is tightened:
TurnStateDonedropsrequired_actions;TurnStatePausedis a first-classTurnState(OpenAPI, Zod, TS/Python SDK). Live updates reuseTurnStatePaused/TurnStateRunninginstead of separateTurnUpdateState*types, andActionRequiredEventis removed from the spec.Session store semantics change with pause: the first
running→ non-running write wins (so a paused turn blocks a follow-updoneuntil resume/freeze flows); session cost/duration metrics are folded only for terminal states, not on pause. Postgres/SQLite and in-memory stores align on that behavior, with new contract and stream tests for HITL approval gating.Reviewed by Cursor Bugbot for commit 095ddcc. Bugbot is set up for automated code reviews on this repo. Configure here.