doer-agent 0.5.5 → 0.5.7

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.
@@ -13,7 +13,6 @@ const SESSION_RPC_BLOB_KEYS = new Set([
13
13
  "bytes",
14
14
  "data",
15
15
  ]);
16
- const SESSION_RPC_MAX_STRING_CHARS = 512;
17
16
  function getSessionsRootPath(workspaceRoot) {
18
17
  return path.join(workspaceRoot, ".codex", "sessions");
19
18
  }
@@ -90,19 +89,27 @@ function buildInlineBlobMarker(value) {
90
89
  }
91
90
  return "[inline blob omitted]";
92
91
  }
93
- function truncateSessionRpcString(value) {
94
- if (value.length <= SESSION_RPC_MAX_STRING_CHARS) {
95
- return value;
92
+ function getSessionRpcPayloadByteLength(value) {
93
+ try {
94
+ const serialized = typeof value === "string" ? value : JSON.stringify(value);
95
+ return typeof serialized === "string" ? Buffer.byteLength(serialized, "utf8") : null;
96
96
  }
97
- const omittedChars = value.length - SESSION_RPC_MAX_STRING_CHARS;
98
- return `${value.slice(0, SESSION_RPC_MAX_STRING_CHARS)}\n[truncated ${omittedChars} chars for session RPC]`;
97
+ catch {
98
+ return null;
99
+ }
100
+ }
101
+ function buildSessionRpcTruncatedMarker(label, value) {
102
+ const byteLength = getSessionRpcPayloadByteLength(value);
103
+ return byteLength === null
104
+ ? `[${label} truncated for session RPC pagination]`
105
+ : `[${label} truncated for session RPC pagination: ${byteLength} bytes omitted]`;
99
106
  }
100
- function sanitizeSessionRpcPayload(value, options = {}) {
107
+ function sanitizeSessionRpcPayload(value) {
101
108
  if (typeof value === "string") {
102
- return options.truncateStrings ? truncateSessionRpcString(value) : value;
109
+ return value;
103
110
  }
104
111
  if (Array.isArray(value)) {
105
- return value.map((entry) => sanitizeSessionRpcPayload(entry, options));
112
+ return value.map((entry) => sanitizeSessionRpcPayload(entry));
106
113
  }
107
114
  if (!isObjectRecord(value)) {
108
115
  return value;
@@ -113,7 +120,7 @@ function sanitizeSessionRpcPayload(value, options = {}) {
113
120
  sanitized[key] = buildInlineBlobMarker(entry);
114
121
  continue;
115
122
  }
116
- sanitized[key] = sanitizeSessionRpcPayload(entry, options);
123
+ sanitized[key] = sanitizeSessionRpcPayload(entry);
117
124
  }
118
125
  return sanitized;
119
126
  }
@@ -130,7 +137,7 @@ function sanitizeSessionRpcRawLine(line) {
130
137
  if (parsed.type === "compacted" || parsed.type === "turn_context" || parsed.type === "session_meta") {
131
138
  return JSON.stringify({
132
139
  ...parsed,
133
- payload: sanitizeSessionRpcPayload(parsed.payload, { truncateStrings: true }),
140
+ payload: buildSessionRpcTruncatedMarker("payload", parsed.payload),
134
141
  });
135
142
  }
136
143
  if (!isObjectRecord(parsed.payload)) {
@@ -146,7 +153,7 @@ function sanitizeSessionRpcRawLine(line) {
146
153
  payload: {
147
154
  type: payloadType,
148
155
  status: typeof parsed.payload.status === "string" ? parsed.payload.status : "completed",
149
- message: `[${payloadType} payload omitted for session RPC pagination]`,
156
+ message: buildSessionRpcTruncatedMarker(`${payloadType} payload`, parsed.payload),
150
157
  },
151
158
  });
152
159
  }
@@ -17,6 +17,8 @@ export function createDefaultAgentSettingsConfig() {
17
17
  codex: {
18
18
  model: "gpt-5.5",
19
19
  authMode: "api_key",
20
+ computerUseEnabled: false,
21
+ browserUseEnabled: false,
20
22
  },
21
23
  realtime: {
22
24
  model: process.env.OPENAI_REALTIME_MODEL?.trim() || "gpt-realtime",
@@ -203,6 +205,8 @@ export function normalizeAgentSettingsConfig(value, fallback) {
203
205
  codex: {
204
206
  model: typeof codex.model === "string" && codex.model.trim() ? codex.model.trim() : base.codex.model,
205
207
  authMode: codex.authMode === "oauth" ? "oauth" : codex.authMode === "api_key" ? "api_key" : base.codex.authMode,
208
+ computerUseEnabled: typeof codex.computerUseEnabled === "boolean" ? codex.computerUseEnabled : base.codex.computerUseEnabled,
209
+ browserUseEnabled: typeof codex.browserUseEnabled === "boolean" ? codex.browserUseEnabled : base.codex.browserUseEnabled,
206
210
  },
207
211
  realtime: {
208
212
  model: typeof realtime.model === "string" && realtime.model.trim() ? realtime.model.trim() : base.realtime.model,
@@ -281,6 +285,8 @@ export async function toAgentSettingsPublic(args) {
281
285
  codex: {
282
286
  model: args.config.codex.model,
283
287
  authMode: args.config.codex.authMode,
288
+ computerUseEnabled: args.config.codex.computerUseEnabled,
289
+ browserUseEnabled: args.config.codex.browserUseEnabled,
284
290
  hasApiKey: false,
285
291
  apiKeyMasked: null,
286
292
  apiKeyLength: null,
@@ -355,6 +361,8 @@ export function normalizeAgentSettingsPatch(value) {
355
361
  move("personality", "general", "personality");
356
362
  move("codexModel", "codex", "model");
357
363
  move("codexAuthMode", "codex", "authMode");
364
+ move("computerUseEnabled", "codex", "computerUseEnabled");
365
+ move("browserUseEnabled", "codex", "browserUseEnabled");
358
366
  move("realtimeModel", "realtime", "model");
359
367
  move("realtimeVoice", "realtime", "voice");
360
368
  move("realtimeWakeName", "realtime", "wakeName");
package/dist/agent.js CHANGED
@@ -283,6 +283,10 @@ async function handleRunRpcMessage(args) {
283
283
  agentProjectDir: AGENT_PROJECT_DIR,
284
284
  workspaceRoot,
285
285
  }),
286
+ "--config",
287
+ `features.computer_use=${localAgentSettings.codex.computerUseEnabled ? "true" : "false"}`,
288
+ "--config",
289
+ `features.browser_use=${localAgentSettings.codex.browserUseEnabled ? "true" : "false"}`,
286
290
  ],
287
291
  }),
288
292
  cwd: request.cwd,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doer-agent",
3
- "version": "0.5.5",
3
+ "version": "0.5.7",
4
4
  "description": "Reverse-polling agent runtime for doer",
5
5
  "type": "module",
6
6
  "main": "dist/agent.js",