Skip to content

Commit a295a8b

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat(webapp)-schedules-UI-improvement
# Conflicts: # apps/webapp/app/components/BlankStatePanels.tsx # apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.sessions._index/route.tsx
2 parents 3d33e21 + 19c0763 commit a295a8b

14 files changed

Lines changed: 394 additions & 88 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: fix
4+
---
5+
6+
Exit db:seed script on success to prevent hanging.

apps/webapp/app/components/BlankStatePanels.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,17 @@ export function SessionsNone() {
207207
}
208208
>
209209
<Paragraph spacing variant="small">
210-
A session is a stateful execution of an agent. It includes two-way streaming and durable
211-
compute. A session can have multiple “Runs” associated with it.
210+
A session is a stateful execution of an agent, with two-way streaming and durable
211+
compute. A single session can have multiple runs associated with it, so one conversation
212+
can span many task triggers. The input stream carries incoming user messages, and the
213+
output stream carries everything the agent produces, including AI generation parts (text,
214+
reasoning, tool calls, etc.) and any custom data parts your task emits.
212215
</Paragraph>
213216
<Paragraph spacing variant="small">
214217
The easiest way to create one is to trigger a <InlineCode>chat.agent</InlineCode> task,
215218
which is built on sessions and handles the chat turn loop for you. You can also call{" "}
216-
<InlineCode>sessions.start()</InlineCode> directly for non-chat patterns like agent inboxes,
217-
approval flows, or server-to-server streaming.
219+
<InlineCode>sessions.start()</InlineCode> directly for non-chat patterns like agent
220+
inboxes, approval flows, or server-to-server streaming.
218221
</Paragraph>
219222
</InfoPanel>
220223
);

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.sessions._index/route.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,12 @@ function SessionsHelpTooltip() {
129129
<div>
130130
<Paragraph variant="small/bright">What is a session?</Paragraph>
131131
<Paragraph variant="small" className="mt-1">
132-
A session is a stateful execution of an agent. It includes two-way streaming and durable compute. A session can have multiple “Runs” associated with it.
132+
A session is a stateful execution of an agent, with two-way streaming and durable
133+
compute. A single session can have multiple runs associated with it, so one
134+
conversation can span many task triggers. The input stream carries incoming user
135+
messages, and the output stream carries everything the agent produces, including AI
136+
generation parts (text, reasoning, tool calls, etc.) and any custom data parts your
137+
task emits.
133138
</Paragraph>
134139
</div>
135140
<div className="flex flex-col gap-2.5 border-t border-grid-dimmed pt-3">

apps/webapp/seed.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ seed()
168168
})
169169
.finally(async () => {
170170
await prisma.$disconnect();
171+
process.exit(0);
171172
});
172173

173174
async function findOrCreateOrganization(

docs/ai-chat/how-it-works.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ This page explains how `chat.agent` is put together, what each piece does on a s
1414
**What you don't have to think about**: SSE reconnects, WebSocket backpressure, container cold starts, whether a worker is currently running, or how to re-deliver chunks the client missed during a reload. The platform handles those. **What you do have to think about**: idempotency in your `run()` function, and how much state you keep in memory between turns versus persist in your own database.
1515
</Note>
1616

17-
## The primary noun: a chat session is a pair of streams and a task
17+
## The primary noun: the chat session
1818

19-
A **chat session** is the unit chat.agent owns. It is three things bound together:
19+
A **chat session** is a stateful execution of an agent: two-way streaming plus durable compute, able to span multiple runs. It is the unit chat.agent owns, and it is three things bound together:
2020

2121
- An **inbox** channel called `.in` — every user message lands here as a record.
2222
- An **outbox** channel called `.out` — every assistant chunk leaves through here.

docs/ai-chat/sessions.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
---
22
title: "Sessions"
33
sidebarTitle: "Sessions"
4-
description: "A Session is a pair of durable streams — input carries your users' messages to the agent, output carries everything the agent produces back — plus orchestration of the runs that process them."
4+
description: "A Session is a stateful execution of an agent, with two-way streaming and durable compute. A single Session can have multiple runs associated with it."
55
---
66

77
import RcBanner from "/snippets/ai-chat-rc-banner.mdx";
88

99
<RcBanner />
1010

11-
**A Session is a pair of durable streams.** The input stream (`.in`) carries incoming user messages to your task. The output stream (`.out`) carries everything the agent produces back to your clients: AI generation parts (text, reasoning, tool calls) and any custom data parts you write.
11+
**A Session is a stateful execution of an agent.** It includes two-way streaming and durable compute, and a single Session can have multiple runs associated with it.
1212

13-
Sessions also **orchestrate the runs that process those streams**. A Session is keyed on your stable id (`externalId` — for chat, the `chatId`) and owns its current run: when a run suspends, idles out, or hands off to a new version, the Session starts or swaps to a fresh run and the streams carry on. Clients keep sending and reading against the same id; they never know a run changed underneath.
13+
The **two-way streaming** is a pair of durable streams. The input stream (`.in`) carries incoming user messages to your task. The output stream (`.out`) carries everything the agent produces back to your clients: AI generation parts (text, reasoning, tool calls) and any custom data parts you write.
14+
15+
The **durable compute** is the runs that process those streams. A Session is keyed on your stable id (`externalId` — for chat, the `chatId`) and owns its current run: when a run suspends, idles out, or hands off to a new version, the Session starts or swaps to a fresh run and the streams carry on. Clients keep sending and reading against the same id; they never know a run changed underneath.
1416

1517
```mermaid
1618
flowchart LR

docs/troubleshooting.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ If you see "Connection error" when running `trigger login` (or "Failed to create
5353
2. **VPN or firewall:** Disconnect from VPN or check firewall/proxy; try `npx trigger.dev@latest login --log-level debug` for more detail.
5454
3. **TLS / certificate store:** Node may use a different CA store than your OS (e.g. `curl` works but the CLI fails). Try `export NODE_EXTRA_CA_CERTS=/etc/ssl/cert.pem` (macOS/Linux) then login again, or reinstall Node so it gets updated certs. Behind a corporate proxy or custom CA? Set `NODE_EXTRA_CA_CERTS` to that CA file.
5555

56+
### Runs never dequeue in dev
57+
58+
If runs sit in the queue and never start while running `trigger.dev dev`, check whether you have more than one local instance running against the same project. Each project has a single dev environment, and only one `trigger.dev dev` instance can consume from it at a time, so a second instance causes runs to be split between them and some appear stuck. Keep a single `trigger.dev dev` running per project. [Upvote isolated dev sessions](https://triggerdev.featurebase.app/p/isolated-dev-sessions-for-multiple-local-trigger-dev-instances) if you need to run multiple local instances.
59+
5660
## Deployment
5761

5862
Running the [trigger.dev deploy] command builds and deploys your code. Sometimes there can be issues building your code.

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,11 @@
123123
"semver@>=5 <5.7.2": "^5.7.2",
124124
"defu@>=6 <6.1.5": "^6.1.5",
125125
"fast-uri@<3.1.2": "^3.1.2",
126-
"fast-xml-builder@<1.1.7": "^1.1.7"
126+
"js-cookie@<3.0.8": "3.0.8",
127+
"tmp@<0.2.7": "0.2.7",
128+
"brace-expansion@<1.1.13": "1.1.13",
129+
"brace-expansion@>=2 <2.0.3": "2.0.3",
130+
"brace-expansion@>=5 <5.0.6": "5.0.6"
127131
},
128132
"onlyBuiltDependencies": [
129133
"@depot/cli",

packages/plugins/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"dist"
1515
],
1616
"dependencies": {
17-
"@trigger.dev/core": "workspace:*"
17+
"@trigger.dev/core": "workspace:*",
18+
"neverthrow": "^8.2.0"
1819
},
1920
"scripts": {
2021
"clean": "rimraf dist .turbo",

packages/plugins/src/index.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,26 @@ export type {
1818
} from "./rbac.js";
1919

2020
export { buildJwtAbility } from "./rbac.js";
21+
22+
export type {
23+
SsoPlugin,
24+
SsoController,
25+
OrgSsoStatus,
26+
SsoRouteDecision,
27+
SsoFlow,
28+
SsoProfile,
29+
SsoConnectionState,
30+
SsoDomainState,
31+
SsoDomainStatus,
32+
SsoResolutionDecision,
33+
SsoDecisionError,
34+
SsoBeginError,
35+
SsoCompleteError,
36+
SsoMutationError,
37+
SsoPortalError,
38+
SsoValidateError,
39+
SsoWebhookError,
40+
SsoWebhookEvent,
41+
} from "./sso.js";
42+
43+
export { SSO_FLOWS } from "./sso.js";

0 commit comments

Comments
 (0)