@bakers-build/conductor 0.6.1-next.2 → 0.6.1-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
2
|
import { basename, dirname, join } from 'node:path';
|
|
3
|
-
import { shellQuote, stemForConfigFile, } from '@bakers-build/core';
|
|
3
|
+
import { killRunProcesses, shellQuote, stemForConfigFile, } from '@bakers-build/core';
|
|
4
4
|
import { CONDUCTOR_TOKEN_ENV, CONDUCTOR_URL_ENV, DEFAULT_ENV_DENY, matchesEnvDeny, } from '../plugins/agent.js';
|
|
5
5
|
import { resolveAgent } from '../plugins/plugins.js';
|
|
6
6
|
import { sandboxFailures } from '../plugins/sandbox-preflight.js';
|
|
@@ -576,6 +576,16 @@ export class Conductor {
|
|
|
576
576
|
catch (err) {
|
|
577
577
|
this.logger.warn({ run: runUuid, err: String(err) }, 'run tab cleanup failed');
|
|
578
578
|
}
|
|
579
|
+
// Background commands and their sandboxes outlive the closed PTY.
|
|
580
|
+
try {
|
|
581
|
+
const { pids } = await killRunProcesses(runUuid);
|
|
582
|
+
if (pids.length > 0) {
|
|
583
|
+
this.logger.info({ run: runUuid, pids }, 'ended leftover run processes');
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
catch (err) {
|
|
587
|
+
this.logger.warn({ run: runUuid, err: String(err) }, 'run process cleanup failed');
|
|
588
|
+
}
|
|
579
589
|
}
|
|
580
590
|
/**
|
|
581
591
|
* `after_run` for an ended run (BB-599), rebuilt from durable state: the
|
|
@@ -1100,6 +1110,11 @@ export class Conductor {
|
|
|
1100
1110
|
// only key names are ever logged.
|
|
1101
1111
|
const env = await this.runEnv(t, run.runUuid, run.stateAtStart, chosen.agent);
|
|
1102
1112
|
const ws = await this.serialGit(() => this.workspace.ensure(t.identifier, t.branchName, baseRef));
|
|
1113
|
+
// The backend's own vars (Git config) join the run env; core keys still win.
|
|
1114
|
+
for (const [key, value] of Object.entries(ws.env ?? {})) {
|
|
1115
|
+
if (!isReservedEnvKey(key))
|
|
1116
|
+
env[key] = value;
|
|
1117
|
+
}
|
|
1103
1118
|
// A claimable state has no project policy without a WORKFLOW.md. Warn and
|
|
1104
1119
|
// proceed so the missing project instructions are observable without
|
|
1105
1120
|
// wedging the run. `ws.instructions` is the loaded file (null when absent).
|
|
@@ -1265,7 +1280,7 @@ export class Conductor {
|
|
|
1265
1280
|
const tools = chosen.agent.withoutConductorTools
|
|
1266
1281
|
? undefined
|
|
1267
1282
|
: this.issueRunTools(run.runUuid, { worktreePath: ws.path, ticket: t });
|
|
1268
|
-
const command = chosen.agent.launchCommand(prompt, identity, ws.path, tools ? { url: tools.url } : undefined);
|
|
1283
|
+
const command = chosen.agent.launchCommand(prompt, identity, ws.path, tools ? { url: tools.url } : undefined, env);
|
|
1269
1284
|
await this.executor.startRun({
|
|
1270
1285
|
ticket: {
|
|
1271
1286
|
uuid: t.uuid,
|
|
@@ -122,10 +122,14 @@ export interface BbAgent {
|
|
|
122
122
|
* `tools`, when given, is the conductor's MCP server for this run
|
|
123
123
|
* ({@link CONDUCTOR_TOOLS_SERVER}); its bearer token is in the run env as
|
|
124
124
|
* {@link CONDUCTOR_TOKEN_ENV}. An agent that cannot add an MCP server ignores it.
|
|
125
|
+
*
|
|
126
|
+
* `env` is the run env the command starts in, for an agent whose harness
|
|
127
|
+
* filters it (Codex). Its values may be secret: never put them in argv
|
|
128
|
+
* unless the harness drops them otherwise.
|
|
125
129
|
*/
|
|
126
130
|
launchCommand(prompt: string, run?: AgentRunIdentity, workspacePath?: string, tools?: {
|
|
127
131
|
url: string;
|
|
128
|
-
}): string;
|
|
132
|
+
}, env?: Readonly<Record<string, string>>): string;
|
|
129
133
|
/**
|
|
130
134
|
* Locate and read this agent's run transcript for a run that executed in
|
|
131
135
|
* `worktreePath`. MUST return '' (never throw) when nothing is found.
|
|
@@ -14,6 +14,12 @@ export interface EnsuredWorkspace {
|
|
|
14
14
|
* them best-effort.
|
|
15
15
|
*/
|
|
16
16
|
created: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Variables the run needs from its workspace backend (e.g. Git config via
|
|
19
|
+
* `GIT_CONFIG_COUNT`). The conductor adds them to the run env; core `BB_*`
|
|
20
|
+
* keys still win.
|
|
21
|
+
*/
|
|
22
|
+
env?: Record<string, string>;
|
|
17
23
|
}
|
|
18
24
|
export interface BbWorkspace {
|
|
19
25
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bakers-build/conductor",
|
|
3
|
-
"version": "0.6.1-next.
|
|
3
|
+
"version": "0.6.1-next.3",
|
|
4
4
|
"description": "bakers.build conductor engine + CLI: registers, claims tickets via JSON:API, dispatches agents.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@dropsh/plugin-jsonapi-schema": "^0.8.2",
|
|
34
34
|
"@dropsh/plugin-oauth2": "^0.8.2",
|
|
35
|
-
"@bakers-build/core": "^0.6.1-next.
|
|
36
|
-
"@bakers-build/message": "^0.6.1-next.
|
|
35
|
+
"@bakers-build/core": "^0.6.1-next.3",
|
|
36
|
+
"@bakers-build/message": "^0.6.1-next.3",
|
|
37
37
|
"@modelcontextprotocol/sdk": "1.32.1",
|
|
38
38
|
"commander": "^12.1.0",
|
|
39
39
|
"dropsh": "^0.8.2"
|
|
40
40
|
},
|
|
41
41
|
"bakersBuild": {
|
|
42
|
-
"commit": "
|
|
42
|
+
"commit": "1531a0bb0d34ccf6b54a051fcb8b016902c31f0f",
|
|
43
43
|
"channel": "next"
|
|
44
44
|
}
|
|
45
45
|
}
|