Skip to content

Commit 49ed33f

Browse files
authored
Merge branch 'main' into mollifier-decision-enrolled-labels
2 parents a99eaed + 93532cd commit 49ed33f

18 files changed

Lines changed: 1952 additions & 694 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"trigger.dev": patch
3+
---
4+
5+
`trigger skills` installs Trigger.dev agent skills into your coding agent so it knows how to write tasks, schedules, realtime, and chat.agent code. The skills ship with the CLI and are copied into each tool's native skills directory (Claude Code, Cursor, GitHub Copilot, and Codex / AGENTS.md), and `trigger dev` offers to install them on first run.
6+
7+
```bash
8+
trigger skills --target claude-code
9+
```
10+
11+
Replaces the previous `install-rules` command, which stays as an alias.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: supervisor
3+
type: feature
4+
---
5+
6+
Forward per-run identity labels to the compute provider on create and restore, letting network policy select runs (e.g. private link).

apps/supervisor/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ class ManagedSupervisor {
376376
envId: message.environment.id,
377377
orgId: message.organization.id,
378378
projectId: message.project.id,
379+
hasPrivateLink: message.organization.hasPrivateLink,
379380
dequeuedAt: message.dequeuedAt,
380381
});
381382
recordPhaseSince("restore", restoreStart, undefined);

apps/supervisor/src/workloadManager/compute.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,14 @@ export class ComputeWorkloadManager implements WorkloadManager {
133133
// Strip image digest - resolve by tag, not digest
134134
const imageRef = stripImageDigest(opts.image);
135135

136+
// Labels forwarded to the compute provider for network-policy selection;
137+
// the provider promotes a configured subset to its network layer. Mirrors
138+
// the privatelink label the Kubernetes workload manager sets on the run pod.
139+
const labels: Record<string, string> = {};
140+
if (opts.hasPrivateLink) {
141+
labels.privatelink = opts.orgId;
142+
}
143+
136144
// Wide event: single canonical log line emitted in finally
137145
const event: Record<string, unknown> = {
138146
// High-cardinality identifiers
@@ -173,6 +181,7 @@ export class ComputeWorkloadManager implements WorkloadManager {
173181
deploymentVersion: opts.deploymentVersion,
174182
machine: opts.machine.name,
175183
},
184+
...(Object.keys(labels).length > 0 ? { labels } : {}),
176185
})
177186
);
178187

@@ -297,6 +306,7 @@ export class ComputeWorkloadManager implements WorkloadManager {
297306
envId?: string;
298307
orgId?: string;
299308
projectId?: string;
309+
hasPrivateLink?: boolean;
300310
dequeuedAt?: Date;
301311
}): Promise<boolean> {
302312
const metadata: Record<string, string> = {
@@ -309,6 +319,14 @@ export class ComputeWorkloadManager implements WorkloadManager {
309319
TRIGGER_WORKER_INSTANCE_NAME: this.opts.runner.instanceName,
310320
};
311321

322+
// Resupply the same labels on restore (mirror of the create path); the
323+
// provider doesn't persist them across a snapshot, so without this a
324+
// restored run would lose its policy-based network selection.
325+
const labels: Record<string, string> = {};
326+
if (opts.hasPrivateLink && opts.orgId) {
327+
labels.privatelink = opts.orgId;
328+
}
329+
312330
this.logger.verbose("restore request body", {
313331
snapshotId: opts.snapshotId,
314332
runnerId: opts.runnerId,
@@ -322,6 +340,7 @@ export class ComputeWorkloadManager implements WorkloadManager {
322340
metadata,
323341
cpu: opts.machine.cpu,
324342
memory_gb: opts.machine.memory,
343+
...(Object.keys(labels).length > 0 ? { labels } : {}),
325344
})
326345
);
327346

internal-packages/compute/src/types.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ export const InstanceCreateRequestSchema = z.object({
4242
cpu: z.number(),
4343
memory_gb: z.number(),
4444
metadata: z.record(z.unknown()).optional(),
45+
// Per-instance identity labels; the provider promotes a configured subset
46+
// to network-policy selection. Distinct from metadata, which is
47+
// observability-only and never selected on.
48+
labels: z.record(z.string()).optional(),
4549
});
4650
export type InstanceCreateRequest = z.infer<typeof InstanceCreateRequestSchema>;
4751

@@ -66,6 +70,10 @@ export const SnapshotRestoreRequestSchema = z.object({
6670
metadata: z.record(z.string()),
6771
cpu: z.number(),
6872
memory_gb: z.number(),
73+
// Per-instance identity labels; the caller must resupply the same set as on
74+
// create. The provider doesn't persist them across a snapshot, so omitting
75+
// them drops the restored run's policy-based network selection.
76+
labels: z.record(z.string()).optional(),
6977
});
7078
export type SnapshotRestoreRequest = z.infer<typeof SnapshotRestoreRequestSchema>;
7179

packages/cli-v3/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@
2424
"apis",
2525
"jobs",
2626
"background jobs",
27-
"nextjs"
27+
"nextjs",
28+
"tanstack-intent"
2829
],
2930
"files": [
30-
"dist"
31+
"dist",
32+
"skills"
3133
],
3234
"bin": {
3335
"trigger": "./dist/esm/index.js"

0 commit comments

Comments
 (0)