-
Notifications
You must be signed in to change notification settings - Fork 1
Avoid canceling concurrent codex runs (#1103) #1103
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| name: Keepalive Loop Reporter | ||
|
|
||
| on: | ||
| workflow_run: | ||
| workflows: ["Agents Keepalive Loop"] | ||
| types: [completed] | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| issues: write | ||
| actions: read | ||
|
|
||
| concurrency: | ||
| group: >- | ||
| keepalive-loop-reporter-${{ github.event.workflow_run.pull_requests[0].number || | ||
| github.run_id }} | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| report: | ||
| name: Report keepalive completion | ||
| if: vars.USE_CONSOLIDATED_WORKFLOWS != 'true' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout keepalive scripts | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| sparse-checkout: | | ||
| .github/scripts | ||
| sparse-checkout-cone-mode: false | ||
| fetch-depth: 1 | ||
|
|
||
| - name: Update summary for cancelled/failed runs | ||
| uses: actions/github-script@v8 | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| script: | | ||
| const run = context.payload?.workflow_run || {}; | ||
| const prNumber = Number(run.pull_requests?.[0]?.number || 0); | ||
| if (!prNumber) { | ||
| core.info('No PR context found; skipping keepalive post summary.'); | ||
| return; | ||
| } | ||
|
|
||
| const conclusion = String(run.conclusion || run.status || '').toLowerCase(); | ||
| if (!conclusion || conclusion === 'success') { | ||
| core.info( | ||
| `Keepalive run conclusion=${conclusion || 'unknown'}; ` + | ||
| 'no post summary needed.' | ||
| ); | ||
| return; | ||
| } | ||
|
|
||
| const { loadKeepaliveState } = require('./.github/scripts/keepalive_state.js'); | ||
| const { updateKeepaliveLoopSummary } = require('./.github/scripts/keepalive_loop.js'); | ||
|
|
||
| const { state } = await loadKeepaliveState({ github, context, prNumber, trace: '' }); | ||
| if (!state || state.running !== true) { | ||
| core.info('Keepalive state not marked as running; skipping post summary.'); | ||
| return; | ||
| } | ||
|
|
||
| const inputs = { | ||
| pr_number: prNumber, | ||
| action: 'run', | ||
| reason: '', | ||
| gate_conclusion: state.gate_conclusion || '', | ||
| iteration: state.iteration || 0, | ||
| max_iterations: state.max_iterations || 0, | ||
| failure_threshold: state.failure_threshold || 3, | ||
| tasks_total: state.tasks?.total ?? 0, | ||
| tasks_unchecked: state.tasks?.unchecked ?? 0, | ||
| keepalive_enabled: state.keepalive_enabled ?? 'true', | ||
| autofix_enabled: state.autofix_enabled ?? '', | ||
| agent_type: state.agent_type || 'codex', | ||
| trace: state.trace || '', | ||
| run_result: conclusion, | ||
| run_url: run.html_url || '', | ||
| rounds_without_task_completion: state.rounds_without_task_completion || 0, | ||
| }; | ||
|
|
||
| await updateKeepaliveLoopSummary({ github, context, core, inputs }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new concurrency group includes
inputs.mode, so keepalive and autofix runs for the same PR no longer share a group. Both.github/workflows/agents-keepalive-loop.ymland.github/workflows/agents-autofix-loop.ymlcall this reusable workflow with the samepr_number/pr_refbut differentmodevalues, which now allows simultaneous runs that both push to the same branch. That increases the chance of push rejections or conflicting rebases in the commit step, causing failed runs or interleaved commits. Consider keying the group only by PR/target branch (orpr_ref) so different modes still serialize on the same branch.Useful? React with 👍 / 👎.