Skip to content

Codex duplicate GitHub comment posting when gh issue comment action is retried #27283

Open

Description

@martinmclee

What version of Codex CLI is running?

0.139.0

What subscription do you have?

Not provided for this report.

Which model were you using?

Not provided / not model-specific.

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What terminal emulator and version are you using (if applicable)?

Windows Terminal + PowerShell (pwsh.exe in Codex environment).

Codex doctor report

not available

What issue are you seeing?

When I ask Codex to post a single GitHub issue comment via gh, it can be posted twice.

Observed pattern:

  • I asked for one gh issue comment ... action.
  • The first call had an uncertain execution outcome (timeout/network uncertainty).
  • The action retried.
  • GitHub ended up receiving duplicate comment(s) with the same body.

I recently reported an unrelated plan-mode issue and noticed this behavior while following up; after retry behavior, duplicates were created for the same intended single post.

What steps can reproduce the bug?

  1. Ask Codex to execute a single gh issue comment <id> --repo <owner/repo> --body ....
  2. In the same run, if tool execution timing is uncertain (timeout/retry path), it can issue the same command twice.
  3. Confirm in GitHub UI that two identical comments were created even though request intent was one comment.

Please include if possible:

  • Thread id: 019e38d6-eeb8-7680-ab3c-ee4272a17c2a
  • Desktop version currently observed: 26.608.12217

What is the expected behavior?

A single requested action should create exactly one GitHub comment, with no dedupe/retry posting.

Additional information

This happens after an update/restart cycle and appears to be a non-deterministic state/acknowledgement issue. It is hard to distinguish success/failure when a command times out, so adding idempotency guard before reissue would help prevent duplicates.

Activity

  1. added
    bug
    CLI
    windows-os
    tool-calls
    connectivity
    on Jun 10, 2026
  2. SylvainWinning commented on Jun 10, 2026

    @SylvainWinning

    A possible implementation direction here is to treat side-effecting shell commands as “unknown outcome” after a timeout instead of immediately reissuing them.

    For gh issue comment specifically, a practical guard could be:

    • before retrying the same command, query the target issue’s latest comments;
    • compare author + normalized body, or a short body hash if the original body is still available in the tool-call metadata;
    • if a matching recent comment exists, surface the URL as the result instead of running the command again.

    The broader fix may be a generic idempotency layer for known side-effecting commands, but even a narrow “verify-before-retry for GitHub comments” path would prevent the highest-impact version of this bug without changing normal retry behavior for read-only commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIbugconnectivitytool-callswindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions