Skip to content
Draft
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
6 changes: 3 additions & 3 deletions docs/superpowers/plans/2026-05-29-codex-hooks-slice-b.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

**Reference spec:** `docs/superpowers/specs/2026-05-29-codex-hooks-slice-b-design.md`

**Worktree:** `C:\yuazha\GitRepo\intelligent-terminal\.worktree\codex-session` (branch `dev/yuazha/codex-session`, PR #98).
**Worktree:** `C:\<user>\GitRepo\intelligent-terminal\.worktree\codex-session` (branch `dev/<user>/codex-session`, PR #98).

---

Expand Down Expand Up @@ -48,7 +48,7 @@ The bundle files (Task 2) are created early so later Rust tests can stat real pa

```powershell
$env:RUSTUP_TOOLCHAIN="stable"
cd C:\yuazha\GitRepo\intelligent-terminal\.worktree\codex-session
cd C:\<user>\GitRepo\intelligent-terminal\.worktree\codex-session
cargo test --manifest-path tools/wta/Cargo.toml
```

Expand Down Expand Up @@ -1234,7 +1234,7 @@ git commit -m "feat(settings): add Codex CLI row to AI Agents page`n`nCo-authore

```powershell
$env:RUSTUP_TOOLCHAIN="stable"
cd C:\yuazha\GitRepo\intelligent-terminal\.worktree\codex-session
cd C:\<user>\GitRepo\intelligent-terminal\.worktree\codex-session
cargo test --manifest-path tools/wta/Cargo.toml
```

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Codex hooks — slice B design

**Date:** 2026-05-29
**Branch:** `dev/yuazha/codex-session`
**Branch:** `dev/<user>/codex-session`
**Builds on:** slice A (read-only Codex session discovery, merged into PR #98)
**Successor:** slice C (l10n, docs, ut_app fixtures, ACP `loadSession`)

Expand Down Expand Up @@ -50,7 +50,7 @@ Both commands run with stdin closed and 30-second timeout. Output captured to tr
#### `status_for_codex(home)`

**Primary path** (CLI on PATH):
- `codex plugin marketplace list` → text-parse columns `MARKETPLACE ROOT`, look for row whose name == `wt-local`. Set `marketplace_registered` and `marketplace_path` from the `ROOT` column. Compute `marketplace_path_valid` by stat'ing the path (`directory` exists check, same logic as Claude/Copilot).
- `codex plugin marketplace list` → text-parse columns `MARKETPLACE ROOT`, look for row whose name == `wt-local`. Set `marketplace_registered` and `marketplace_path` from the `ROOT` column. Compute `marketplace_path_valid` by running stat on the path (`directory` exists check, same logic as Claude/Copilot).
- `codex plugin list` → text-parse for a row whose `PLUGIN` column == `wt-agent-hooks`. Set `plugin_installed`. Codex has no enable/disable distinction in `plugin list` output → `plugin_enabled := plugin_installed`.

**Filesystem fallback** (CLI not on PATH or commands fail):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Expand Down Expand Up @@ -2822,6 +2822,10 @@
<value>Gemini hooks werden entfernt...</value>
<comment>Status summary shown while removing agent session tracking hooks for Gemini. {Locked="Gemini","hooks"}</comment>
</data>
<data name="AIAgents_HooksRemovingCodexSummary" xml:space="preserve">
<value>Removing Codex hooks...</value>
<comment>Status summary shown while removing agent session tracking hooks for Codex. {Locked="Codex","hooks"}</comment>
</data>
<data name="AIAgents_HooksLocateWtaFailedSummary" xml:space="preserve">
<value>Fehler: wta.exe konnte nicht gefunden werden</value>
<comment>Failure summary shown when the Settings UI cannot find the WTA helper executable. {Locked="wta.exe"}</comment>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Expand Down Expand Up @@ -2822,6 +2822,10 @@
<value>Quitando hooks de Gemini...</value>
<comment>Status summary shown while removing agent session tracking hooks for Gemini. {Locked="Gemini","hooks"}</comment>
</data>
<data name="AIAgents_HooksRemovingCodexSummary" xml:space="preserve">
<value>Removing Codex hooks...</value>
<comment>Status summary shown while removing agent session tracking hooks for Codex. {Locked="Codex","hooks"}</comment>
</data>
<data name="AIAgents_HooksLocateWtaFailedSummary" xml:space="preserve">
<value>Error: no se pudo encontrar wta.exe</value>
<comment>Failure summary shown when the Settings UI cannot find the WTA helper executable. {Locked="wta.exe"}</comment>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Expand Down Expand Up @@ -2823,6 +2823,10 @@
<value>Suppression des hooks Gemini...</value>
<comment>Status summary shown while removing agent session tracking hooks for Gemini. {Locked="Gemini","hooks"}</comment>
</data>
<data name="AIAgents_HooksRemovingCodexSummary" xml:space="preserve">
<value>Removing Codex hooks...</value>
<comment>Status summary shown while removing agent session tracking hooks for Codex. {Locked="Codex","hooks"}</comment>
</data>
<data name="AIAgents_HooksLocateWtaFailedSummary" xml:space="preserve">
<value>Échec : impossible de trouver wta.exe</value>
<comment>Failure summary shown when the Settings UI cannot find the WTA helper executable. {Locked="wta.exe"}</comment>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Expand Down Expand Up @@ -2822,6 +2822,10 @@
<value>Rimozione degli hooks Gemini...</value>
<comment>Status summary shown while removing agent session tracking hooks for Gemini. {Locked="Gemini","hooks"}</comment>
</data>
<data name="AIAgents_HooksRemovingCodexSummary" xml:space="preserve">
<value>Removing Codex hooks...</value>
<comment>Status summary shown while removing agent session tracking hooks for Codex. {Locked="Codex","hooks"}</comment>
</data>
<data name="AIAgents_HooksLocateWtaFailedSummary" xml:space="preserve">
<value>Operazione non riuscita: impossibile trovare wta.exe</value>
<comment>Failure summary shown when the Settings UI cannot find the WTA helper executable. {Locked="wta.exe"}</comment>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Expand Down Expand Up @@ -2822,6 +2822,10 @@
<value>Gemini hooks を削除しています...</value>
<comment>Status summary shown while removing agent session tracking hooks for Gemini. {Locked="Gemini","hooks"}</comment>
</data>
<data name="AIAgents_HooksRemovingCodexSummary" xml:space="preserve">
<value>Removing Codex hooks...</value>
<comment>Status summary shown while removing agent session tracking hooks for Codex. {Locked="Codex","hooks"}</comment>
</data>
<data name="AIAgents_HooksLocateWtaFailedSummary" xml:space="preserve">
<value>失敗: wta.exe が見つかりませんでした</value>
<comment>Failure summary shown when the Settings UI cannot find the WTA helper executable. {Locked="wta.exe"}</comment>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Expand Down Expand Up @@ -2900,6 +2900,10 @@
<value>Gemini hooks 제거 중...</value>
<comment>Status summary shown while removing agent session tracking hooks for Gemini. {Locked="Gemini","hooks"}</comment>
</data>
<data name="AIAgents_HooksRemovingCodexSummary" xml:space="preserve">
<value>Removing Codex hooks...</value>
<comment>Status summary shown while removing agent session tracking hooks for Codex. {Locked="Codex","hooks"}</comment>
</data>
<data name="AIAgents_HooksLocateWtaFailedSummary" xml:space="preserve">
<value>실패: wta.exe를 찾을 수 없습니다</value>
<comment>Failure summary shown when the Settings UI cannot find the WTA helper executable. {Locked="wta.exe"}</comment>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Expand Down Expand Up @@ -2877,6 +2877,10 @@
<value>Removendo hooks do Gemini...</value>
<comment>Status summary shown while removing agent session tracking hooks for Gemini. {Locked="Gemini","hooks"}</comment>
</data>
<data name="AIAgents_HooksRemovingCodexSummary" xml:space="preserve">
<value>Removing Codex hooks...</value>
<comment>Status summary shown while removing agent session tracking hooks for Codex. {Locked="Codex","hooks"}</comment>
</data>
<data name="AIAgents_HooksLocateWtaFailedSummary" xml:space="preserve">
<value>Falha: não foi possível localizar wta.exe</value>
<comment>Failure summary shown when the Settings UI cannot find the WTA helper executable. {Locked="wta.exe"}</comment>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<root>
<!--
Microsoft ResX Schema
Expand Down Expand Up @@ -2807,6 +2807,10 @@
<value>Removing Gemini hooks...</value>
<comment>Status summary shown while removing agent session tracking hooks for Gemini. {Locked="Gemini","hooks"}</comment>
</data>
<data name="AIAgents_HooksRemovingCodexSummary" xml:space="preserve">
<value>Removing Codex hooks...</value>
<comment>Status summary shown while removing agent session tracking hooks for Codex. {Locked="Codex","hooks"}</comment>
</data>
<data name="AIAgents_HooksLocateWtaFailedSummary" xml:space="preserve">
<value>Failed: could not locate wta.exe</value>
<comment>Failure summary shown when the Settings UI cannot find the WTA helper executable. {Locked="wta.exe"}</comment>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<root>
<!--
Microsoft ResX Schema
Expand Down Expand Up @@ -2807,6 +2807,10 @@
<value>Removing Gemini hooks...</value>
<comment>Status summary shown while removing agent session tracking hooks for Gemini. {Locked="Gemini","hooks"}</comment>
</data>
<data name="AIAgents_HooksRemovingCodexSummary" xml:space="preserve">
<value>Removing Codex hooks...</value>
<comment>Status summary shown while removing agent session tracking hooks for Codex. {Locked="Codex","hooks"}</comment>
</data>
<data name="AIAgents_HooksLocateWtaFailedSummary" xml:space="preserve">
<value>Failed: could not locate wta.exe</value>
<comment>Failure summary shown when the Settings UI cannot find the WTA helper executable. {Locked="wta.exe"}</comment>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<root>
<!--
Microsoft ResX Schema
Expand Down Expand Up @@ -2807,6 +2807,10 @@
<value>Removing Gemini hooks...</value>
<comment>Status summary shown while removing agent session tracking hooks for Gemini. {Locked="Gemini","hooks"}</comment>
</data>
<data name="AIAgents_HooksRemovingCodexSummary" xml:space="preserve">
<value>Removing Codex hooks...</value>
<comment>Status summary shown while removing agent session tracking hooks for Codex. {Locked="Codex","hooks"}</comment>
</data>
<data name="AIAgents_HooksLocateWtaFailedSummary" xml:space="preserve">
<value>Failed: could not locate wta.exe</value>
<comment>Failure summary shown when the Settings UI cannot find the WTA helper executable. {Locked="wta.exe"}</comment>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Expand Down Expand Up @@ -2877,6 +2877,10 @@
<value>Удаление Gemini hooks...</value>
<comment>Status summary shown while removing agent session tracking hooks for Gemini. {Locked="Gemini","hooks"}</comment>
</data>
<data name="AIAgents_HooksRemovingCodexSummary" xml:space="preserve">
<value>Removing Codex hooks...</value>
<comment>Status summary shown while removing agent session tracking hooks for Codex. {Locked="Codex","hooks"}</comment>
</data>
<data name="AIAgents_HooksLocateWtaFailedSummary" xml:space="preserve">
<value>Сбой: не удалось найти wta.exe</value>
<comment>Failure summary shown when the Settings UI cannot find the WTA helper executable. {Locked="wta.exe"}</comment>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Expand Down Expand Up @@ -2898,6 +2898,10 @@
<value>Уклањање Gemini hooks...</value>
<comment>Status summary shown while removing agent session tracking hooks for Gemini. {Locked="Gemini","hooks"}</comment>
</data>
<data name="AIAgents_HooksRemovingCodexSummary" xml:space="preserve">
<value>Removing Codex hooks...</value>
<comment>Status summary shown while removing agent session tracking hooks for Codex. {Locked="Codex","hooks"}</comment>
</data>
<data name="AIAgents_HooksLocateWtaFailedSummary" xml:space="preserve">
<value>Неуспех: није могуће пронаћи wta.exe</value>
<comment>Failure summary shown when the Settings UI cannot find the WTA helper executable. {Locked="wta.exe"}</comment>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Expand Down Expand Up @@ -2544,6 +2544,10 @@
<value>Видалення Gemini hooks...</value>
<comment>Status summary shown while removing agent session tracking hooks for Gemini. {Locked="Gemini","hooks"}</comment>
</data>
<data name="AIAgents_HooksRemovingCodexSummary" xml:space="preserve">
<value>Removing Codex hooks...</value>
<comment>Status summary shown while removing agent session tracking hooks for Codex. {Locked="Codex","hooks"}</comment>
</data>
<data name="AIAgents_HooksLocateWtaFailedSummary" xml:space="preserve">
<value>Помилка: не вдалося знайти wta.exe</value>
<comment>Failure summary shown when the Settings UI cannot find the WTA helper executable. {Locked="wta.exe"}</comment>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Expand Down Expand Up @@ -2899,6 +2899,10 @@
<value>正在删除 Gemini hooks...</value>
<comment>Status summary shown while removing agent session tracking hooks for Gemini. {Locked="Gemini","hooks"}</comment>
</data>
<data name="AIAgents_HooksRemovingCodexSummary" xml:space="preserve">
<value>Removing Codex hooks...</value>
<comment>Status summary shown while removing agent session tracking hooks for Codex. {Locked="Codex","hooks"}</comment>
</data>
<data name="AIAgents_HooksLocateWtaFailedSummary" xml:space="preserve">
<value>失败: 找不到 wta.exe</value>
<comment>Failure summary shown when the Settings UI cannot find the WTA helper executable. {Locked="wta.exe"}</comment>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Expand Down Expand Up @@ -2822,6 +2822,10 @@
<value>正在移除 Gemini hooks...</value>
<comment>Status summary shown while removing agent session tracking hooks for Gemini. {Locked="Gemini","hooks"}</comment>
</data>
<data name="AIAgents_HooksRemovingCodexSummary" xml:space="preserve">
<value>Removing Codex hooks...</value>
<comment>Status summary shown while removing agent session tracking hooks for Codex. {Locked="Codex","hooks"}</comment>
</data>
<data name="AIAgents_HooksLocateWtaFailedSummary" xml:space="preserve">
<value>失敗: 找不到 wta.exe</value>
<comment>Failure summary shown when the Settings UI cannot find the WTA helper executable. {Locked="wta.exe"}</comment>
Expand Down
20 changes: 11 additions & 9 deletions tools/wta/src/agent_hooks_installer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1487,7 +1487,7 @@ fn parse_gemini_extensions_list_json(stdout: &str) -> Option<PluginPresence> {
/// exists, and `root_path` is the remainder of that row trimmed.
fn parse_codex_marketplace_list(stdout: &str) -> (bool, Option<String>) {
for line in stdout.lines() {
let line = line.trim_end();
let line = line.trim();
// Skip header and blank lines.
if line.is_empty() || line.starts_with("MARKETPLACE") {
continue;
Expand Down Expand Up @@ -1537,10 +1537,11 @@ fn parse_codex_plugin_list(stdout: &str) -> bool {
if rest.is_empty() {
return false;
}
// Status column starts here. "not installed" → not installed.
// Any "installed*" status (installed / installed, enabled /
// installed, disabled) counts as installed.
return rest[0] != "not";
// Status column starts here. Only an "installed*" status
// (installed / installed, enabled / installed, disabled)
// counts as installed — "not installed", "available", and
// any other status mean the plugin is not active.
return rest[0].starts_with("installed");
}
false
}
Expand Down Expand Up @@ -2410,10 +2411,11 @@ fn paths_equivalent(a: &Path, b: &Path) -> bool {
}

// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// Codex placeholders — replaced by Tasks 7 and 8 with real implementations.
// They are correct as "not installed" responses so runtime behavior stays
// safe between slice-B Rust commits.
// Codex status: CLI-parse path (`codex plugin marketplace list` +
// `codex plugin list`) with a filesystem fallback when the binary
// isn't on PATH. Both helpers default to a safe "not installed"
// response on any IO / parse failure so runtime behavior stays
// conservative.
// ---------------------------------------------------------------------------

fn codex_status(on_path: bool, bin_path: Option<String>, home: Option<&Path>) -> CliStatus {
Expand Down
Loading