Skip to content

fix: deduplicate session environment exports - #558

Open
dinhnguyenminhhoang wants to merge 2 commits into
openai:mainfrom
dinhnguyenminhhoang:fix/dedupe-session-env-exports
Open

fix: deduplicate session environment exports#558
dinhnguyenminhhoang wants to merge 2 commits into
openai:mainfrom
dinhnguyenminhhoang:fix/dedupe-session-env-exports

Conversation

@dinhnguyenminhhoang

Copy link
Copy Markdown

Summary

Prevent repeated SessionStart events from appending duplicate Codex
environment exports to CLAUDE_ENV_FILE.

Fixes #528

Changes

  • Skip environment export lines that already exist
  • Preserve unrelated environment-file content
  • Add regression coverage for repeated SessionStart invocations

Testing

  • node --test --test-name-pattern="session start hook does not duplicate" tests/runtime.test.mjs
  • Manually invoked the real SessionStart hook three times against a
    temporary environment file
  • Verified each managed export appeared exactly once
  • Verified unrelated environment entries were preserved

@dinhnguyenminhhoang
dinhnguyenminhhoang requested a review from a team July 26, 2026 07:24

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

Copy link
Copy Markdown

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: 874d02dcab

ℹ️ 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".

Comment thread plugins/codex/scripts/session-lifecycle-hook.mjs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant