Skip to content

Commit 35916a5

Browse files
committed
Revert "feat(providers): add codex notify argv support"
This reverts commit 32edb49.
1 parent 32edb49 commit 35916a5

4 files changed

Lines changed: 5 additions & 271 deletions

File tree

packages/providers/src/codex/definition.test.ts

Lines changed: 3 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -113,42 +113,6 @@ describe("Codex Provider Definition", () => {
113113
expect(result.argv.some((a: string) => a.startsWith("notify="))).toBe(false);
114114
});
115115

116-
it("injects notify bridge arguments when bridgeScriptPath is provided", () => {
117-
const config: ProviderConfig = { additionalArgs: ["--flag"], envVars: {} };
118-
const ctx = {
119-
sessionId: "session-123",
120-
workspacePath: "/workspace",
121-
bridgeScriptPath: "/home/test/.coder-studio/hooks/codex-bridge.js",
122-
};
123-
124-
const result = codexDefinition.buildCommand(config, ctx);
125-
126-
expect(result.argv).toEqual([
127-
"codex",
128-
"-c",
129-
'notify=["node","/home/test/.coder-studio/hooks/codex-bridge.js"]',
130-
"--flag",
131-
]);
132-
});
133-
134-
it("keeps notify injection ahead of additional args with paths that contain spaces", () => {
135-
const config: ProviderConfig = { additionalArgs: ["--flag"], envVars: {} };
136-
const ctx = {
137-
sessionId: "session-123",
138-
workspacePath: "/workspace",
139-
bridgeScriptPath: "/home/with space/codex bridge.js",
140-
};
141-
142-
const result = codexDefinition.buildCommand(config, ctx);
143-
144-
expect(result.argv).toEqual([
145-
"codex",
146-
"-c",
147-
'notify=["node","/home/with space/codex bridge.js"]',
148-
"--flag",
149-
]);
150-
});
151-
152116
it("should include additional arguments and env vars", () => {
153117
const config: ProviderConfig = {
154118
additionalArgs: ["--flag"],
@@ -168,40 +132,6 @@ describe("Codex Provider Definition", () => {
168132
});
169133
});
170134

171-
describe("buildResumeCommand", () => {
172-
it("builds a resume command and retains notify bridge injection", () => {
173-
const config: ProviderConfig = { additionalArgs: ["--flag"], envVars: { TOKEN: "abc" } };
174-
const ctx = {
175-
sessionId: "session-123",
176-
workspacePath: "/workspace",
177-
bridgeScriptPath: "/bridge.js",
178-
};
179-
180-
const result = codexDefinition.buildResumeCommand?.(config, ctx, "thread-uuid-1");
181-
182-
expect(result).toEqual({
183-
argv: ["codex", "resume", "thread-uuid-1", "-c", 'notify=["node","/bridge.js"]', "--flag"],
184-
env: {
185-
TOKEN: "abc",
186-
CODER_STUDIO_SESSION_ID: "session-123",
187-
},
188-
cwd: "/workspace",
189-
});
190-
});
191-
192-
it("omits notify injection on resume when bridgeScriptPath is missing", () => {
193-
const config: ProviderConfig = { additionalArgs: ["--flag"], envVars: {} };
194-
const ctx = {
195-
sessionId: "session-123",
196-
workspacePath: "/workspace",
197-
};
198-
199-
const result = codexDefinition.buildResumeCommand?.(config, ctx, "thread-uuid-1");
200-
201-
expect(result?.argv).toEqual(["codex", "resume", "thread-uuid-1", "--flag"]);
202-
});
203-
});
204-
205135
describe("buildSupervisorEvalCommand", () => {
206136
it("builds a supervisor eval command with codex exec --json", () => {
207137
const result = codexDefinition.buildSupervisorEvalCommand?.(
@@ -267,17 +197,11 @@ describe("Codex Provider Definition", () => {
267197
expect(codexDefinition.idleHeuristics?.idleDebounceMs).toBe(3000);
268198
});
269199

270-
it("keeps legacy hook fields absent while exposing resume and transcript resolution", () => {
200+
it("does not expose legacy hooks or transcript helpers", () => {
271201
expect("hooks" in codexDefinition).toBe(false);
272-
expect(codexDefinition.buildResumeCommand).toBeTypeOf("function");
273-
expect(codexDefinition.resolveTranscriptPath).toBeTypeOf("function");
202+
expect("buildResumeCommand" in codexDefinition).toBe(false);
203+
expect("resolveTranscriptPath" in codexDefinition).toBe(false);
274204
expect("readTranscriptExcerpt" in codexDefinition).toBe(false);
275205
});
276206
});
277-
278-
describe("resolveTranscriptPath", () => {
279-
it("returns undefined when providerSessionId is absent", () => {
280-
expect(codexDefinition.resolveTranscriptPath?.({ id: "sess-1" })).toBeUndefined();
281-
});
282-
});
283207
});

packages/providers/src/codex/definition.ts

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
11
import type { ProviderConfig, ProviderDefinition } from "@coder-studio/core";
22

33
import { type CodexConfig, codexConfigSchema } from "./config-schema.js";
4-
import { resolveCodexTranscriptPath } from "./resolve-transcript.js";
54
import { idleDebounceMs, idlePromptPatterns, sessionIdPatterns } from "./stdout-heuristics.js";
65
import { buildCodexSupervisorEvalCommand } from "./supervisor-eval.js";
76

8-
function notifyArgv(bridgeScriptPath?: string): string[] {
9-
if (!bridgeScriptPath) {
10-
return [];
11-
}
12-
13-
return ["-c", `notify=${JSON.stringify(["node", bridgeScriptPath])}`];
14-
}
15-
167
export const codexInstallMetadata = {
178
prerequisites: ["npm"],
189
manualGuideKeys: ["provider.install.nodejs.manual", "provider.install.codex.manual"],
@@ -88,26 +79,7 @@ export const codexDefinition: ProviderDefinition = {
8879
const cfg = codexConfigSchema.parse(config);
8980

9081
return {
91-
argv: ["codex", ...notifyArgv(ctx.bridgeScriptPath), ...cfg.additionalArgs],
92-
env: {
93-
...cfg.envVars,
94-
CODER_STUDIO_SESSION_ID: ctx.sessionId,
95-
},
96-
cwd: ctx.workspacePath,
97-
};
98-
},
99-
100-
buildResumeCommand(config: ProviderConfig, ctx, resumeId) {
101-
const cfg = codexConfigSchema.parse(config);
102-
103-
return {
104-
argv: [
105-
"codex",
106-
"resume",
107-
resumeId,
108-
...notifyArgv(ctx.bridgeScriptPath),
109-
...cfg.additionalArgs,
110-
],
82+
argv: ["codex", ...cfg.additionalArgs],
11183
env: {
11284
...cfg.envVars,
11385
CODER_STUDIO_SESSION_ID: ctx.sessionId,
@@ -116,8 +88,8 @@ export const codexDefinition: ProviderDefinition = {
11688
};
11789
},
11890

91+
// Full mode: no resume support yet (Codex CLI may support it later)
11992
buildSupervisorEvalCommand: buildCodexSupervisorEvalCommand,
120-
resolveTranscriptPath: resolveCodexTranscriptPath,
12193

12294
// ===== Configuration =====
12395
configSchema: codexConfigSchema,

packages/providers/src/codex/resolve-transcript.test.ts

Lines changed: 0 additions & 71 deletions
This file was deleted.

packages/providers/src/codex/resolve-transcript.ts

Lines changed: 0 additions & 91 deletions
This file was deleted.

0 commit comments

Comments
 (0)