Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 22, 2025

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_issue job could not find the expected agent_output.json file. The agent job completed successfully, but did not create the safe-outputs file that the downstream job expected.

Failure Details

  • Run: #18715612738
  • Commit: ecbbe48
  • Trigger: schedule
  • Duration: 1.2 minutes
  • Failed Job: create_issue (5s duration)

Root Cause Analysis

Primary Error

Error reading agent output file: ENOENT: no such file or directory, open '/tmp/gh-aw/safe-outputs/agent_output.json'

Investigation Findings

The workflow execution shows:

  1. activation job succeeded (4s)
  2. agent job succeeded (19s)
  3. detection job succeeded (14s)
  4. create_issue job failed (5s)

The create_issue job 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

  • Staged Mode: Enabled (GH_AW_SAFE_OUTPUTS_STAGED: true)
  • Workflow: Smoke OpenCode
  • Agent Output Path: /tmp/gh-aw/safe-outputs/agent_output.json

Failed Jobs and Errors

create_issue Job

  • Status: Failed
  • Conclusion: failure
  • Duration: 5 seconds
  • Error: File not found when attempting to read agent output

The job attempted to read the agent output file to process any issue creation requests, but the file did not exist.

Recommended Actions

  • HIGH PRIORITY: Review the agent job logs from run githubnext/gh-aw#18715612738 to determine if the agent attempted to use safe-outputs tools
  • HIGH PRIORITY: Verify the safe-outputs mechanism is working correctly in the Smoke OpenCode workflow
  • HIGH PRIORITY: Check if the OpenCode agent has the proper configuration to write to /tmp/gh-aw/safe-outputs/
  • MEDIUM PRIORITY: Make the create_issue job conditional - only run when agent_output.json exists
  • MEDIUM PRIORITY: Add graceful handling in create_issue job when the output file is missing (skip instead of fail)
  • LOW PRIORITY: Add debug logging to confirm safe-outputs file creation in the agent job

Prevention Strategies

  1. Conditional Job Execution: Use GitHub Actions conditionals to only run create_issue when the agent output file exists:

    if: hashFiles('/tmp/gh-aw/safe-outputs/agent_output.json') != ''
  2. Graceful Degradation: Modify the create_issue job to check for file existence and log a message instead of failing when the file is missing

  3. Validation Step: Add an intermediate job that validates the agent output and sets outputs for downstream jobs to use in conditionals

  4. 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 missing agent_output.json files. 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:

  • Permission issues with GitHub MCP tools
  • Authentication failures in workflow_run triggers
  • Detection job failures

This represents a new category of failure related to the safe-outputs mechanism.

Related Information

  • Commit: The failure occurred on commit ecbbe48 which added "scheduling best practices guidance for daily workflows"
  • Job Sequence: All upstream jobs (activation, agent, detection) completed successfully
  • Safe-Outputs: The workflow has staging mode enabled, which should preview actions without executing them

Labels: smoke-test, investigation, safe-outputs, configuration

AI generated by Smoke Outpost - Smoke Test Failure Investigator</issue_description>

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.

@pelikhan pelikhan closed this Oct 22, 2025
@pelikhan pelikhan deleted the copilot/fix-missing-agent-output-file branch October 22, 2025 12:38
Copilot AI requested a review from pelikhan October 22, 2025 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[smoke-outpost] 🔍 Smoke Test Investigation - Smoke OpenCode: Missing agent_output.json File

2 participants