Skip to content
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
652b92b
feat(wta): promote Codex to first-class CliSource variant
May 28, 2026
70b5dff
feat(wta): enable Codex resume via 'codex resume <id>' subcommand
May 28, 2026
34491e3
feat(wta): scan ~/.codex/sessions for historical rollouts
May 28, 2026
86a040a
feat(wta): wire codex_title_for_key into lookup_title_for_session
May 28, 2026
111401b
feat(wta): codex lenient + strict resumability probes
May 28, 2026
c160795
refactor(wta): centralize CliSource -> cli_id via known_cli_id helper
May 28, 2026
76494cb
test(wta): pin codex wire-format round-trip through SessionHookCliSource
May 28, 2026
de1896e
test(wta): pin codex live-registry fan-in contract
May 28, 2026
cae8d74
test(wta): pin Codex Class A behavior in session_mgmt cells
May 28, 2026
5d2ed55
feat(wta): show 'codex' suffix on selected Codex rows in F2 list
May 28, 2026
61daca1
feat(wta): include Codex in display-name mapping
May 28, 2026
f3d37db
test(wta): add Codex row to populate_demo_data
May 28, 2026
cce37a3
docs(wta): add Codex layout to history_loader header
May 28, 2026
3572714
Merge remote-tracking branch 'origin/main' into dev/yuazha/codex-session
May 29, 2026
5532ca9
docs: add Codex hooks slice B design spec
May 29, 2026
4e2e847
docs: add Codex hooks slice B implementation plan
May 29, 2026
5c807d6
feat(wta): add CliKind::Codex variant
May 29, 2026
0695212
feat(wta): add Codex hooks bundle (marketplace + plugin + 4 hook events)
May 29, 2026
1ec076f
feat(wta): add install_for_codex + dispatch wiring + stub helpers
May 29, 2026
461fe8f
feat(wta): parse codex plugin/marketplace list text output
May 29, 2026
830b291
feat(wta): codex_status with CLI + filesystem fallback
May 29, 2026
5210d43
feat(wta): uninstall_for_codex + uninstall dispatch arm
May 29, 2026
0128096
test(wta): bundle resolver finds codex/ in dev tree
May 29, 2026
637dad1
docs(cascadia): mention codex in CliStatus.name comment
May 29, 2026
de8c93e
feat(settings): add Codex row + RemoveCodexHooks to AI Agents page
May 29, 2026
fd4069e
Merge remote-tracking branch 'origin/main' into dev/yuazha/codex-session
May 30, 2026
3f0021b
Merge remote-tracking branch 'origin/main' into dev/yeelam/pr-98-code…
yeelam-gordon May 31, 2026
43d7191
fix(wta): address PR #98 review comments
May 31, 2026
7dd2830
fix(codex-hooks): Settings remove + unify send-event.ps1
May 31, 2026
37e49dc
l10n(codex-hooks): translate AIAgents_HooksRemovingCodexSummary
May 31, 2026
f3d05f6
feat(codex-hooks): auto-upgrade plugin on IT version change
May 31, 2026
6620605
fix(codex-hooks): add Verify-AgentHooks codex support, send-event env…
May 31, 2026
315dbc8
Flatten Codex bundle layout to match Claude/Copilot/Gemini
May 31, 2026
9454563
Restore UTF-8 BOM on translated Resources.resw files
May 31, 2026
2ed5dfd
Merge remote-tracking branch 'origin/main' into dev/yuazha/codex-session
May 31, 2026
fc914d3
update version to 0.1.2 for wt-agent-hooks across all plugins and scr…
Jun 1, 2026
a1bdd19
wta(codex): scope plugin list to wt-local marketplace
Jun 1, 2026
5842412
l10n(codex-hooks): include Codex in translator comments for HooksInst…
Jun 1, 2026
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: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -308,3 +308,6 @@ profiles.json
tmpclaude-*
# Per-issue git worktrees created locally
.worktree/

# Local-only superpowers plan/spec notes (kept out of source control)
docs/superpowers/
9 changes: 5 additions & 4 deletions build/scripts/Verify-AgentHooks.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<#
.SYNOPSIS
Inspect, install, or remove the wt-agent-hooks bridge for one or all
supported agent CLIs (Copilot, Claude, Gemini).
supported agent CLIs (Copilot, Claude, Gemini, Codex).

.DESCRIPTION
Wrapper around `wta hooks status --json` / `wta install-hooks` /
Expand All @@ -25,8 +25,8 @@

.PARAMETER CliFilter
Restrict Uninstall (and the SmokeTest) to one CLI. Defaults to `all`.
Has no effect on Check / Install (Install always installs all three;
Check always reports all three).
Has no effect on Check / Install (Install always installs all four;
Check always reports all four).

.PARAMETER SmokeTest
After Check / Install, fire a no-op prompt at each detected CLI and
Expand Down Expand Up @@ -57,7 +57,7 @@ param(
[string]$Mode = 'Check',

[Parameter()]
[ValidateSet('all', 'copilot', 'claude', 'gemini')]
[ValidateSet('all', 'copilot', 'claude', 'gemini', 'codex')]
[string]$CliFilter = 'all',

[Parameter()]
Expand All @@ -82,6 +82,7 @@ $script:CliDisplayNames = @{
copilot = 'Copilot CLI'
claude = 'Claude Code'
gemini = 'Gemini CLI'
codex = 'Codex CLI'
}

# ── Helpers ──────────────────────────────────────────────────────────
Expand Down
36 changes: 36 additions & 0 deletions src/cascadia/TerminalSettingsEditor/AIAgents.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,42 @@
MinWidth="120" />
</Grid>
</Border>
<Border Visibility="{x:Bind ViewModel.ShowCodexHookRow, Mode=OneWay}"
BorderThickness="0,1,0,0"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
Padding="0,16,0,16">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" VerticalAlignment="Center" Spacing="2">
<TextBlock Text="Codex CLI" TextWrapping="Wrap" />
<TextBlock Text="{x:Bind ViewModel.CodexHooksSubtitle, Mode=OneWay}"
Visibility="{x:Bind ViewModel.ShowCodexHooksSubtitle, Mode=OneWay}"
Style="{StaticResource CaptionTextBlockStyle}"
Opacity="0.6"
TextWrapping="Wrap" />
<!-- Codex is the only CLI whose hook commands must be
individually trusted by the user before they fire.
Surface the one-line "run /hooks and approve"
reminder right under the row title so users see it
both before clicking Install (anticipation) and
after install (the row only becomes visible once
Codex has any hook state, which is the moment the
reminder is most actionable). -->
Comment thread
DDKinger marked this conversation as resolved.
<TextBlock x:Uid="AIAgents_CodexTrustHint"
Style="{StaticResource CaptionTextBlockStyle}"
Opacity="0.6"
TextWrapping="Wrap" />
</StackPanel>
<Button Grid.Column="1"
x:Uid="AIAgents_HooksRemoveButton"
Click="{x:Bind ViewModel.RemoveCodexHooks}"
IsEnabled="{x:Bind ViewModel.CanInstallAgentHooks, Mode=OneWay}"
MinWidth="120" />
</Grid>
</Border>
</StackPanel>
</local:SettingContainer>

Expand Down
22 changes: 21 additions & 1 deletion src/cascadia/TerminalSettingsEditor/AIAgentsViewModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -861,49 +861,60 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
_copilotCliDetected = false;
_claudeCliDetected = false;
_geminiCliDetected = false;
_codexCliDetected = false;
_showCopilotHookRow = false;
_showClaudeHookRow = false;
_showGeminiHookRow = false;
_showCodexHookRow = false;
_copilotHooksSubtitle = {};
_claudeHooksSubtitle = {};
_geminiHooksSubtitle = {};
_codexHooksSubtitle = {};
}
else
{
const auto* copilot = FindCli(*report, "copilot");
const auto* claude = FindCli(*report, "claude");
const auto* gemini = FindCli(*report, "gemini");
const auto* codex = FindCli(*report, "codex");

_copilotCliDetected = copilot && copilot->binaryOnPath;
_claudeCliDetected = claude && claude->binaryOnPath;
_geminiCliDetected = gemini && gemini->binaryOnPath;
_codexCliDetected = codex && codex->binaryOnPath;

const auto hasState = [](const CliStatus* cli) {
return cli && (cli->marketplaceRegistered || cli->pluginInstalled);
};
_showCopilotHookRow = hasState(copilot);
_showClaudeHookRow = hasState(claude);
_showGeminiHookRow = hasState(gemini);
_showCodexHookRow = hasState(codex);

_copilotHooksSubtitle = _ComputeHooksSubtitle(copilot);
_claudeHooksSubtitle = _ComputeHooksSubtitle(claude);
_geminiHooksSubtitle = _ComputeHooksSubtitle(gemini);
_codexHooksSubtitle = _ComputeHooksSubtitle(codex);
}

_NotifyChanges(L"IsCopilotCliDetected",
L"IsClaudeCliDetected",
L"IsGeminiCliDetected",
L"IsCodexCliDetected",
L"IsAnyAgentCliDetected",
L"CanInstallAgentHooks",
L"ShowCopilotHookRow",
L"ShowClaudeHookRow",
L"ShowGeminiHookRow",
L"ShowCodexHookRow",
L"CopilotHooksSubtitle",
L"ClaudeHooksSubtitle",
L"GeminiHooksSubtitle",
L"CodexHooksSubtitle",
L"ShowCopilotHooksSubtitle",
L"ShowClaudeHooksSubtitle",
L"ShowGeminiHooksSubtitle");
L"ShowGeminiHooksSubtitle",
L"ShowCodexHooksSubtitle");
}

void AIAgentsViewModel::RefreshAgentHooksStatus()
Expand Down Expand Up @@ -969,6 +980,15 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
_RunHooksWtaAsync(L"hooks uninstall --cli gemini");
}

void AIAgentsViewModel::RemoveCodexHooks()
{
if (_installingAgentHooks) return;
_installingAgentHooks = true;
_agentHooksInstallSummary = RS_(L"AIAgents_HooksRemovingCodexSummary");
_NotifyChanges(L"IsInstallingAgentHooks", L"AgentHooksInstallSummary", L"HasAgentHooksInstallSummary");
_RunHooksWtaAsync(L"hooks uninstall --cli codex");
}

winrt::fire_and_forget AIAgentsViewModel::_RunHooksWtaAsync(std::wstring wtaArgs)
{
auto strongThis = get_strong();
Expand Down
10 changes: 9 additions & 1 deletion src/cascadia/TerminalSettingsEditor/AIAgentsViewModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
bool IsCopilotCliDetected() const noexcept { return _copilotCliDetected; }
bool IsClaudeCliDetected() const noexcept { return _claudeCliDetected; }
bool IsGeminiCliDetected() const noexcept { return _geminiCliDetected; }
bool IsCodexCliDetected() const noexcept { return _codexCliDetected; }
bool IsAnyAgentCliDetected() const noexcept
{
return _copilotCliDetected || _claudeCliDetected || _geminiCliDetected;
return _copilotCliDetected || _claudeCliDetected || _geminiCliDetected || _codexCliDetected;
}
// Per-CLI "row visible" flags — true when the CLI has any wt-agent-hooks
// state on disk (marketplace registered OR plugin installed). The
Expand All @@ -137,14 +138,17 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
bool ShowCopilotHookRow() const noexcept { return _showCopilotHookRow; }
bool ShowClaudeHookRow() const noexcept { return _showClaudeHookRow; }
bool ShowGeminiHookRow() const noexcept { return _showGeminiHookRow; }
bool ShowCodexHookRow() const noexcept { return _showCodexHookRow; }
// Detail text shown under the CLI name when state isn't fully
// installed. Empty for fully-installed CLIs (subtitle is hidden in XAML).
winrt::hstring CopilotHooksSubtitle() const { return _copilotHooksSubtitle; }
winrt::hstring ClaudeHooksSubtitle() const { return _claudeHooksSubtitle; }
winrt::hstring GeminiHooksSubtitle() const { return _geminiHooksSubtitle; }
winrt::hstring CodexHooksSubtitle() const { return _codexHooksSubtitle; }
bool ShowCopilotHooksSubtitle() const noexcept { return !_copilotHooksSubtitle.empty(); }
bool ShowClaudeHooksSubtitle() const noexcept { return !_claudeHooksSubtitle.empty(); }
bool ShowGeminiHooksSubtitle() const noexcept { return !_geminiHooksSubtitle.empty(); }
bool ShowCodexHooksSubtitle() const noexcept { return !_codexHooksSubtitle.empty(); }
bool CanInstallAgentHooks() const noexcept
{
return IsAnyAgentCliDetected() && !IsAgentSessionHooksPolicyLocked();
Expand All @@ -158,6 +162,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
void RemoveCopilotHooks();
void RemoveClaudeHooks();
void RemoveGeminiHooks();
void RemoveCodexHooks();

private:
Model::GlobalAppSettings _GlobalSettings;
Expand Down Expand Up @@ -212,15 +217,18 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
bool _copilotCliDetected{ false };
bool _claudeCliDetected{ false };
bool _geminiCliDetected{ false };
bool _codexCliDetected{ false };
// Row visibility — true when the CLI has any wt-agent-hooks state
// on disk (marketplace registered OR plugin installed).
bool _showCopilotHookRow{ false };
bool _showClaudeHookRow{ false };
bool _showGeminiHookRow{ false };
bool _showCodexHookRow{ false };
// Subtitle text per CLI; empty for fully-installed CLIs.
winrt::hstring _copilotHooksSubtitle;
winrt::hstring _claudeHooksSubtitle;
winrt::hstring _geminiHooksSubtitle;
winrt::hstring _codexHooksSubtitle;
bool _installingAgentHooks{ false };
bool _refreshingAgentHooks{ false };
winrt::hstring _agentHooksInstallSummary;
Expand Down
5 changes: 5 additions & 0 deletions src/cascadia/TerminalSettingsEditor/AIAgentsViewModel.idl
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,20 @@ namespace Microsoft.Terminal.Settings.Editor
Boolean IsCopilotCliDetected { get; };
Boolean IsClaudeCliDetected { get; };
Boolean IsGeminiCliDetected { get; };
Boolean IsCodexCliDetected { get; };
Boolean IsAnyAgentCliDetected { get; };
Boolean ShowCopilotHookRow { get; };
Boolean ShowClaudeHookRow { get; };
Boolean ShowGeminiHookRow { get; };
Boolean ShowCodexHookRow { get; };
String CopilotHooksSubtitle { get; };
String ClaudeHooksSubtitle { get; };
String GeminiHooksSubtitle { get; };
String CodexHooksSubtitle { get; };
Boolean ShowCopilotHooksSubtitle { get; };
Boolean ShowClaudeHooksSubtitle { get; };
Boolean ShowGeminiHooksSubtitle { get; };
Boolean ShowCodexHooksSubtitle { get; };
Boolean CanInstallAgentHooks { get; };
Boolean IsInstallingAgentHooks { get; };
String AgentHooksInstallSummary { get; };
Expand All @@ -135,5 +139,6 @@ namespace Microsoft.Terminal.Settings.Editor
void RemoveCopilotHooks();
void RemoveClaudeHooks();
void RemoveGeminiHooks();
void RemoveCodexHooks();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2822,6 +2822,14 @@
<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>Codex hooks werden entfernt...</value>
<comment>Status summary shown while removing agent session tracking hooks for Codex. {Locked="Codex","hooks"}</comment>
</data>
<data name="AIAgents_CodexTrustHint.Text" xml:space="preserve">
<value>Führen Sie nach der Installation /hooks in Codex aus und genehmigen Sie die neuen Ereignishandler, um ihnen zu vertrauen.</value>
<comment>One-line reminder shown under the Codex CLI row in the Agent Hooks section. Codex requires per-command trust before hook handlers run; users must execute /hooks inside Codex and approve. {Locked="/hooks","Codex"}</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
Expand Up @@ -2941,6 +2941,14 @@ In this context, "agent" refers to an AI agent (e.g. Copilot, Claude, Gemini), n
<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>
Comment thread
yeelam-gordon marked this conversation as resolved.
<data name="AIAgents_CodexTrustHint.Text" xml:space="preserve">
<value>After installing, run /hooks in Codex and approve to trust the new event handlers.</value>
<comment>One-line reminder shown under the Codex CLI row in the Agent Hooks section. Codex requires per-command trust before hook handlers run; users must execute /hooks inside Codex and approve. {Locked="/hooks","Codex"}</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
Expand Up @@ -2822,6 +2822,14 @@
<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>Quitando hooks de Codex...</value>
<comment>Status summary shown while removing agent session tracking hooks for Codex. {Locked="Codex","hooks"}</comment>
</data>
<data name="AIAgents_CodexTrustHint.Text" xml:space="preserve">
<value>Después de instalar, ejecuta /hooks en Codex y aprueba para confiar en los nuevos controladores de eventos.</value>
<comment>One-line reminder shown under the Codex CLI row in the Agent Hooks section. Codex requires per-command trust before hook handlers run; users must execute /hooks inside Codex and approve. {Locked="/hooks","Codex"}</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
Expand Up @@ -2823,6 +2823,14 @@
<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>Suppression des hooks Codex...</value>
<comment>Status summary shown while removing agent session tracking hooks for Codex. {Locked="Codex","hooks"}</comment>
</data>
<data name="AIAgents_CodexTrustHint.Text" xml:space="preserve">
<value>Après l'installation, exécutez /hooks dans Codex et approuvez pour faire confiance aux nouveaux gestionnaires d'événements.</value>
<comment>One-line reminder shown under the Codex CLI row in the Agent Hooks section. Codex requires per-command trust before hook handlers run; users must execute /hooks inside Codex and approve. {Locked="/hooks","Codex"}</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
Expand Up @@ -2822,6 +2822,14 @@
<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>Rimozione degli hooks Codex...</value>
<comment>Status summary shown while removing agent session tracking hooks for Codex. {Locked="Codex","hooks"}</comment>
</data>
<data name="AIAgents_CodexTrustHint.Text" xml:space="preserve">
<value>Dopo l'installazione, esegui /hooks in Codex e approva per considerare attendibili i nuovi gestori di eventi.</value>
<comment>One-line reminder shown under the Codex CLI row in the Agent Hooks section. Codex requires per-command trust before hook handlers run; users must execute /hooks inside Codex and approve. {Locked="/hooks","Codex"}</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
Expand Up @@ -2822,6 +2822,14 @@
<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>Codex hooks を削除しています...</value>
<comment>Status summary shown while removing agent session tracking hooks for Codex. {Locked="Codex","hooks"}</comment>
</data>
<data name="AIAgents_CodexTrustHint.Text" xml:space="preserve">
<value>インストール後、Codex で /hooks を実行し、承認して新しいイベント ハンドラーを信頼してください。</value>
<comment>One-line reminder shown under the Codex CLI row in the Agent Hooks section. Codex requires per-command trust before hook handlers run; users must execute /hooks inside Codex and approve. {Locked="/hooks","Codex"}</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
Loading
Loading