Skip to content

Commit a0a9b08

Browse files
authored
Merge pull request #1004 from Automattic/issue/1002-agent-runtime-signal
Use neutral agent runtime signal
2 parents 6632ecf + 59053d3 commit a0a9b08

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

packages/runtime-core/src/agent-task-recipe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type { TaskInput } from "./task-input.js"
77
import { isPlainObject, stringList, stripUndefined } from "./object-utils.js"
88
import type { WorkspaceRecipe, WorkspaceRecipeMount, WorkspaceRecipeStagedFile } from "./runtime-contracts.js"
99

10-
const AGENT_RUNTIME_ENV = { WP_CODEBOX_AGENT_RUNTIME: "1" }
10+
const AGENT_RUNTIME_ENV = { WP_AGENT_RUNTIME: "1" }
1111

1212
/**
1313
* Consumer-facing agent-task request fields accepted by the reusable recipe builder.

packages/wordpress-plugin/src/class-wp-codebox-host-recipe-builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
final class WP_Codebox_Host_Recipe_Builder {
1111

12-
private const AGENT_RUNTIME_ENV = array( 'WP_CODEBOX_AGENT_RUNTIME' => '1' );
12+
private const AGENT_RUNTIME_ENV = array( 'WP_AGENT_RUNTIME' => '1' );
1313

1414
/**
1515
* @param array<int,array<string,mixed>> $paths Component contracts.

scripts/agent-runtime-signal-smoke.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ const root = mkdtempSync(join(tmpdir(), "wp-codebox-agent-runtime-signal-smoke-"
1111
try {
1212
const agentRecipe = buildAgentTaskRecipe({
1313
goal: "report agent runtime signal",
14-
runtime_env: { EXISTING_RUNTIME_ENV: "preserved", WP_CODEBOX_AGENT_RUNTIME: "caller-value" },
14+
runtime_env: { EXISTING_RUNTIME_ENV: "preserved", WP_AGENT_RUNTIME: "caller-value" },
1515
}, normalizeTaskInput({ goal: "report agent runtime signal" }), "latest")
16-
assert.equal(agentRecipe.inputs?.runtimeEnv?.WP_CODEBOX_AGENT_RUNTIME, "1")
16+
assert.equal(agentRecipe.inputs?.runtimeEnv?.WP_AGENT_RUNTIME, "1")
1717
assert.equal(agentRecipe.inputs?.runtimeEnv?.EXISTING_RUNTIME_ENV, "preserved")
18-
assert.ok(!agentRecipe.inputs?.secretEnv?.includes("WP_CODEBOX_AGENT_RUNTIME"))
18+
assert.ok(!agentRecipe.inputs?.secretEnv?.includes("WP_AGENT_RUNTIME"))
1919

2020
agentRecipe.workflow.steps = [{
2121
command: "wp-codebox.agent-sandbox-run",
2222
args: [
2323
"task=report agent runtime signal",
24-
"code=echo getenv('WP_CODEBOX_AGENT_RUNTIME') ?: 'unset';",
24+
"code=echo getenv('WP_AGENT_RUNTIME') ?: 'unset';",
2525
],
2626
}]
2727
const agentRecipePath = join(root, "agent-runtime-recipe.json")
@@ -40,7 +40,7 @@ try {
4040
workflow: {
4141
steps: [{
4242
command: "wordpress.run-php",
43-
args: ["code=echo getenv('WP_CODEBOX_AGENT_RUNTIME') ?: 'unset';"],
43+
args: ["code=echo getenv('WP_AGENT_RUNTIME') ?: 'unset';"],
4444
}],
4545
},
4646
}, null, 2))

0 commit comments

Comments
 (0)