feat(chat): expose endAndContinue to custom agents - #4645
Conversation
🦋 Changeset detectedLatest commit: fcefcf5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 29 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 |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
WalkthroughAdded ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hi @gtremper, thanks for your interest in contributing! This project requires that pull request authors are vouched, and you are not in the list of vouched users. This PR will be closed automatically. See https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md for more details. |
|
This was superseded by #4647 |
Summary
Raw
chat.customAgent()loops can now callchat.endAndContinue()to move the Session to a fresh run. The managed loop already used the same server operation throughchat.requestUpgrade(), but raw loops could not call it directly.Call the method between turns after detaching the old run input listeners. Await it and return immediately. Unconsumed
.inrecords stay on the Session for the continuation run.I put this on the
chatnamespace next to the other raw chat primitives. Happy to move it if maintainers prefer a different API placement.Testing
pnpm exec vitest runinpackages/trigger-sdk(376 tests)pnpm run buildinpackages/trigger-sdkpnpm run formatpnpm run lintChecklist
Changelog
Allow custom chat agents to rotate to a new task version without dropping unconsumed Session input.