claude2codex 0.3.5 → 0.3.6

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.
Files changed (2) hide show
  1. package/dist/server.js +10 -6
  2. package/package.json +1 -1
package/dist/server.js CHANGED
@@ -262,7 +262,7 @@ var CodexAppServer = class {
262
262
  */
263
263
  async initialize() {
264
264
  const result = await this.request("initialize", {
265
- clientInfo: { name: "claude2codex", title: "Claude\u2194Codex Contract Bridge", version: "0.3.5" },
265
+ clientInfo: { name: "claude2codex", title: "Claude\u2194Codex Contract Bridge", version: "0.3.6" },
266
266
  capabilities: { experimentalApi: true }
267
267
  });
268
268
  this.notify("initialized", {});
@@ -714,6 +714,10 @@ async function runAttempt(job, opts, timeoutMs) {
714
714
  }
715
715
  function finalize(state, error) {
716
716
  clearStallTimer();
717
+ if (state === "done" && job.turns === 0) {
718
+ state = "error";
719
+ error = "job ended without running a turn";
720
+ }
717
721
  finish(job, state, client, error);
718
722
  }
719
723
  function handleNotification(method, params) {
@@ -767,7 +771,7 @@ async function runAttempt(job, opts, timeoutMs) {
767
771
  tokens_used: job.goal?.tokensUsed ?? null
768
772
  });
769
773
  progress("goal_updated", `goal status=${job.goal?.status ?? "unknown"}`);
770
- if (job.goal?.status && TERMINAL_GOAL_STATUSES.has(job.goal.status) && !activeTurn) {
774
+ if (job.goal?.status && TERMINAL_GOAL_STATUSES.has(job.goal.status) && !activeTurn && job.turns > 0) {
771
775
  finalize("done");
772
776
  settle();
773
777
  }
@@ -858,11 +862,11 @@ async function runAttempt(job, opts, timeoutMs) {
858
862
  if (!job.threadId) throw new Error(`could not determine thread id from ${JSON.stringify(threadRes).slice(0, 300)}`);
859
863
  store.save(job);
860
864
  log(job, "thread", `thread ${job.threadId} ${opts.resumeThreadId ? "resumed" : "started"}`);
861
- if (opts.objective) {
865
+ if (opts.objective || opts.resumeThreadId) {
862
866
  try {
863
867
  const goalRes = await client.request("thread/goal/set", {
864
868
  threadId: job.threadId,
865
- objective: opts.objective,
869
+ ...opts.objective ? { objective: opts.objective } : { status: "active" },
866
870
  ...opts.tokenBudget ? { tokenBudget: opts.tokenBudget } : {}
867
871
  });
868
872
  job.goalSet = true;
@@ -968,7 +972,7 @@ var SERVER_INSTRUCTIONS = `When the user asks to delegate work to Codex (or to u
968
972
  If a Codex job itself fails (error, 0 tokens, no handoff), report it and wait; don't implement the task yourself unless the user explicitly asks.
969
973
  Full formats: the c2c-workflow prompt.`;
970
974
  var server = new McpServer(
971
- { name: "c2c-codex", version: "0.3.5" },
975
+ { name: "c2c-codex", version: "0.3.6" },
972
976
  { instructions: SERVER_INSTRUCTIONS }
973
977
  );
974
978
  var reasoningEffort = z.enum(["low", "medium", "high", "xhigh", "max", "ultra"]);
@@ -1127,7 +1131,7 @@ server.registerTool(
1127
1131
  "codex_rework",
1128
1132
  {
1129
1133
  title: "Send a Delta Contract to Codex",
1130
- description: "Resume the Codex thread from a previous implement job and hand it a Delta Contract (review findings + failed success conditions). The existing thread goal re-engages, so the /goal loop continues until the objective passes. Returns a new job_id.",
1134
+ description: "Resume the Codex thread from a previous implement job and hand it a Delta Contract (review findings + failed success conditions). The existing thread goal is reactivated, so the /goal loop continues until the objective passes. Returns a new job_id.",
1131
1135
  inputSchema: {
1132
1136
  job_id: z.string().optional().describe("The original implement job's id (preferred; resolves the thread to resume)."),
1133
1137
  thread_id: z.string().optional().describe("Codex thread id, if the job registry is gone (e.g. after a restart)."),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude2codex",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "type": "module",
5
5
  "description": "MCP server bridging Claude (architect/reviewer) and Codex (implementer) via Goal/Delta Contracts and Codex's thread-goal loop.",
6
6
  "bin": {