23 Commits

Author SHA1 Message Date
bryane-oai db52e28f4d Remove shell expansion for git commands (#447)
* Remove shell expansion for git commands

* Version bump
2026-07-07 17:17:00 -07:00
Dominik Kundel 80c31f9957 fix: bump plugin version to 1.0.5 (#398) 2026-06-23 10:36:15 -07:00
stefanstokic-oai 430e2a8630 feat: add Claude session transfer command (#374) 2026-06-23 10:26:06 -07:00
Dominik Kundel 807e03ac9d fix: bump plugin version to 1.0.4 (#244) 2026-04-18 13:41:53 -07:00
Friende bb38412a67 fix: route /codex:rescue through the Agent tool to stop Skill recursion (#234) (#235)
* fix: route /codex:rescue through the Agent tool to stop Skill recursion (#234)

`/codex:rescue` previously combined two things that together caused a hang:

- `context: fork` in the frontmatter, which spawns a `general-purpose`
  subagent for the command body.
- Body prose "Route this request to the `codex:codex-rescue` subagent."
  without naming the transport.

When the main agent called `Skill(codex:rescue)` programmatically, the
fork resolved the ambiguous prose by trying `Skill(codex:codex-rescue)`
(unknown skill) and then falling back to `Skill(codex:rescue)`, which
re-entered this command and hung the session until the user cancelled.
No Codex job was ever created.

Naming the transport as `Agent(codex:codex-rescue)` alone is not enough:
forked general-purpose subagents do not expose the `Agent` tool, so the
forked runner cannot reach the subagent that way either. The minimal fix
is therefore two coordinated changes:

- Drop `context: fork` so the command body runs inline in the calling
  agent's context, where `Agent` is in scope.
- Say explicitly "use the `Agent` tool with `subagent_type:
  "codex:codex-rescue"`", and call out that `Skill(codex:codex-rescue)`
  and `Skill(codex:rescue)` are not valid routing paths. Add `Agent`
  to `allowed-tools` so the call does not prompt for permission.

Everything else in rescue.md (resume-candidate check, flag handling,
background/foreground semantics, operating rules) is unchanged. The
`codex:codex-rescue` subagent itself is unchanged.

Tests pin the new allow-list, the explicit `subagent_type`, the ban on
`Skill(codex:codex-rescue)`, and the absence of `context: fork`. The
existing "run the `codex:codex-rescue` subagent in the background"
assertion continues to hold since that sentence still reads correctly
with the Agent-tool transport.

Fixes openai/codex-plugin-cc#234

* test: match quoted result and cancel command arguments

---------

Co-authored-by: Dominik Kundel <dkundel@openai.com>
2026-04-18 13:38:45 -07:00
xiaolai 6a5c2ba53b fix: quote \$ARGUMENTS in cancel, result, and status commands (#168)
Unquoted \$ARGUMENTS in the ! shell commands allowed shell metacharacters
in user-supplied job IDs to be expanded before Node received them (e.g.,
`task-123; malicious-cmd` would execute the trailing command). This is
inconsistent with review.md and adversarial-review.md, which both wrap
"$ARGUMENTS" in double quotes.

Co-authored-by: claude[bot] <claude-bot@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
2026-04-08 14:48:50 -07:00
xiaolai b1156235e0 fix: declare model in codex-rescue agent frontmatter (#169)
* fix: declare model in codex-rescue agent frontmatter

The codex-rescue agent had no model field, leaving Claude Code to assign
whatever default it chooses. As a thin forwarding wrapper that issues a
single Bash call, this agent is well-suited to the haiku tier; declaring
it explicitly ensures a predictable cost profile and tier guarantee.

Co-Authored-By: Claude Code <noreply@anthropic.com>

* Update codex-rescue.md

---------

Co-authored-by: claude[bot] <claude-bot@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Dominik Kundel <dkundel@openai.com>
2026-04-08 14:28:45 -07:00
VOIDXAI c24afe8404 codex: honor --cwd when reporting session runtime (#35)
* codex: honor --cwd when reporting session runtime

* codex: keep session runtime lookup scoped to callers

---------

Co-authored-by: VOIDXAI <VOIDXAI@users.noreply.github.com>
2026-04-08 14:27:04 -07:00
Dominik Kundel 11a720b7db bump: update plugin version to 1.0.3 (#180) 2026-04-07 22:11:51 -07:00
Dominik Kundel bc8fa661a5 fix: avoid embedding large adversarial review diffs (#179)
* fix: avoid embedding large adversarial review diffs

* fix: preserve untracked content in lightweight review

* address comments

* fix: handle ENOBUFS type check in git diff sizing
2026-04-07 22:04:40 -07:00
VOIDXAI d216a5fdea codex: scope default cancel selection to the current Claude session (#84)
Co-authored-by: VOIDXAI <VOIDXAI@users.noreply.github.com>
2026-04-07 20:38:58 -07:00
VOIDXAI 40d213d13f codex: scope implicit resume-last selection to the current Claude session (#83)
Co-authored-by: VOIDXAI <VOIDXAI@users.noreply.github.com>
2026-04-07 20:15:03 -07:00
Trevin Chow 4bd783b7ce fix: gracefully handle unsupported thread/name/set on older Codex CLI (#126)
* fix: gracefully handle unsupported thread/name/set on older Codex CLI

Codex CLI v0.118.0 does not recognize the thread/name/set JSON-RPC method,
causing startThread() to throw. Thread naming is cosmetic (for job log
labels) and should not block thread creation. Wraps the call in try/catch
so it fails silently on older CLI versions.

Fixes #119

* refactor: only suppress unsupported-method errors for thread/name/set

Address Codex review feedback: the bare catch swallowed all errors
including auth, network, and server failures. Now only suppresses
errors containing 'unknown variant' or 'unknown method' (the specific
error older CLI versions return) and rethrows everything else.
2026-04-07 20:08:25 -07:00
Bhuvanesh Sridharan dd335cbc76 fix: inherit process.env in app-server spawn when no explicit env is provided (#159)
`SpawnedCodexAppServerClient.initialize()` passes `this.options.env` to
`spawn()`, but no caller ever sets `env` in options. In Node.js, passing
`undefined` for `env` gives the child process **no** environment variables,
breaking any model provider that relies on env vars (e.g. DATABRICKS_TOKEN).

Fall back to `process.env` when `this.options.env` is not set, matching the
existing pattern in `broker-lifecycle.mjs` and `codex-companion.mjs`.

Co-authored-by: Isaac

Co-authored-by: Bhuvanesh Sridharan <bhuvanesh.sridharan@databricks.com>
2026-04-07 20:07:29 -07:00
Dominik Kundel 62c351a7bf Use app-server auth status for Codex readiness (#177)
* Use app-server auth status for Codex readiness

* fix: reuse existing app server for auth checks
2026-04-07 20:06:22 -07:00
Dominik Kundel f17e7f8486 fix: respect SHELL on Windows for Git Bash (#178) 2026-04-07 19:56:34 -07:00
Dominik Kundel 594fd1e8da Fix working-tree review crash on untracked directories (#166)
* fix: skip untracked directories in review context

* fix: skip broken untracked symlinks in reviews
2026-04-06 20:45:33 -07:00
Dominik Kundel 6360899e1c chore: bump plugin version to 1.0.2 (#74) 2026-03-31 12:59:31 -07:00
Pranav 64dc174d83 Fix /codex:rescue AskUserQuestion contract (#43) 2026-03-31 12:44:30 -07:00
ZETA 1a79ae57ec fix: resolve Windows ENOENT when spawning codex app-server (#55)
* fix: add shell and windowsHide options for Windows spawn in app-server

On Windows, spawn("codex", ["app-server"]) fails with ENOENT because
Node.js cannot resolve .cmd shims without shell: true. This adds
platform-gated shell and windowsHide options to the app-server spawn
call, and uses terminateProcessTree for proper process tree cleanup
since shell: true wraps the child in cmd.exe.

Without terminateProcessTree, plain SIGTERM only kills cmd.exe and
leaves the actual codex node process orphaned — verified with 274+
zombie node.exe processes accumulating on Windows.

Fixes #32
Fixes #46

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: guard terminateProcessTree against PID reuse after process exit

ChildProcess.killed only reflects whether .kill() was called by this
process — it stays false when the child exits on its own. On Windows,
where PIDs are recycled quickly, the 50 ms timer could fire after
cmd.exe has exited and its PID has been reassigned, causing taskkill
to terminate an unrelated process.

Add an exitCode === null check so the tree-kill path is skipped once
the child has already exited.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 12:39:32 -07:00
Dominik Kundel 9cb4fe4099 Bump v1.0.1 (#22)
* chore: bump plugin version to 1.0.1

* chore: bump plugin metadata version to 1.0.1
2026-03-30 19:23:08 -07:00
Omid Rajabi cf6f8515d8 fix: add shell: true on Windows so spawnSync can resolve .cmd shims (#13)
On Windows, Node.js `spawnSync` without `shell: true` uses
`CreateProcess`, which only resolves `.exe` files. npm installs global
tools (like `codex`) as `.cmd` shims, so `spawnSync("codex", ...)`
returns ENOENT even when codex is correctly installed and on PATH.

Adding `shell: process.platform === "win32"` routes through `cmd.exe`
on Windows, which properly resolves `.cmd`, `.bat`, and PATHEXT entries.
No behavior change on macOS/Linux since the condition evaluates to false.
2026-03-30 18:54:31 -07:00
Dominik Kundel c69527eb18 Initial commit
Co-authored-by: Codex <noreply@openai.com>
2026-03-30 09:42:33 -07:00