fix: reject conflicting inputs before setup side effects - #140
Open
sylvesterkaczmarek wants to merge 3 commits into
Open
fix: reject conflicting inputs before setup side effects#140sylvesterkaczmarek wants to merge 3 commits into
sylvesterkaczmarek wants to merge 3 commits into
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
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
Reject known-invalid input combinations immediately after Node setup, before the action starts the proxy, changes host configuration, or irreversibly drops sudo.
Fixes #139.
Problem
The final
run-codex-exechelper already validates several mutually exclusive inputs, but those checks happen very late in the composite action.For example, setting both:
is guaranteed to fail, but the action currently reaches that error only after setup steps that may include:
drop-sudo, which is intentionally irreversible for the remainder of the job.The same ordering applies to other conflicts the helper already knows how to reject.
Fix
Add a small dependency-free preflight immediately after
Ensure Node.js availableand before repository checks or other side effects.The preflight mirrors the helper's simple deterministic conflicts:
prompt+prompt-file;output-schema+output-schema-file;permission-profile+sandbox;permission-profile+safety-strategy: read-only.Values are trimmed before the check, matching the helper's existing
emptyAsNullsemantics, so whitespace-only values remain equivalent to empty inputs.The validation inside
dist/main.jsremains unchanged as defense in depth and for callers that invoke the helper command directly.Why this belongs before setup
None of these checks needs repository contents, credentials, network access, a running proxy, or modified host state. Failing after those operations provides no additional information and can leave the job changed even though Codex could never have run.
Regression coverage
Added six direct Node-stdlib tests covering:
prompt+prompt-filefails;output-schema+output-schema-filefails;permission-profile+sandboxfails;permission-profile+read-onlysafety strategy fails.Validation
main(c385816875cc2fc8e033ed9d1cba96f8c331210e);src/change, so the checked-indist/main.jsbundle remains valid.Risk
Low. These configurations already fail today. The only behaviour change is when they fail: before side effects instead of after them.