Repository navigation
Consolidate upgrades and timing quotas SSOT #153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 10 commits
d4f21e2
bc1eeb5
ea8adb4
a78401a
5010668
c7701d5
fb80b8d
b7c0514
eaa7cc0
48cd663
c54b486
a811ead
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,8 +10,8 @@ name: Continuous agent ops | |
|
|
||
| on: | ||
| schedule: | ||
| # Every 2 hours — enough to clear lag without burning review quota | ||
| - cron: '17 */2 * * *' | ||
| # Every hour — enough to clear lag without burning review quota | ||
| - cron: '17 * * * *' | ||
| workflow_dispatch: | ||
| inputs: | ||
| force_all: | ||
|
|
@@ -34,10 +34,20 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| permissions: | ||
| contents: read | ||
| contents: write | ||
|
devin-ai-integration[bot] marked this conversation as resolved.
Resolved
devin-ai-integration[bot] marked this conversation as resolved.
Resolved
devin-ai-integration[bot] marked this conversation as resolved.
Resolved
devin-ai-integration[bot] marked this conversation as resolved.
Resolved
devin-ai-integration[bot] marked this conversation as resolved.
Resolved
|
||
| pull-requests: write | ||
| issues: write | ||
| steps: | ||
| - name: Checkout monorepo | ||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
|
Comment on lines
+42
to
+49
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔍 Sweep job now runs with contents: write and a checkout The job permission was widened from Was this helpful? React with 👍 or 👎 to provide feedback. |
||
|
|
||
| - name: Calculate Response Time Lag Index | ||
| env: | ||
| OPERATOR_GITHUB_TOKEN: ${{ secrets.OPERATOR_GITHUB_TOKEN || secrets.OPERATOR_TOKEN || secrets.GITHUB_TOKEN }} | ||
| GITHUB_REPOSITORY: ${{ github.repository }} | ||
| run: | | ||
| python3 scripts/ci/calculate_lag_index.py | ||
|
Comment on lines
+51
to
+56
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 Info: Lag calculation step is unguarded and can abort the whole sweep
Was this helpful? React with 👍 or 👎 to provide feedback. |
||
|
|
||
| - name: Sweep open PRs and advance stuck work | ||
| uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 | ||
| env: | ||
|
|
@@ -51,8 +61,22 @@ jobs: | |
| const forceAll = process.env.FORCE_ALL === 'true'; | ||
| const maxPrs = Math.min(Number(process.env.MAX_PRS) || 8, 20); | ||
| const marker = '<!-- continuous-agent-ops -->'; | ||
| const debounceMs = 90 * 60 * 1000; // 90 minutes | ||
| const staleMs = 3 * 60 * 60 * 1000; // 3 hours without agent activity | ||
|
|
||
| // Default fallbacks | ||
| const defaultDebounceMs = 90 * 60 * 1000; // 90 minutes | ||
| const defaultStaleMs = 3 * 60 * 60 * 1000; // 3 hours without agent activity | ||
|
|
||
| // Load dynamic lag index if available | ||
| const fs = require('fs'); | ||
| let lagIndex = {}; | ||
| try { | ||
| if (fs.existsSync('docs/ops/response_time_lag_index.json')) { | ||
| lagIndex = JSON.parse(fs.readFileSync('docs/ops/response_time_lag_index.json', 'utf8')); | ||
| core.info('Successfully loaded dynamic response time lag index.'); | ||
| } | ||
| } catch (e) { | ||
| core.info('Could not load lag index, using default fallbacks: ' + e.message); | ||
| } | ||
|
|
||
| const agentLogins = [ | ||
| 'google-labs-jules', 'devin-ai-integration', 'coderabbitai', | ||
|
|
@@ -105,6 +129,29 @@ jobs: | |
| per_page: 100, | ||
| }); | ||
|
|
||
| // Get dynamic debounce and stale times | ||
| let debounceMs = defaultDebounceMs; | ||
| let staleMs = defaultStaleMs; | ||
|
|
||
| if (lagIndex.by_pr && lagIndex.by_pr[String(pr.number)]) { | ||
| const metrics = lagIndex.by_pr[String(pr.number)]; | ||
| if (metrics.suggested_debounce_ms) { | ||
| debounceMs = metrics.suggested_debounce_ms; | ||
| } | ||
| if (metrics.suggested_stale_ms) { | ||
| staleMs = metrics.suggested_stale_ms; | ||
| } | ||
| } else if (lagIndex.global_averages) { | ||
| if (lagIndex.global_averages.suggested_debounce_ms) { | ||
| debounceMs = lagIndex.global_averages.suggested_debounce_ms; | ||
| } | ||
| if (lagIndex.global_averages.suggested_stale_ms) { | ||
| staleMs = lagIndex.global_averages.suggested_stale_ms; | ||
| } | ||
| } | ||
|
devin-ai-integration[bot] marked this conversation as resolved.
Resolved
|
||
|
|
||
| core.info(`PR #${pr.number}: Using debounceMs=${debounceMs} (${Math.round(debounceMs/60000)}m), staleMs=${staleMs} (${Math.round(staleMs/3600000)}h)`); | ||
|
Comment on lines
+146
to
+167
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔍 Dynamic thresholds can shorten debounce/stale windows and increase nudge frequency The dynamic values loaded here come from Was this helpful? React with 👍 or 👎 to provide feedback.
Comment on lines
+146
to
+167
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 Info: Per-PR debounce/stale values are unbounded from the JSON index
Was this helpful? React with 👍 or 👎 to provide feedback. |
||
|
|
||
| const lastOps = comments | ||
| .filter(c => c.body && c.body.includes(marker)) | ||
| .sort((a, b) => new Date(b.created_at) - new Date(a.created_at))[0]; | ||
|
|
@@ -217,3 +264,17 @@ jobs: | |
| .write(); | ||
|
|
||
| core.setOutput('acted', String(acted)); | ||
|
|
||
| - name: Commit and Push Updated Lag Index & SSOT | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.OPERATOR_GITHUB_TOKEN || secrets.OPERATOR_TOKEN || secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| git config --global user.name "github-actions[bot]" | ||
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
| git add docs/ops/response_time_lag_index.json docs/ops/LANE_CONSOLIDATION_SSOT.md | ||
| if ! git diff-index --quiet HEAD --; then | ||
|
devin-ai-integration[bot] marked this conversation as resolved.
Resolved
|
||
| git commit -m "docs: dynamic update of lane consolidation lag index & SSOT" | ||
| git push origin HEAD:${{ github.ref }} || echo "Could not push changes; skipping (likely read-only token or PR branch)" | ||
|
devin-ai-integration[bot] marked this conversation as resolved.
Resolved
Comment on lines
+381
to
+384
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Scheduled job commits documentation straight to the default branch instead of the staging branch Generated documentation is committed and pushed to whatever branch the schedule runs on ( Rule and mechanismAGENTS.md states as a hard rule: "Target Was this helpful? React with 👍 or 👎 to provide feedback.
Comment on lines
+375
to
+384
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Privileged token configured for the push step is never actually used The elevated credential is only exported as an environment variable ( Why the env var has no effect
To actually use the operator token, pass it to Was this helpful? React with 👍 or 👎 to provide feedback. |
||
| else | ||
| echo "No changes to lag index/SSOT." | ||
| fi | ||
|
Comment on lines
+375
to
+387
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔍 Lag-index push step relies on checkout-persisted credentials, not the env token The commit/push step sets Was this helpful? React with 👍 or 👎 to provide feedback.
Comment on lines
+378
to
+387
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 Info: Hourly auto-commits of the lag index create ongoing default-branch churn The lag index is recomputed from live PR data every hour and committed whenever any byte differs, so averages will almost always shift and produce a commit per hour on Was this helpful? React with 👍 or 👎 to provide feedback.
Comment on lines
+375
to
+387
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟨 Sweep automation escalated to write access to repository contents
Was this helpful? React with 👍 or 👎 to provide feedback. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -125,12 +125,21 @@ jobs: | |
| const number = context.payload.pull_request?.number || context.payload.issue?.number; | ||
| if (context.payload.comment?.id) { | ||
| try { | ||
| await github.rest.reactions.createForIssueComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| comment_id: context.payload.comment.id, | ||
| content: 'eyes', | ||
| }); | ||
| if (context.eventName === 'pull_request_review_comment') { | ||
| await github.rest.reactions.createForPullRequestReviewComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| comment_id: context.payload.comment.id, | ||
| content: 'eyes', | ||
| }); | ||
| } else { | ||
| await github.rest.reactions.createForIssueComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| comment_id: context.payload.comment.id, | ||
| content: 'eyes', | ||
| }); | ||
| } | ||
|
Comment on lines
+134
to
+148
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 Info: Review-comment reaction split is the right API pairing
Was this helpful? React with 👍 or 👎 to provide feedback. |
||
| } catch (e) { | ||
| core.info('Comment reaction skip: ' + e.message); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.