-
Notifications
You must be signed in to change notification settings - Fork 0
fix(decisions): use stop event for codex notify #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,8 @@ export const CLAUDE_CAPTURE_COMMANDS = { | |
| }; | ||
|
|
||
| export const CODEX_NOTIFY_LINE = | ||
| 'notify = ["kodus", "decisions", "capture", "--agent", "codex", "--event", "stop"]'; | ||
| export const CODEX_NOTIFY_LINE_LEGACY = | ||
| 'notify = ["kodus", "decisions", "capture", "--agent", "codex", "--event", "agent-turn-complete"]'; | ||
|
|
||
| export const MERGE_HOOK_MARKER = '# kodus-memory-post-merge'; | ||
|
|
@@ -221,6 +223,12 @@ export async function installCodexNotify(configPath: string): Promise<{ | |
| return { configPath, changed: false, skipped: false, reason: '' }; | ||
| } | ||
|
|
||
| if (content.includes(CODEX_NOTIFY_LINE_LEGACY)) { | ||
| const nextContent = content.replace(CODEX_NOTIFY_LINE_LEGACY, CODEX_NOTIFY_LINE); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. State corruption due to partial replacement in configuration file. The function const nextContent = content.replaceAll(CODEX_NOTIFY_LINE_LEGACY, CODEX_NOTIFY_LINE);Prompt for LLMTalk to Kody by mentioning @kody Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction. |
||
| await fs.writeFile(configPath, nextContent, 'utf-8'); | ||
| return { configPath, changed: true, skipped: false, reason: '' }; | ||
| } | ||
|
|
||
| if (notifyLinePattern.test(content)) { | ||
| return { | ||
| configPath, | ||
|
|
@@ -365,13 +373,13 @@ export async function removeCodexNotify(configPath: string): Promise<{ configPat | |
| return { configPath, removed: false }; | ||
| } | ||
|
|
||
| if (!content.includes(CODEX_NOTIFY_LINE)) { | ||
| if (!content.includes(CODEX_NOTIFY_LINE) && !content.includes(CODEX_NOTIFY_LINE_LEGACY)) { | ||
| return { configPath, removed: false }; | ||
| } | ||
|
|
||
| const nextContent = content | ||
| .split('\n') | ||
| .filter((line) => line.trim() !== CODEX_NOTIFY_LINE) | ||
| .filter((line) => line.trim() !== CODEX_NOTIFY_LINE && line.trim() !== CODEX_NOTIFY_LINE_LEGACY) | ||
| .join('\n') | ||
| .replace(/\n{3,}/g, '\n\n') | ||
| .replace(/^\n+/, '') | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing
CODEX_NOTIFY_LINEto--event stopbreaks upgrade behavior for users who already have the old--event agent-turn-completeline in~/.codex/config.toml:installCodexNotifyandremoveCodexNotifyboth rely on exact-string matching via this constant, so after this change those existing installs are neither recognized as configured nor removable, andenablenow skips updating them because the genericnotifyregex detects an existing entry. In practice, an upgraded user who rerunskodus decisions enable/disablecan get stuck with the legacy notify command and no automatic migration path.Useful? React with 👍 / 👎.