Skip to content

[limen GH-organvm-limen-895] Dedup repairs by work-intent, not just task-ID (two sessions raced the same red-trunk fix)#968

Open
4444J99 wants to merge 1 commit into
mainfrom
limen/gh-organvm-limen-895-eb84414d
Open

[limen GH-organvm-limen-895] Dedup repairs by work-intent, not just task-ID (two sessions raced the same red-trunk fix)#968
4444J99 wants to merge 1 commit into
mainfrom
limen/gh-organvm-limen-895-eb84414d

Conversation

@4444J99

@4444J99 4444J99 commented Jul 12, 2026

Copy link
Copy Markdown
Member

Autonomous limen dispatch of task GH-organvm-limen-895.

GitHub issue #895. From PREC-2026-07-10-same-repair-raced-by-two-sessions. dispatch.py release_stale_tasks() dedups by session_id + stale age, but nothing prevents two sessions fixing the SAME logical thing under different task IDs — this session's green-main agent and another session's PR #871 both fixed the same CI-red main. Fix: route trunk-red repair through ONE claimable keyed HEAL task (self-heal.py alre

Refs: #895

Produced in an isolated worktree off origin — review before merge.

…e same red-trunk fix)

limen task GH-organvm-limen-895
@4444J99 4444J99 enabled auto-merge (squash) July 12, 2026 04:44

@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: 6ccedbe4c0

ℹ️ 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 scripts/self-heal.py
Comment on lines 332 to 333
lf.tasks.append(build_task(verdict, repo, num, url, stamp))
emitted.append(tid)

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 Restore same-run heal-task dedupe

When sick contains the same PR more than once (for example duplicate --pr inputs, or any overlapping/duplicated search rows), this appends duplicate Task objects with the same stable id because tasks_by_id is only a snapshot loaded before the loop. The previous existing.add(tid) prevented duplicates within a single live pass; update the in-memory map/set after appending so tasks.yaml does not end up with repeated task IDs in one run.

Useful? React with 👍 / 👎.

Comment thread scripts/self-heal.py
Comment on lines +330 to +331
if mt is not None and mt.status in _MAINRED_ACTIVE_STATUSES:
continue

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 Move trunk-repair skip before applying the emit limit

When the scan window contains more sick PRs than --limit and the first limit entries include CI-red PRs covered by an active HEAL-mainred, these skipped entries still consume the already-sliced sick[:limit] quota, so later actionable conflicts/stale-base repairs in the same window are not emitted at all. Apply the trunk-repair suppression before capping, or keep scanning until the run has emitted up to the limit of non-suppressed heal tasks.

Useful? React with 👍 / 👎.

Comment thread scripts/self-heal.py
Comment on lines +327 to +330
if verdict == "CI-RED":
mainred_tid = f"HEAL-mainred-{repo.replace('/', '-').lower()}"
mt = tasks_by_id.get(mainred_tid)
if mt is not None and mt.status in _MAINRED_ACTIVE_STATUSES:

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 Check the PR base before suppressing CI fixes

When a CI-red PR targets a non-default/release branch in the same repo, an active HEAL-mainred-<repo> does not necessarily heal that PR, but this check suppresses the PR-level repair solely by repo id. assess() already fetches baseRefName, so carry that through and only skip CI-fix tasks whose base is the trunk covered by the mainred task; otherwise branch-specific red PRs can be left with no heal task while the unrelated trunk repair is active.

Useful? React with 👍 / 👎.

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