@parall/codex-agent 1.37.0 → 1.38.0
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.
- package/dist/config.d.ts +8 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +11 -0
- package/dist/dispatch.d.ts +1 -0
- package/dist/dispatch.d.ts.map +1 -1
- package/dist/dispatch.js +5 -0
- package/dist/index.js +3 -1
- package/package.json +4 -4
- package/src/config.ts +12 -0
- package/src/dispatch.ts +6 -0
- package/src/index.ts +3 -0
package/dist/config.d.ts
CHANGED
|
@@ -52,5 +52,13 @@ export declare function resolveWsUrl(apiUrl: string, explicitWsUrl?: string, swi
|
|
|
52
52
|
export declare function buildCodexRuntimeKey(agentUserId: string): string;
|
|
53
53
|
export declare function sessionStateFilePathForRuntime(stateDir: string, runtimeKey: string): string;
|
|
54
54
|
export declare function contextFilePathForSession(stateDir: string, sessionKey: string): string;
|
|
55
|
+
/**
|
|
56
|
+
* PRLL_CONTEXT_DIR root: per-lane dispatch context files, keyed by the
|
|
57
|
+
* canonical lane-key (see @parall/agent-core lane-key.ts). Anchored in the
|
|
58
|
+
* per-agent stateDir — never the workspace. Stable for the app-server's
|
|
59
|
+
* lifetime, which fixes the fork-reads-main-context mismatch of the single
|
|
60
|
+
* PRLL_CONTEXT_FILE under codex's one-process-many-threads model.
|
|
61
|
+
*/
|
|
62
|
+
export declare function dispatchContextDirPath(stateDir: string): string;
|
|
55
63
|
export declare function stepIdFilePathForSession(stateDir: string, sessionKey: string): string;
|
|
56
64
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE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AU,EAAE,MAAM,GAAG,MAAM,CAGrF"}
|
package/dist/config.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { dispatchLaneContextDir } from '@parall/agent-core';
|
|
1
2
|
import * as os from 'node:os';
|
|
2
3
|
import * as path from 'node:path';
|
|
3
4
|
function requireEnv(env, name) {
|
|
@@ -104,6 +105,16 @@ export function contextFilePathForSession(stateDir, sessionKey) {
|
|
|
104
105
|
const fileName = Buffer.from(sessionKey).toString('base64url');
|
|
105
106
|
return path.join(stateDir, 'dispatch-context', `${fileName}.json`);
|
|
106
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* PRLL_CONTEXT_DIR root: per-lane dispatch context files, keyed by the
|
|
110
|
+
* canonical lane-key (see @parall/agent-core lane-key.ts). Anchored in the
|
|
111
|
+
* per-agent stateDir — never the workspace. Stable for the app-server's
|
|
112
|
+
* lifetime, which fixes the fork-reads-main-context mismatch of the single
|
|
113
|
+
* PRLL_CONTEXT_FILE under codex's one-process-many-threads model.
|
|
114
|
+
*/
|
|
115
|
+
export function dispatchContextDirPath(stateDir) {
|
|
116
|
+
return dispatchLaneContextDir(stateDir);
|
|
117
|
+
}
|
|
107
118
|
export function stepIdFilePathForSession(stateDir, sessionKey) {
|
|
108
119
|
const fileName = Buffer.from(sessionKey).toString('base64url');
|
|
109
120
|
return path.join(stateDir, 'step-ids', `${fileName}.txt`);
|
package/dist/dispatch.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ type CodexAppServerAdapterOptions = Pick<CodexAgentConfig, 'approvalPolicy' | 'c
|
|
|
5
5
|
sessionManager: CodexSessionManager;
|
|
6
6
|
log?: GatewayLogger;
|
|
7
7
|
contextFilePath?: string;
|
|
8
|
+
contextDirPath?: string;
|
|
8
9
|
useParallProvider?: boolean;
|
|
9
10
|
};
|
|
10
11
|
export declare class CodexAppServerAdapter implements DispatchAdapter {
|
package/dist/dispatch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3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IAAI;YAiBI,aAAa;YA2Bb,OAAO;IAuFrB,OAAO,CAAC,qBAAqB;YAmCf,UAAU;IA2CxB,OAAO,CAAC,iBAAiB;CA2B1B"}
|
package/dist/dispatch.js
CHANGED
|
@@ -448,6 +448,11 @@ export class CodexAppServerAdapter {
|
|
|
448
448
|
if (this.opts.contextFilePath) {
|
|
449
449
|
env.PRLL_CONTEXT_FILE = this.opts.contextFilePath;
|
|
450
450
|
}
|
|
451
|
+
if (this.opts.contextDirPath) {
|
|
452
|
+
// Per-lane dispatch context directory — per-target lookup, so fork
|
|
453
|
+
// threads never read main's context (the PRLL_CONTEXT_FILE pitfall).
|
|
454
|
+
env.PRLL_CONTEXT_DIR = this.opts.contextDirPath;
|
|
455
|
+
}
|
|
451
456
|
// Pin the wiki workspace to the agent workspace (same convention as the
|
|
452
457
|
// OpenClaw runtime). Without this, `parall wiki` resolves mounts relative
|
|
453
458
|
// to the subprocess cwd — a `cd` into any subdirectory would silently
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import * as os from 'node:os';
|
|
3
3
|
import { ParallAgentGateway, createPlatformConfigManager, createLogger, createOtelLogger, childLogger, deriveModelIsPin, resolveRuntimeModel, parseShutdownDeadlineMs, parseForkDeadlineMs, parseDispatchDeadlineMs, parseProviderConfig, clearAllProviderCreds, llmSource, initAgentTelemetry, } from '@parall/agent-core';
|
|
4
4
|
import { ApiError, ParallClient, ParallWs } from '@parall/sdk';
|
|
5
|
-
import { buildCodexRuntimeKey, contextFilePathForSession, resolveCodexAgentConfig, resolveWsUrl, sessionStateFilePathForRuntime, stepIdFilePathForSession, } from './config.js';
|
|
5
|
+
import { buildCodexRuntimeKey, contextFilePathForSession, dispatchContextDirPath, resolveCodexAgentConfig, resolveWsUrl, sessionStateFilePathForRuntime, stepIdFilePathForSession, } from './config.js';
|
|
6
6
|
import { CodexAppServerAdapter } from './dispatch.js';
|
|
7
7
|
import { CodexSessionManager } from './session-manager.js';
|
|
8
8
|
import { ensureCodexWorkspace, ensureParallProvider, ensureWorkspaceTrusted, isParallProxyMode, } from './workspace.js';
|
|
@@ -102,6 +102,7 @@ async function main() {
|
|
|
102
102
|
sessionManager,
|
|
103
103
|
log: agentLog,
|
|
104
104
|
contextFilePath: mainContextFilePath,
|
|
105
|
+
contextDirPath: dispatchContextDirPath(config.stateDir),
|
|
105
106
|
useParallProvider,
|
|
106
107
|
});
|
|
107
108
|
// Shared by onConfigUpdate + onSessionReady. /agents/me is only consumed as
|
|
@@ -156,6 +157,7 @@ async function main() {
|
|
|
156
157
|
dispatchDeadlineMs: parseDispatchDeadlineMs(process.env.PRLL_DISPATCH_DEADLINE_MS),
|
|
157
158
|
contextFilePathForSession: (sessionKey) => contextFilePathForSession(config.stateDir, sessionKey),
|
|
158
159
|
stepIdFilePathForSession: (sessionKey) => stepIdFilePathForSession(config.stateDir, sessionKey),
|
|
160
|
+
dispatchContextDir: dispatchContextDirPath(config.stateDir),
|
|
159
161
|
onConfigUpdate: refreshPlatformConfig,
|
|
160
162
|
onSessionReady: refreshPlatformConfig,
|
|
161
163
|
onNewSession: () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parall/codex-agent",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.38.0",
|
|
4
4
|
"description": "Codex CLI bridge runtime for self-hosted Parall agents",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"smol-toml": "^1.6.1",
|
|
29
|
-
"@parall/agent-core": "1.
|
|
30
|
-
"@parall/cli": "1.
|
|
31
|
-
"@parall/sdk": "1.
|
|
29
|
+
"@parall/agent-core": "1.38.0",
|
|
30
|
+
"@parall/cli": "1.38.0",
|
|
31
|
+
"@parall/sdk": "1.38.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/node": "^22.0.0",
|
package/src/config.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { dispatchLaneContextDir } from '@parall/agent-core';
|
|
1
2
|
import * as os from 'node:os';
|
|
2
3
|
import * as path from 'node:path';
|
|
3
4
|
|
|
@@ -155,6 +156,17 @@ export function contextFilePathForSession(stateDir: string, sessionKey: string):
|
|
|
155
156
|
return path.join(stateDir, 'dispatch-context', `${fileName}.json`);
|
|
156
157
|
}
|
|
157
158
|
|
|
159
|
+
/**
|
|
160
|
+
* PRLL_CONTEXT_DIR root: per-lane dispatch context files, keyed by the
|
|
161
|
+
* canonical lane-key (see @parall/agent-core lane-key.ts). Anchored in the
|
|
162
|
+
* per-agent stateDir — never the workspace. Stable for the app-server's
|
|
163
|
+
* lifetime, which fixes the fork-reads-main-context mismatch of the single
|
|
164
|
+
* PRLL_CONTEXT_FILE under codex's one-process-many-threads model.
|
|
165
|
+
*/
|
|
166
|
+
export function dispatchContextDirPath(stateDir: string): string {
|
|
167
|
+
return dispatchLaneContextDir(stateDir);
|
|
168
|
+
}
|
|
169
|
+
|
|
158
170
|
export function stepIdFilePathForSession(stateDir: string, sessionKey: string): string {
|
|
159
171
|
const fileName = Buffer.from(sessionKey).toString('base64url');
|
|
160
172
|
return path.join(stateDir, 'step-ids', `${fileName}.txt`);
|
package/src/dispatch.ts
CHANGED
|
@@ -35,6 +35,7 @@ type CodexAppServerAdapterOptions = Pick<
|
|
|
35
35
|
sessionManager: CodexSessionManager;
|
|
36
36
|
log?: GatewayLogger;
|
|
37
37
|
contextFilePath?: string;
|
|
38
|
+
contextDirPath?: string;
|
|
38
39
|
useParallProvider?: boolean;
|
|
39
40
|
};
|
|
40
41
|
|
|
@@ -497,6 +498,11 @@ export class CodexAppServerAdapter implements DispatchAdapter {
|
|
|
497
498
|
if (this.opts.contextFilePath) {
|
|
498
499
|
env.PRLL_CONTEXT_FILE = this.opts.contextFilePath;
|
|
499
500
|
}
|
|
501
|
+
if (this.opts.contextDirPath) {
|
|
502
|
+
// Per-lane dispatch context directory — per-target lookup, so fork
|
|
503
|
+
// threads never read main's context (the PRLL_CONTEXT_FILE pitfall).
|
|
504
|
+
env.PRLL_CONTEXT_DIR = this.opts.contextDirPath;
|
|
505
|
+
}
|
|
500
506
|
// Pin the wiki workspace to the agent workspace (same convention as the
|
|
501
507
|
// OpenClaw runtime). Without this, `parall wiki` resolves mounts relative
|
|
502
508
|
// to the subprocess cwd — a `cd` into any subdirectory would silently
|
package/src/index.ts
CHANGED
|
@@ -21,6 +21,7 @@ import { ApiError, ParallClient, ParallWs } from '@parall/sdk';
|
|
|
21
21
|
import {
|
|
22
22
|
buildCodexRuntimeKey,
|
|
23
23
|
contextFilePathForSession,
|
|
24
|
+
dispatchContextDirPath,
|
|
24
25
|
resolveCodexAgentConfig,
|
|
25
26
|
resolveWsUrl,
|
|
26
27
|
sessionStateFilePathForRuntime,
|
|
@@ -140,6 +141,7 @@ async function main() {
|
|
|
140
141
|
sessionManager,
|
|
141
142
|
log: agentLog,
|
|
142
143
|
contextFilePath: mainContextFilePath,
|
|
144
|
+
contextDirPath: dispatchContextDirPath(config.stateDir),
|
|
143
145
|
useParallProvider,
|
|
144
146
|
});
|
|
145
147
|
|
|
@@ -201,6 +203,7 @@ async function main() {
|
|
|
201
203
|
contextFilePathForSession(config.stateDir, sessionKey),
|
|
202
204
|
stepIdFilePathForSession: (sessionKey) =>
|
|
203
205
|
stepIdFilePathForSession(config.stateDir, sessionKey),
|
|
206
|
+
dispatchContextDir: dispatchContextDirPath(config.stateDir),
|
|
204
207
|
onConfigUpdate: refreshPlatformConfig,
|
|
205
208
|
onSessionReady: refreshPlatformConfig,
|
|
206
209
|
onNewSession: () => {
|