Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .github/workflows/daily-cli-performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,25 +87,27 @@ This workflow imports `shared/go-make.md` which provides:
- **mcpscripts-go** - Execute Go commands (e.g., args: "test ./...", "build ./cmd/gh-aw")
- **mcpscripts-make** - Execute Make targets (e.g., args: "build", "test-unit", "bench")

**IMPORTANT**: Always use these mcp-script tools for Go and Make commands instead of running them directly via bash.
**IMPORTANT**: Use **bash** for all benchmark and validation commands in this workflow. MCP connections time out after ~5 minutes of inactivity; the analysis phases in this workflow may exceed that threshold, causing end-of-phase MCP calls to fail with `MCP error -32003: context canceled`. Always prefer `make <target>` or `go <args>` in bash over `mcpscripts-*` tools in this workflow.

## Phase 1: Run Performance Benchmarks

### 1.1 Run Compilation Benchmarks

Run the benchmark suite and capture results using the **mcpscripts-make** tool:
Run the benchmark suite and capture results using **bash** (not mcpscripts — the MCP connection may time out during the analysis phases that follow):

**Step 1**: Create directory for results

```bash
mkdir -p /tmp/gh-aw/benchmarks
```

**Step 2**: Run benchmarks using mcpscripts-make
**Step 2**: Run benchmarks using bash

Use the **mcpscripts-make** tool with args: "bench-performance" to run the critical performance benchmark suite.
```bash
make bench-performance
```

This will execute `make bench-performance` which runs targeted performance benchmarks and saves results to `bench_performance.txt`.
This runs targeted performance benchmarks and saves results to `bench_performance.txt`.

The targeted benchmarks include:
- **Workflow compilation**: CompileSimpleWorkflow, CompileComplexWorkflow, CompileMCPWorkflow, CompileMemoryUsage
Expand Down
49 changes: 32 additions & 17 deletions .github/workflows/go-logger.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,16 @@ features:

You are an AI agent that improves Go code by adding debug logging statements to help with troubleshooting and development.

## Available Safe-Input Tools
## Validation Commands

This workflow imports `shared/go-make.md` which provides:
- **mcpscripts-go** - Execute Go commands (e.g., args: "test ./...", "build ./cmd/gh-aw")
- **mcpscripts-make** - Execute Make targets (e.g., args: "build", "test-unit", "lint", "recompile")
Use **bash** for all build, test, and validation commands in this workflow. Do **not** use `mcpscripts-make` or `mcpscripts-go` for validation — MCP connections can time out after ~5 minutes of inactivity during long file-exploration phases, causing end-of-session validation to fail with `MCP error -32003: context canceled`.

Use these tools for consistent execution instead of running commands directly via bash.
```bash
make build # Build the project
make test-unit # Run unit tests
make recompile # Recompile workflows
DEBUG=* ./gh-aw compile dev # Test workflow compilation with debug logging
```
Comment on lines +68 to +77
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow now instructs running make test-unit via bash, but this file’s tools.bash safe-command allowlist (frontmatter) doesn’t include make test-unit. If the agent can only run allowlisted commands, validation will be blocked. Add make test-unit to the bash allowlist (or switch to bash: true if unrestricted bash is acceptable for this workflow).

Copilot uses AI. Check for mistakes.

## Efficiency First: Check Cache

Expand Down Expand Up @@ -219,24 +222,33 @@ For each file:
- Don't over-log - focus on the most useful information
- Ensure messages are meaningful and helpful for debugging

### 5. Validate Changes
### 5. Early Validation (After First File)

After editing your **first file**, run a quick build to catch compilation errors early — before spending time on more files:

```bash
make build
```

This surfaces syntax errors or import issues immediately, saving time if the first edit has a problem.

After adding logging to the selected files, **validate your changes** before creating a PR:
### 6. Complete Validation (After All Files)

After adding logging to **all selected files**, validate your changes before creating a PR:

1. **Build the project to ensure no compilation errors:**
Use the mcpscripts-make tool with args: "build"

This will compile the Go code and catch any syntax errors or import issues.
```bash
make build
```
This compiles the Go code and catches any syntax errors or import issues.

2. **Run unit tests to ensure nothing broke:**
Use the mcpscripts-make tool with args: "test-unit"

```bash
make test-unit
```
This validates that your changes don't break existing functionality.

3. **Test the workflow compilation with debug logging enabled:**
Use the mcpscripts-go tool with args: "run ./cmd/gh-aw compile dev"

Or you can run it directly with bash if needed:
```bash
DEBUG=* ./gh-aw compile dev
```
Expand All @@ -246,9 +258,11 @@ After adding logging to the selected files, **validate your changes** before cre
- Debug logging from your changes appears in the output

4. **If needed, recompile workflows:**
Use the mcpscripts-make tool with args: "recompile"
```bash
make recompile
```

### 6. Create Pull Request
### 7. Create Pull Request

After validating your changes:

Expand Down Expand Up @@ -322,6 +336,7 @@ Before creating the PR, verify:
- [ ] No duplicate logging with existing logs
- [ ] Import statements are properly formatted
- [ ] Changes validated with `make build` (no compilation errors)
- [ ] Changes validated with `make test-unit` (tests pass)
- [ ] Workflow compilation tested with `DEBUG=* ./gh-aw compile dev`

## Important Notes
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/shared/go-make.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,19 @@ mcp-scripts:
make $INPUT_ARGS
---

**IMPORTANT**: Always use the `mcpscripts-go` and `mcpscripts-make` tools for Go and Make commands instead of running them directly via bash. These mcp-script tools provide consistent execution and proper logging.
**IMPORTANT — bash vs. MCP for validation:**

**Correct**:
- **Use `mcpscripts-go` / `mcpscripts-make` early in a session** (within the first few minutes) for consistent, logged execution of Go and Make commands.
- **Use direct bash commands for end-of-session validation** (i.e., after any file-exploration or analysis phase that may have taken more than ~5 minutes). MCP connections time out after ~5 minutes of inactivity; calling `mcpscripts-*` at the end of a long session fails with `MCP error -32003: context canceled`.

**Validation via bash (preferred at end of session or after long exploration):**
```bash
make build
make test-unit
make recompile
```

**MCP tools (use early in session, before long exploration phases):**
```
Use the mcpscripts-go tool with args: "test ./..."
Use the mcpscripts-make tool with args: "build"
Expand All @@ -39,8 +49,7 @@ Use the mcpscripts-make tool with args: "test-unit"
**Incorrect**:
```
Use the go mcp-script tool with args: "test ./..." ❌ (Wrong tool name - use mcpscripts-go)
Run: go test ./... ❌ (Use mcpscripts-go instead)
Execute bash: make build ❌ (Use mcpscripts-make instead)
Use the mcpscripts-make tool with args: "build" ❌ (after a long exploration phase — use bash instead)
```

<!--
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/smoke-claude.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,42 @@ When writing workflows that use `cache-memory` to persist data across runs, be a

## Key Features

### MCP Connection Inactivity Timeout — Use Bash for End-of-Session Validation

**⚠️ CRITICAL WORKFLOW AUTHORING RULE: Use bash, not MCP tools, for build/test validation at the end of a session.**

MCP connections (HTTP/WebSocket transports) time out after approximately **5 minutes of inactivity**. Workflows with long file-exploration or analysis phases routinely exceed this threshold. When the agent finally attempts an end-of-session validation call via an MCP tool (e.g., `mcpscripts-make build`, `mcpscripts-go test ./...`), the MCP transport has been torn down, resulting in:

```
MCP error -32003: context canceled
```

This causes the entire workflow session to fail at the last step, wasting all preceding work.

**Rule**: Always use direct `bash` commands for build, test, and validation steps — especially for any step that runs *after* a file-exploration or analysis phase:
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section states "Always use direct bash commands" for validation, but a few lines later it lists cases when mcpscripts-* tools are safe to use. To avoid contradictory guidance, consider rewording the rule to "Prefer bash for validation after >~5 minutes idle/long exploration; otherwise mcpscripts is fine" (aligning with the list below and with shared/go-make.md).

Suggested change
**Rule**: Always use direct `bash` commands for build, test, and validation steps — especially for any step that runs *after* a file-exploration or analysis phase:
**Rule**: Prefer direct `bash` commands for build, test, and validation steps that run *after* a long file-exploration or analysis phase (roughly 5+ minutes idle), since MCP transports may have timed out by then. For shorter, active sessions, `mcpscripts-*` tools are still fine when appropriate:

Copilot uses AI. Check for mistakes.

```bash
# ✅ CORRECT — use bash for validation
make build
make test-unit
make recompile
make agent-finish
go test ./...
```

```text
# ❌ INCORRECT — MCP tools fail after long inactivity
Use the mcpscripts-make tool with args: "build" ← may fail with context canceled
Use the mcpscripts-go tool with args: "test ./..." ← may fail with context canceled
```

**Additional rule**: Add an **intermediate validation checkpoint** using bash after the first major code edit (e.g., `make build`), not just at the very end of the session. This surfaces compile errors early, before the agent spends more context on subsequent edits.

**When `mcpscripts-*` tools are safe to use:**
- Early in a session, before any long exploration phase
- For short-lived workflows with no significant idle time between tool calls
- For non-validation operations that are inherently early in the session (e.g., fetching PRs with `mcpscripts-gh`)

### MCP Server Management
```bash
gh aw mcp list # List workflows with MCP servers
Expand Down
6 changes: 3 additions & 3 deletions pkg/actionpins/data/action_pins.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,10 @@
"version": "v2.2.0",
"sha": "0c5077e51419868618aeaa5fe8019c62421857d6"
},
"ruby/setup-ruby@v1.305.0": {
"ruby/setup-ruby@v1.306.0": {
"repo": "ruby/setup-ruby",
"version": "v1.305.0",
"sha": "0cb964fd540e0a24c900370abf38a33466142735"
"version": "v1.306.0",
"sha": "c4e5b1316158f92e3d49443a9d58b31d25ac0f8f"
Comment on lines +171 to +174
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR’s title/description focuses on MCP inactivity timeouts and switching validation instructions to bash, but this file also bumps the pinned ruby/setup-ruby action version/SHA. If this pin update is intentional, please mention it in the PR description; otherwise consider splitting it into a separate PR to keep changes focused.

Copilot uses AI. Check for mistakes.
},
"super-linter/super-linter@v8.6.0": {
"repo": "super-linter/super-linter",
Expand Down
6 changes: 3 additions & 3 deletions pkg/workflow/data/action_pins.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,10 @@
"version": "v2.2.0",
"sha": "0c5077e51419868618aeaa5fe8019c62421857d6"
},
"ruby/setup-ruby@v1.305.0": {
"ruby/setup-ruby@v1.306.0": {
"repo": "ruby/setup-ruby",
"version": "v1.305.0",
"sha": "0cb964fd540e0a24c900370abf38a33466142735"
"version": "v1.306.0",
"sha": "c4e5b1316158f92e3d49443a9d58b31d25ac0f8f"
Comment on lines +171 to +174
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR’s title/description focuses on MCP inactivity timeouts and switching validation instructions to bash, but this file also bumps the pinned ruby/setup-ruby action version/SHA. If this pin update is intentional, please mention it in the PR description; otherwise consider splitting it into a separate PR to keep changes focused.

Copilot uses AI. Check for mistakes.
},
"super-linter/super-linter@v8.6.0": {
"repo": "super-linter/super-linter",
Expand Down
Loading