Skip to content

Comments

fix(decisions): use stop event for codex notify#10

Merged
malinosqui merged 2 commits intomainfrom
fix/codex-notify-stop-event
Feb 23, 2026
Merged

fix(decisions): use stop event for codex notify#10
malinosqui merged 2 commits intomainfrom
fix/codex-notify-stop-event

Conversation

@malinosqui
Copy link
Member

@malinosqui malinosqui commented Feb 23, 2026

Updates the codex agent's notification configuration to trigger decision capture on the stop event instead of the agent-turn-complete event. This ensures that the kodus decisions capture command is executed when the codex agent fully stops. Integration tests have been updated to reflect this change in the expected configuration.

@kody-ai

This comment has been minimized.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f9131add15

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


export const CODEX_NOTIFY_LINE =
'notify = ["kodus", "decisions", "capture", "--agent", "codex", "--event", "agent-turn-complete"]';
'notify = ["kodus", "decisions", "capture", "--agent", "codex", "--event", "stop"]';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Handle legacy Codex notify line when switching events

Changing CODEX_NOTIFY_LINE to --event stop breaks upgrade behavior for users who already have the old --event agent-turn-complete line in ~/.codex/config.toml: installCodexNotify and removeCodexNotify both rely on exact-string matching via this constant, so after this change those existing installs are neither recognized as configured nor removable, and enable now skips updating them because the generic notify regex detects an existing entry. In practice, an upgraded user who reruns kodus decisions enable/disable can get stuck with the legacy notify command and no automatic migration path.

Useful? React with 👍 / 👎.

@kody-ai
Copy link

kody-ai bot commented Feb 23, 2026

kody code-review Kody Rules critical

The pull request description is empty. To improve tracking and provide context, please add a reference to the issue being addressed, for example, 'Closes #123' or 'Fixes #456'. Kody Rule violation: Ensure PR closes referenced issues

@kody-ai
Copy link

kody-ai bot commented Feb 23, 2026

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug
Performance
Security
Cross File

Access your configuration settings here.

@kody-ai
Copy link

kody-ai bot commented Feb 23, 2026

kody code-review Kody Rules critical

This pull request does not seem to reference any issue. Please update the description to include a closing keyword like 'Closes #issue_number' or 'Fixes #issue_number' to automatically link and close the relevant issue upon merging. Kody Rule violation: Ensure PR closes referenced issues

}

if (content.includes(CODEX_NOTIFY_LINE_LEGACY)) {
const nextContent = content.replace(CODEX_NOTIFY_LINE_LEGACY, CODEX_NOTIFY_LINE);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Bug high

State corruption due to partial replacement in configuration file. The function installCodexNotify uses String.prototype.replace() to update a legacy configuration string. When the pattern is a string, replace() only affects the first occurrence. If a user's configuration file contains multiple instances of the legacy notification line (CODEX_NOTIFY_LINE_LEGACY), only the first one will be updated to the new version. All subsequent instances will remain, leaving the configuration file in a corrupted state with both old and new notification commands. This will cause unexpected behavior, such as duplicate command execution or configuration parsing errors.

    const nextContent = content.replaceAll(CODEX_NOTIFY_LINE_LEGACY, CODEX_NOTIFY_LINE);
Prompt for LLM

File src/commands/memory/hooks.ts:

Line 227:

I have a TypeScript function that reads a configuration file as a string, finds a legacy configuration line, and replaces it with a new one. The current implementation uses `String.prototype.replace()`. The problem is that `replace()` with a string argument only replaces the first match. If the legacy configuration line appears multiple times in the file, this code will only update the first one, leaving the file in a corrupted state with both old and new configuration lines. Please rewrite the line of code responsible for the replacement to ensure that all occurrences of the legacy configuration line are replaced with the new one.

Suggested Code:

    const nextContent = content.replaceAll(CODEX_NOTIFY_LINE_LEGACY, CODEX_NOTIFY_LINE);

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

@malinosqui malinosqui merged commit e23e399 into main Feb 23, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant