Skip to content

fix: increase limit reset buffer to 10min + jitter, add relative time to PR comments (issue #1236)#1237

Open
konard wants to merge 8 commits intomainfrom
issue-1236-e01a0dd9a7c8
Open

fix: increase limit reset buffer to 10min + jitter, add relative time to PR comments (issue #1236)#1237
konard wants to merge 8 commits intomainfrom
issue-1236-e01a0dd9a7c8

Conversation

@konard
Copy link
Contributor

@konard konard commented Feb 7, 2026

Summary

  • Increase default buffer from 5 to 10 minutes for limit reset waiting (configurable via HIVE_MIND_LIMIT_RESET_BUFFER_MS)
  • Add random jitter (0-5 min) to distribute load and avoid thundering herd problem when multiple instances wait for the same limit reset (configurable via HIVE_MIND_LIMIT_RESET_JITTER_MS)
  • Format reset time with relative time + UTC in PR comments (e.g., "in 14m (Feb 6, 3:00 PM UTC)" instead of just "4:00 PM")
  • Apply relative time formatting to both "Usage Limit Reached" and "Waiting to Continue" PR comments
  • Include comprehensive case study with timeline, root cause analysis, and downloaded log data

Before

📊 Limit Information
- Reset Time: 4:00 PM

After

📊 Limit Information
- Reset Time: in 14m (Feb 6, 3:00 PM UTC)

Files Changed

File Changes
src/config.lib.mjs Increase default buffer to 10 min, add jitterMs config
src/solve.auto-continue.lib.mjs Add random jitter to wait time calculation
src/github.lib.mjs Use formatResetTimeWithRelative() for reset time in PR comments
src/solve.mjs Use formatResetTimeWithRelative() for reset time in waiting comment
tests/test-limit-reset-config.mjs Tests for buffer, jitter, and formatting
docs/case-studies/issue-1236/ Case study with timeline and raw data

Test plan

  • New test suite tests/test-limit-reset-config.mjs (12 tests passing)
  • Existing tests/test-usage-limit.mjs (63 tests passing)
  • Existing tests/limits-display.test.mjs (18 tests passing)
  • Prettier formatting checks pass
  • One pre-existing test failure in solve-queue.test.mjs (unrelated THRESHOLD naming test)

Fixes #1236

🤖 Generated with Claude Code

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #1236
@konard konard self-assigned this Feb 7, 2026
konard and others added 6 commits February 7, 2026 23:41
…lysis

Includes downloaded logs from xlabtg/krypton-platform PR #2 showing the
auto-resume timing issue, and comprehensive analysis of root causes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Downloaded PR comments from xlabtg/krypton-platform#2 containing:
- Usage limit reached notification (comment 3860860522)
- Solution draft log with auto-resume countdown (comment 3860955310)
- Auto-resume session start notification (comment 3860958566)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ve time to PR comments

- Increase default buffer from 5 to 10 minutes for limit reset waiting
- Add random jitter (0-5 min) to distribute load and avoid thundering herd
- Format reset time with relative time + UTC in PR comments ("in 14m (Feb 6, 3:00 PM UTC)")
- Apply relative time formatting to both inline and uploaded log PR comments
- Apply relative time formatting to "waiting" PR comment

Fixes #1236

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…matting

Tests verify:
- Default buffer is now 10 minutes (increased from 5)
- Default jitter range is 5 minutes (new)
- Maximum total wait is 15 minutes (buffer + jitter)
- Jitter produces values in valid range [0, jitterMs)
- formatResetTimeWithRelative works correctly for PR comments

Ref #1236

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@konard konard changed the title [WIP] We should increase time buffer before auto resume or auto restart on limit reset fix: increase limit reset buffer to 10min + jitter, add relative time to PR comments (issue #1236) Feb 7, 2026
@konard konard marked this pull request as ready for review February 7, 2026 22:47
@konard
Copy link
Contributor Author

konard commented Feb 7, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $9.595188 USD
  • Calculated by Anthropic: $6.076671 USD
  • Difference: $-3.518517 (-36.67%)
    📎 Log file uploaded as Gist (1651KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

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.

We should increase time buffer before auto resume or auto restart on limit reset

1 participant