[WIP] Fix missing agent_output.json file in Smoke OpenCode #2128
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.
Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.
Original prompt
This section details on the original issue you should resolve
<issue_title>[smoke-outpost] 🔍 Smoke Test Investigation - Smoke OpenCode: Missing agent_output.json File</issue_title>
<issue_description>## Summary
The Smoke OpenCode workflow failed because the
create_issuejob could not find the expectedagent_output.jsonfile. The agent job completed successfully, but did not create the safe-outputs file that the downstream job expected.Failure Details
Root Cause Analysis
Primary Error
Investigation Findings
The workflow execution shows:
The
create_issuejob expects to read from/tmp/gh-aw/safe-outputs/agent_output.json, but this file was not created by the agent job. This suggests one of two scenarios:Scenario A: The agent completed its task without requesting any safe-output actions (issue creation, etc.), so no output file was generated.
Scenario B: There was an issue with the safe-outputs mechanism that prevented the file from being written despite the agent job succeeding.
Environment Context
GH_AW_SAFE_OUTPUTS_STAGED: true)/tmp/gh-aw/safe-outputs/agent_output.jsonFailed Jobs and Errors
create_issue Job
The job attempted to read the agent output file to process any issue creation requests, but the file did not exist.
Recommended Actions
/tmp/gh-aw/safe-outputs/create_issuejob conditional - only run whenagent_output.jsonexistscreate_issuejob when the output file is missing (skip instead of fail)Prevention Strategies
Conditional Job Execution: Use GitHub Actions conditionals to only run
create_issuewhen the agent output file exists:Graceful Degradation: Modify the
create_issuejob to check for file existence and log a message instead of failing when the file is missingValidation Step: Add an intermediate job that validates the agent output and sets outputs for downstream jobs to use in conditionals
Enhanced Logging: Add logging in the agent job to explicitly confirm when safe-outputs files are created
Historical Context
This is a new failure pattern. Previous audit data from
/tmp/gh-aw/cache-memory/shows no similar failures with missingagent_output.jsonfiles. The pattern database shows other error types (permission denied, authentication issues, detection failures) but not this specific issue.The smoke test workflows have been generally stable, with most recent failures being related to:
This represents a new category of failure related to the safe-outputs mechanism.
Related Information
Labels: smoke-test, investigation, safe-outputs, configuration
Comments on the Issue (you are @copilot in this section)
@pelikhan @copilot diff smoke codex and smoke Claude to determine the potential root cause of this issue. Investigate the run output.Fixes #2121
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.