@ours.network/fleet 1.1.0-nightly.3 → 1.1.0-nightly.5

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,9 +1,9 @@
1
1
  {
2
- "version": "1.1.0-nightly.3",
3
- "buildId": "ecb06fff91d3",
4
- "commit": "87f6db6848b924074b76ce19f15a6b15866c4da3",
2
+ "version": "1.1.0-nightly.5",
3
+ "buildId": "7a0d408032b9",
4
+ "commit": "f5fd6cbade0e4f19e4c65d76b4ac170388a13665",
5
5
  "dirty": true,
6
- "builtAt": "2026-08-30T17:21:38.816Z",
6
+ "builtAt": "2026-08-30T19:55:15.112Z",
7
7
  "capabilities": [
8
8
  "monitor.interrupt.after_tool"
9
9
  ]
@@ -17,6 +17,10 @@ export interface ResolvedBrainSelection {
17
17
  model?: string | null;
18
18
  harnessOptions?: Record<string, unknown>;
19
19
  }
20
+ export interface AgentSessionConfigSelection {
21
+ configId: string;
22
+ value: string;
23
+ }
20
24
  export interface AgentSessionStartOptions {
21
25
  role: ResolvedRole;
22
26
  prep: SessionPrep;
@@ -42,5 +46,6 @@ export interface AgentSessionAdapter {
42
46
  /** Harness-owned environment channel used to pin/recover a model, if any. */
43
47
  modelEnvironmentVariable(): string | undefined;
44
48
  prepareLaunch(role: ResolvedRole, prep: SessionPrep): PreparedAgentSessionLaunch;
49
+ sessionConfigSelections(role: ResolvedRole): AgentSessionConfigSelection[];
45
50
  start(options: AgentSessionStartOptions): Promise<AgentSession>;
46
51
  }
@@ -6,6 +6,7 @@ export interface ClaudeCodeSessionStrategy {
6
6
  resolveBrain: AgentSessionAdapter['resolveBrain'];
7
7
  modelEnvironmentVariable: AgentSessionAdapter['modelEnvironmentVariable'];
8
8
  prepareLaunch(role: ResolvedRole, prep: SessionPrep): PreparedAgentSessionLaunch;
9
+ sessionConfigSelections(role: ResolvedRole): ReturnType<AgentSessionAdapter['sessionConfigSelections']>;
9
10
  permissionModeId(role: ResolvedRole): string | undefined;
10
11
  mcpServers(role: ResolvedRole): AcpMcpServer[] | undefined;
11
12
  sessionMeta(role: ResolvedRole, prep: SessionPrep): Record<string, unknown> | undefined;
@@ -18,5 +19,6 @@ export declare class ClaudeCodeAgentSessionAdapter implements AgentSessionAdapte
18
19
  resolveBrain(brain: Parameters<AgentSessionAdapter['resolveBrain']>[0]): import("./agent-session.js").ResolvedBrainSelection;
19
20
  modelEnvironmentVariable(): string | undefined;
20
21
  prepareLaunch(role: ResolvedRole, prep: SessionPrep): PreparedAgentSessionLaunch;
22
+ sessionConfigSelections(role: ResolvedRole): import("./agent-session.js").AgentSessionConfigSelection[];
21
23
  start(options: AgentSessionStartOptions): Promise<import("../index.js").AgentSession>;
22
24
  }
@@ -15,6 +15,9 @@ export class ClaudeCodeAgentSessionAdapter {
15
15
  prepareLaunch(role, prep) {
16
16
  return this.strategy.prepareLaunch(role, prep);
17
17
  }
18
+ sessionConfigSelections(role) {
19
+ return this.strategy.sessionConfigSelections(role);
20
+ }
18
21
  start(options) {
19
22
  const { role, prep, launch } = options;
20
23
  return this.transport({
@@ -23,6 +26,7 @@ export class ClaudeCodeAgentSessionAdapter {
23
26
  modeId: this.strategy.permissionModeId(role),
24
27
  mcpServers: this.strategy.mcpServers(role),
25
28
  sessionMeta: this.strategy.sessionMeta(role, prep),
29
+ configSelections: this.strategy.sessionConfigSelections(role),
26
30
  permissionMode: options.permissionMode,
27
31
  permissionMetadataSource: acpAdapterState(launch.adapterState).permissionMetadataSource,
28
32
  scrubObsoleteOursAutostart: true,
@@ -247,6 +247,8 @@ export function makeClaudeCodeAdapter(exec = realExec, transport) {
247
247
  : bundledAcpAgent('@agentclientprotocol/claude-agent-acp', 'claude-agent-acp', 'claude-agent-acp');
248
248
  return { argv, env: prep.env };
249
249
  },
250
+ sessionConfigSelections: role => typeof role.effort === 'string'
251
+ ? [{ configId: 'effort', value: role.effort }] : [],
250
252
  permissionModeId: role => permissionMode(role),
251
253
  mcpServers: role => acpMcpServersFor(role.harness_options?.mcp_servers),
252
254
  sessionMeta(role, prep) {
@@ -6,6 +6,7 @@ export interface CodexSessionStrategy {
6
6
  resolveBrain: AgentSessionAdapter['resolveBrain'];
7
7
  modelEnvironmentVariable: AgentSessionAdapter['modelEnvironmentVariable'];
8
8
  prepareLaunch(role: ResolvedRole, prep: SessionPrep): PreparedAgentSessionLaunch;
9
+ sessionConfigSelections(role: ResolvedRole): ReturnType<AgentSessionAdapter['sessionConfigSelections']>;
9
10
  permissionModeId(role: ResolvedRole): string | undefined;
10
11
  mcpServers(role: ResolvedRole): AcpMcpServer[] | undefined;
11
12
  sessionMeta(role: ResolvedRole, prep: SessionPrep): Record<string, unknown> | undefined;
@@ -18,5 +19,6 @@ export declare class CodexAgentSessionAdapter implements AgentSessionAdapter {
18
19
  resolveBrain(brain: Parameters<AgentSessionAdapter['resolveBrain']>[0]): import("./agent-session.js").ResolvedBrainSelection;
19
20
  modelEnvironmentVariable(): string | undefined;
20
21
  prepareLaunch(role: ResolvedRole, prep: SessionPrep): PreparedAgentSessionLaunch;
22
+ sessionConfigSelections(role: ResolvedRole): import("./agent-session.js").AgentSessionConfigSelection[];
21
23
  start(options: AgentSessionStartOptions): Promise<import("../index.js").AgentSession>;
22
24
  }
@@ -15,6 +15,9 @@ export class CodexAgentSessionAdapter {
15
15
  prepareLaunch(role, prep) {
16
16
  return this.strategy.prepareLaunch(role, prep);
17
17
  }
18
+ sessionConfigSelections(role) {
19
+ return this.strategy.sessionConfigSelections(role);
20
+ }
18
21
  start(options) {
19
22
  const { role, prep, launch } = options;
20
23
  return this.transport({
@@ -23,6 +26,7 @@ export class CodexAgentSessionAdapter {
23
26
  modeId: this.strategy.permissionModeId(role),
24
27
  mcpServers: this.strategy.mcpServers(role),
25
28
  sessionMeta: this.strategy.sessionMeta(role, prep),
29
+ configSelections: this.strategy.sessionConfigSelections(role),
26
30
  permissionMode: options.permissionMode,
27
31
  permissionMetadataSource: acpAdapterState(launch.adapterState).permissionMetadataSource,
28
32
  scrubObsoleteOursAutostart: true,
@@ -274,6 +274,12 @@ export function makeCodexAdapter(exec = realExec, transport) {
274
274
  ? { adapterState: { permissionMetadataSource } } : {}),
275
275
  };
276
276
  },
277
+ sessionConfigSelections: role => [
278
+ ...(typeof role.model === 'string'
279
+ ? [{ configId: 'model', value: role.model }] : []),
280
+ ...(typeof role.effort === 'string'
281
+ ? [{ configId: 'reasoning_effort', value: role.effort }] : []),
282
+ ],
277
283
  permissionModeId: role => acpAgentMode(role),
278
284
  mcpServers: () => undefined,
279
285
  sessionMeta: () => undefined,
@@ -36,6 +36,11 @@ export interface AcpSessionOptions {
36
36
  permissions: CommonPermissions;
37
37
  /** Native permission-mode id to request via session/set_mode; undefined keeps the agent default. */
38
38
  modeId?: string;
39
+ /** Ordered explicit Brain choices that must be applied before readiness. */
40
+ configSelections?: Array<{
41
+ configId: string;
42
+ value: string;
43
+ }>;
39
44
  /** Adapter-resolved live permission policy; separate from ACP agent-specific session modes. */
40
45
  permissionMode?: NonNullable<SessionSnapshot['permissionMode']>;
41
46
  /** Adapter-authenticated request-metadata vocabulary; never inferred from ACP `_meta`. */
@@ -1027,13 +1027,15 @@ export class AcpSession {
1027
1027
  const persisted = this.options.mode === 'resume' && existsSync(this.sessionFile)
1028
1028
  ? readFileSync(this.sessionFile, 'utf8').trim()
1029
1029
  : '';
1030
+ let advertisedConfigOptions;
1030
1031
  if (persisted && this.capabilities?.sessionCapabilities?.resume != null) {
1031
1032
  const resumed = await this.connection.agent.request(acp.methods.agent.session.resume, {
1032
1033
  sessionId: persisted,
1033
1034
  cwd: this.options.cwd,
1034
1035
  mcpServers: this.declaredMcpServers(),
1035
1036
  });
1036
- this.captureRuntimeMetadata(resumed.configOptions);
1037
+ advertisedConfigOptions = resumed.configOptions;
1038
+ this.captureRuntimeMetadata(advertisedConfigOptions);
1037
1039
  this.sessionId = persisted;
1038
1040
  }
1039
1041
  else if (persisted && this.capabilities?.loadSession) {
@@ -1046,7 +1048,8 @@ export class AcpSession {
1046
1048
  cwd: this.options.cwd,
1047
1049
  mcpServers: this.declaredMcpServers(),
1048
1050
  });
1049
- this.captureRuntimeMetadata(loaded.configOptions);
1051
+ advertisedConfigOptions = loaded.configOptions;
1052
+ this.captureRuntimeMetadata(advertisedConfigOptions);
1050
1053
  }
1051
1054
  finally {
1052
1055
  this.replaying = false;
@@ -1060,8 +1063,29 @@ export class AcpSession {
1060
1063
  ...(this.options.sessionMeta ? { _meta: this.options.sessionMeta } : {}),
1061
1064
  });
1062
1065
  this.sessionId = created.sessionId;
1063
- this.captureRuntimeMetadata(created.configOptions);
1066
+ advertisedConfigOptions = created.configOptions;
1067
+ this.captureRuntimeMetadata(advertisedConfigOptions);
1064
1068
  }
1069
+ for (const selection of this.options.configSelections ?? []) {
1070
+ if (!advertisedConfigOptions?.some(option => option.id === selection.configId))
1071
+ throw new Error(`ACP agent did not advertise required session config option '${selection.configId}'`);
1072
+ let configured;
1073
+ try {
1074
+ configured = await this.connection.agent.request(acp.methods.agent.session.setConfigOption, { sessionId: this.sessionId, configId: selection.configId, value: selection.value });
1075
+ }
1076
+ catch (error) {
1077
+ throw new Error(`ACP agent refused required session config option '${selection.configId}' value '${selection.value}': `
1078
+ + (error instanceof Error ? error.message : String(error)));
1079
+ }
1080
+ advertisedConfigOptions = configured.configOptions;
1081
+ this.captureRuntimeMetadata(advertisedConfigOptions);
1082
+ const applied = advertisedConfigOptions.find(option => option.id === selection.configId);
1083
+ if (applied?.currentValue !== selection.value)
1084
+ throw new Error(`ACP agent did not apply required session config option '${selection.configId}' value '${selection.value}'`);
1085
+ }
1086
+ // Do not persist a session until every required Brain choice is live. A
1087
+ // failed startup closes the ACP session; persisting its id first would make
1088
+ // a later resume repeatedly target that invalid session.
1065
1089
  writeFileSync(this.sessionFile, this.sessionId + '\n', { mode: 0o600 });
1066
1090
  // Deliver the configured permission mode whichever way the session came up
1067
1091
  // (new, resume or load) — the launch flag never reaches an ACP agent. A
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ours.network/fleet",
3
- "version": "1.1.0-nightly.3",
3
+ "version": "1.1.0-nightly.5",
4
4
  "description": "Harness-agnostic fleet of persistent, identity-bound AI agents. Declarative fleet.yaml, ACP sessions, supervision, and ours.network messaging.",
5
5
  "type": "module",
6
6
  "license": "FSL-1.1-Apache-2.0",