Skip to content

GH#3637: refactor(supervisor): extract _cleanup_eval_checkpoint() helper#4410

Merged
alex-solovyev merged 1 commit intomainfrom
refactor/t3637-extract-cleanup-eval-checkpoint-helper
Mar 13, 2026
Merged

GH#3637: refactor(supervisor): extract _cleanup_eval_checkpoint() helper#4410
alex-solovyev merged 1 commit intomainfrom
refactor/t3637-extract-cleanup-eval-checkpoint-helper

Conversation

@alex-solovyev
Copy link
Copy Markdown
Collaborator

Summary

Addresses the unresolved inline review suggestion from gemini-code-assist on PR #4398.

The bot flagged (medium priority) that the eval checkpoint cleanup pattern was duplicated across three recovery phases and suggested extracting it into a shared helper function following the DRY principle. It also noted that 2>/dev/null is redundant after a [[ -f ]] existence check and can mask real errors (e.g. permissions).

Changes

  • Add _cleanup_eval_checkpoint() helper (after _update_task_heartbeat(), ~line 562): takes task_id and phase_name, removes the checkpoint file if it exists, logs via log_verbose. Removes the redundant 2>/dev/null suppression as the bot recommended.
  • Phase 0.7 (~line 1229): replace 4-line inline block with _cleanup_eval_checkpoint "$stale_id" "Phase 0.7"
  • Phase 1c (~line 1885): replace 4-line inline block with _cleanup_eval_checkpoint "$stuck_id" "Phase 1c"
  • Phase 4b (~line 2472): replace 4-line inline block with _cleanup_eval_checkpoint "$orphan_id" "Phase 4b" (guard on orphan_status == "evaluating" preserved)

Verification

  • bash -n pulse.sh → Syntax OK
  • All three call sites confirmed via grep -n _cleanup_eval_checkpoint
  • The read-only use in _diagnose_stale_root_cause() (~line 271) is intentionally left as-is (it checks for the file's existence to emit a diagnosis, not to delete it)

Closes #3637

…637)

Address gemini-code-assist DRY suggestion from PR #4398 review.
The eval checkpoint cleanup pattern was duplicated across Phase 0.7,
Phase 1c, and Phase 4b. Extract into a shared _cleanup_eval_checkpoint()
helper function to eliminate the repetition and improve maintainability.

Also removes redundant 2>/dev/null suppression after the [[ -f ]] guard,
as the bot noted this masks real errors (e.g. permissions) once file
existence is already confirmed.
@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@github-actions github-actions Bot added the refactor Auto-created from TODO.md tag label Mar 13, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 13, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Review skipped — only excluded labels are configured. (1)
  • no-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: abf831d6-88f9-45c3-a3e1-07cff284506f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/t3637-extract-cleanup-eval-checkpoint-helper
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 413 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Mar 13 07:59:24 UTC 2026: Code review monitoring started
Fri Mar 13 07:59:25 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 413

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 413
  • VULNERABILITIES: 0

Generated on: Fri Mar 13 07:59:27 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link
Copy Markdown

@alex-solovyev alex-solovyev merged commit e63020e into main Mar 13, 2026
19 checks passed
@alex-solovyev alex-solovyev deleted the refactor/t3637-extract-cleanup-eval-checkpoint-helper branch March 13, 2026 12:01
@alex-solovyev
Copy link
Copy Markdown
Collaborator Author

Merged by supervisor pulse. All checks passing, review gate passed (coderabbitai). Resolves GH#3637.

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

Labels

refactor Auto-created from TODO.md tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

quality-debt: PR #1963 review feedback (high)

1 participant