Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .changeset/chat-session-concurrency.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
"@trigger.dev/sdk": patch
"@trigger.dev/core": patch
"@trigger.dev/sdk": minor
"@trigger.dev/core": minor
---

Chat agents can now scope concurrency per session. Pass `concurrencyKey` (for example, your chat ID or tenant ID) and trigger-time named limits via `triggerConfig.concurrency` when starting a chat session, from `chat.createStartSessionAction`, the `AgentChat` client, or a handover. Keys are never defaulted, so a session without one shares the task's keyless pool.
Expand Down
6 changes: 3 additions & 3 deletions .changeset/task-concurrency.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
"@trigger.dev/sdk": patch
"@trigger.dev/core": patch
"@trigger.dev/react-hooks": patch
"@trigger.dev/sdk": minor
"@trigger.dev/core": minor
"@trigger.dev/react-hooks": minor
---

Control a task's concurrency with the new `concurrency` option, and share limits across tasks with named concurrency limits. An inline shape caps the task itself; `concurrencyLimit()` declares a limit any task can hold (up to two named limits per task), and a trigger call can switch a run's named limits with its own `concurrency` option.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2233,8 +2233,8 @@ const limitTooltip = (
How many runs can execute at once.{" "}
</Paragraph>
<Paragraph variant="extra-small" spacing>
<InlineCode variant="extra-extra-small">1 per key (3)</InlineCode> means 1 run per
concurrency key, but at most 3 runs across all keys.{" "}
<InlineCode variant="extra-extra-small">1 per key (3)</InlineCode> means 1 run per concurrency
key, but at most 3 runs across all keys.{" "}
<InlineCode variant="extra-extra-small">2 total</InlineCode> caps every run of the queue,
keyed or not. Set using the <InlineCode variant="extra-extra-small">concurrency</InlineCode>{" "}
option in your code.
Expand Down
4 changes: 1 addition & 3 deletions packages/trigger-sdk/src/v3/createStartSessionAction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,7 @@ describe("chat.createStartSessionAction — runtime", () => {
const emptyDefault = chat.createStartSessionAction("fake-chat", {
triggerConfig: { concurrency: "" as unknown as string[] },
});
await expect(emptyDefault({ chatId: "chat-empty-limit" })).rejects.toThrow(
/non-empty strings/
);
await expect(emptyDefault({ chatId: "chat-empty-limit" })).rejects.toThrow(/non-empty strings/);

const emptyPerCall = chat.createStartSessionAction("fake-chat");
await expect(
Expand Down
Loading