Skip to content

[codex] Persist Codex update prompt dedupe#96

Merged
Pigbibi merged 1 commit into
mainfrom
codex/codex-update-prompt-dedupe
Jun 9, 2026
Merged

[codex] Persist Codex update prompt dedupe#96
Pigbibi merged 1 commit into
mainfrom
codex/codex-update-prompt-dedupe

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Persist Codex CLI update prompt dedupe state by latest version.
  • Reuse the existing app config directory and atomic JSON writer for codex_update_prompt_state.json.
  • Add coverage for restart-style dedupe where in-memory state is empty but the version was already prompted.

Root Cause

The previous dedupe set lived only in process memory, so the same Codex CLI update prompt could be sent again after a bot restart.

Validation

  • timeout 180 uv run --extra dev pytest tests/telegram_codex_bot/test_codex_update_prompt.py
  • timeout 120 uv run --extra dev ruff check src/telegram_codex_bot/bot.py tests/telegram_codex_bot/test_codex_update_prompt.py

@Pigbibi Pigbibi force-pushed the codex/codex-update-prompt-dedupe branch from 080d45d to 48c6c8c Compare June 9, 2026 10:37

@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: 080d45d4ac

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


prompted_versions.add(key)
_codex_update_prompted_versions.update(prompted_versions)
_save_codex_update_prompted_versions(prompted_versions)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Persist prompts only after successful notification

When Telegram returns RetryAfter (which safe_send re-raises), this save has already written the latest version to codex_update_prompt_state.json. The exception aborts notify_codex_update_available before the prompt is delivered to all users, and subsequent checks/restarts will skip the update because the version is now persisted; save the key only after the send loop completes, or roll it back on failure.

Useful? React with 👍 / 👎.

@Pigbibi Pigbibi merged commit 66ba556 into main Jun 9, 2026
5 checks passed
@Pigbibi Pigbibi deleted the codex/codex-update-prompt-dedupe branch June 9, 2026 10:38
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