Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion plugins/codex/scripts/lib/git.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ export function resolveReviewTarget(cwd, options = {}) {

const requestedScope = options.scope ?? "auto";
const baseRef = options.base ?? null;
const state = getWorkingTreeState(cwd);
const supportedScopes = new Set(["auto", "working-tree", "branch"]);

if (baseRef) {
Expand Down Expand Up @@ -172,6 +171,8 @@ export function resolveReviewTarget(cwd, options = {}) {
};
}

const state = getWorkingTreeState(cwd);

if (state.isDirty) {
return {
mode: "working-tree",
Expand Down
5 changes: 1 addition & 4 deletions plugins/codex/scripts/lib/state.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import os from "node:os";
import path from "node:path";

import { resolveWorkspaceRoot } from "./workspace.mjs";
import { nowIso } from "./tracked-jobs.mjs";

const STATE_VERSION = 1;
const PLUGIN_DATA_ENV = "CLAUDE_PLUGIN_DATA";
Expand All @@ -12,10 +13,6 @@ const STATE_FILE_NAME = "state.json";
const JOBS_DIR_NAME = "jobs";
const MAX_JOBS = 50;

function nowIso() {
return new Date().toISOString();
}

function defaultState() {
return {
version: STATE_VERSION,
Expand Down
2 changes: 1 addition & 1 deletion plugins/codex/scripts/session-lifecycle-hook.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,5 @@ async function main() {

main().catch((error) => {
process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
process.exit(1);
process.exitCode = 1;
});