fix(runner): record the plugin-prepared working directory (#17243)

This commit is contained in:
Nicky Leach authored and GitHub committed 2026-10-22 20:42:26 -07:00
1 parent 4c57da3708
commit 2cd6eb27c7
17 files changed
+500 -45

No files matched your search

@@ -110,7 +110,7 @@ vi.mock("./native-github-access.js", () => ({
type BackendFactoryOptions = {
runnerInstanceId?: string;
acpxRuntimeDirectory?: string;
workingDirectoryAuthority?: "local_filesystem" | "remote_runner";
workingDirectoryAuthority?: "local_filesystem" | "remote_runner" | "runner_prepared_launch";
codexTransportFactory?: (recoveryContext?: {
persistedSession?: {
driverSessionId: string;
@@ -11095,7 +11095,7 @@ describe("runnerd provider runtime wiring", () => {
expect(state.createAssignedMcpTools).toHaveBeenCalledWith(expect.objectContaining({ gatewayPublicId: "assigned-test", bearerToken: "fixture-mcp-secret" }));
expect(owner).toHaveBeenCalledWith(expect.objectContaining({ task, projectIds: target.runnerTaskProjectIds,
credentialIdentity: undefined }));
expect(state.createBackend.mock.calls.at(-1)![1]).toMatchObject({ workingDirectoryAuthority: "remote_runner", environment: {} });
expect(state.createBackend.mock.calls.at(-1)![1]).toMatchObject({ workingDirectoryAuthority: "runner_prepared_launch", environment: {} });
state.createBackend.mock.calls.at(-1)![1].codexTransportFactory!();
const options = state.createTransport.mock.calls.at(-1)![0];
expect(options).toMatchObject({ ...driver, runnerArtifact: { version: "fixture" },
@@ -11819,8 +11819,10 @@ async function createRunnerdBackendWithinSessionClaim(
return current.execute(call);
};
const backend = createNativeSessionBackend(input.execution, {
// The plugin resolves the VM directory while preparing the launch. Core keeps
// its host environment out of the plugin and records the prepared directory.
runnerInstanceId: prior?.runnerInstanceId ?? effectiveRunnerInstanceId, environment: {},
workingDirectoryAuthority: "remote_runner", dynamicTools, dynamicToolHandler: executeTool,
workingDirectoryAuthority: "runner_prepared_launch", dynamicTools, dynamicToolHandler: executeTool,
completionFeedback: async result => { await authorityEpoch.definitions(); return nativeCompletionFeedback(input.db, input.execution.binding.runId, result); },
codexTransportFactory: recovery => createRunnerdCodexTransport({ provider: provider.kind, stateDirectory: root,
...owner.driver, runnerArtifact: description.runner,