Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 20, 2025

Problem

The copilot engine was only adding /tmp/gh-aw/ to its default --add-dir arguments, but not /tmp/gh-aw/agent/ or the root /tmp/ directory. This meant that the AI agent didn't have explicit access to:

  1. The root temporary directory /tmp/
  2. The agent-specific temporary directory /tmp/gh-aw/agent/ that is created by the workflow compiler via create_gh_aw_tmp_dir.sh and recommended to agents in temp_folder_prompt.md with the instruction: "always use the /tmp/gh-aw/agent/ directory for temporary files"

Solution

Added --add-dir /tmp/, --add-dir /tmp/gh-aw/, and --add-dir /tmp/gh-aw/agent/ to the default copilot CLI arguments in GetExecutionSteps(). Now the copilot command includes all three directories:

copilot --add-dir /tmp/ --add-dir /tmp/gh-aw/ --add-dir /tmp/gh-aw/agent/ --log-level all ...

This ensures the AI agent has explicit access to:

  • The root /tmp/ directory for general temporary file operations
  • The base /tmp/gh-aw/ directory for workflow-related files
  • The recommended /tmp/gh-aw/agent/ directory for agent-specific temporary files

This aligns the CLI configuration with the instructions provided in the workflow prompts.

Changes

  • pkg/workflow/copilot_engine.go: Added "--add-dir", "/tmp/", "--add-dir", "/tmp/gh-aw/", and "--add-dir", "/tmp/gh-aw/agent/" to default arguments
  • pkg/workflow/copilot_engine_test.go: Updated test to verify all three directories are present
  • All .lock.yml files: Recompiled to reflect the new default arguments

Testing

  • ✅ All unit and integration tests pass
  • ✅ All 39 workflows compile successfully
  • ✅ Verified with manual workflow compilation
  • ✅ Works correctly with cache-memory configurations (maintains proper order of --add-dir arguments)
Original prompt

Make sure that --add-dir /tmp/gh-aw/agent/ is part of the default arguments for copilot engine cli


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@pelikhan
Copy link
Contributor

@copilot also add --add-dir /tmp/ to the copilot cli

Copilot AI changed the title [WIP] Add default arguments for copilot engine CLI Add --add-dir /tmp/gh-aw/agent/ to copilot engine default arguments Oct 21, 2025
Copilot AI requested a review from pelikhan October 21, 2025 00:04
@pelikhan pelikhan marked this pull request as ready for review October 21, 2025 00:11
@github-actions
Copy link
Contributor

Agentic Changeset Generator triggered by this pull request.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 21, 2025

@copilot also add --add-dir /tmp/ to the copilot cli

Added --add-dir /tmp/ to the default copilot CLI arguments. The command now includes all three directories: /tmp/, /tmp/gh-aw/, and /tmp/gh-aw/agent/ (commit 2d72b6e).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@pelikhan pelikhan merged commit a28fc1c into main Oct 21, 2025
3 checks passed
@pelikhan pelikhan deleted the copilot/add-default-arguments-copilot-cli branch October 21, 2025 00:14
Copilot AI changed the title Add --add-dir /tmp/gh-aw/agent/ to copilot engine default arguments Add --add-dir arguments (/tmp/, /tmp/gh-aw/, /tmp/gh-aw/agent/) to copilot engine default arguments Oct 21, 2025
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.

2 participants