feat(plugin-sdk): thread agentId into environmentAcquireLease params

Add an optional agentId field to PluginEnvironmentAcquireLeaseParams and
thread it through the host's environment-runtime + run-orchestrator call
sites so plugin-backed sandbox providers can scope lease state (subdirs,
PVCs, etc.) per agent without an SDK callback or DB lookup.

The field is required-but-nullable on the internal EnvironmentDriverAcquireInput
(string | null) so every call site has to think about whether it has an
agent context. Ad-hoc operator probes (agent test-environment route)
pass null. The plugin RPC payload omits the field entirely when null,
keeping wire compatibility with older plugin worker SDKs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-12 07:33:10 -04:00
parent eaa80cf88b
commit 417782a6ec
5 changed files with 28 additions and 0 deletions
@@ -209,6 +209,7 @@ describeEmbeddedPostgres("heartbeat plugin environments", () => {
issueId: null,
config: { template: "base" },
runId: run!.id,
agentId,
workspaceMode: "shared_workspace",
});
await vi.waitFor(() => {
@@ -426,6 +427,7 @@ describeEmbeddedPostgres("heartbeat plugin environments", () => {
issueId,
config: { template: "new" },
runId: run!.id,
agentId,
workspaceMode: "shared_workspace",
});
}, 15_000);