fix: isolate Responses proxy state by run attempt - #146
Open
sylvesterkaczmarek wants to merge 2 commits into
Open
fix: isolate Responses proxy state by run attempt#146sylvesterkaczmarek wants to merge 2 commits into
sylvesterkaczmarek wants to merge 2 commits into
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Include
github.run_attemptin the Responses proxy server-info key so a workflow re-run cannot collide with proxy metadata from an earlier attempt of the same run.Fixes #144.
Problem
The action currently derives proxy state from:
where
GITHUB_RUN_IDis onlygithub.run_id.GitHub keeps
run_idstable when a workflow run is re-run and incrementsgithub.run_attempt. On a persistent/self-hosted runner, the next attempt can therefore see the same server-info path created by the previous attempt.That can make old proxy metadata look current. If a previous background proxy process is still alive, the collision is even more misleading because a liveness check can succeed for a process that belongs to a different workflow attempt and may have been started with different credentials or endpoint configuration.
Fix
Use a per-attempt key everywhere the action currently passes/derives the run-scoped server-info identity:
The value is still passed through the existing
CODEX_RUN_IDvariable and--github-run-idhelper option, so no TypeScript or generated bundle changes are required.Behaviour
run_attemptincrements;<run_id>-1.jsoninstead of<run_id>.json.Regression coverage
Added a focused manifest test that verifies:
github.run_id+github.run_attempt;CODEX_RUN_IDassignment remains;$CODEX_HOME/$CODEX_RUN_ID.jsonderivation is preserved.Validation
main(c385816875cc2fc8e033ed9d1cba96f8c331210e);action.yml;src/change, sodist/main.jsremains valid.Risk
Low. The server-info format and proxy lifecycle are unchanged. The only change is the namespace used for per-run state, making it unique per GitHub re-run attempt while preserving reuse within an attempt.