Skip to content

Fix issue #26: run-qa-agent.sh and run-report-agent.sh don't build binary if missing#123

Merged
jpleva91 merged 1 commit intomainfrom
cata/brain-26-1775284725
Apr 4, 2026
Merged

Fix issue #26: run-qa-agent.sh and run-report-agent.sh don't build binary if missing#123
jpleva91 merged 1 commit intomainfrom
cata/brain-26-1775284725

Conversation

@jpleva91
Copy link
Copy Markdown
Contributor

@jpleva91 jpleva91 commented Apr 4, 2026

Auto-generated by Cata via /evolve dispatch

Copilot AI review requested due to automatic review settings April 4, 2026 06:42
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates agent runner scripts so they automatically build the shellforge binary when it’s not present, addressing issue #26.

Changes:

  • Add a preflight check in run-qa-agent.sh to build ./shellforge if missing.
  • Add a preflight check in run-report-agent.sh to build ./shellforge if missing.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
scripts/run-qa-agent.sh Builds shellforge on-demand before running the qa command.
scripts/run-report-agent.sh Builds shellforge on-demand before running the report command.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

set -euo pipefail
cd "$(dirname "$0")/.."

if [[ ! -f ./shellforge ]]; then
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

The existence check uses [[ ! -f ./shellforge ]], but the script later executes ./shellforge. If the file exists but isn’t executable (e.g., permissions changed), this will skip the build and then fail at exec. Consider checking -x (or ensuring executable via chmod +x) so the script reliably produces a runnable binary when needed.

Suggested change
if [[ ! -f ./shellforge ]]; then
if [[ ! -x ./shellforge ]]; then

Copilot uses AI. Check for mistakes.
Comment on lines +5 to 10
if [[ ! -f ./shellforge ]]; then
echo "[run-report-agent] Building shellforge..."
go build -o shellforge ./cmd/shellforge
fi

exec ./shellforge report "${1:-.}"
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

This build-and-run logic duplicates scripts/run-agent.sh (which already builds ./shellforge when missing). Consider delegating to run-agent.sh report ... to avoid the runners drifting (e.g., differing build flags or checks) as future changes happen.

Suggested change
if [[ ! -f ./shellforge ]]; then
echo "[run-report-agent] Building shellforge..."
go build -o shellforge ./cmd/shellforge
fi
exec ./shellforge report "${1:-.}"
exec ./scripts/run-agent.sh report "${1:-.}"

Copilot uses AI. Check for mistakes.
set -euo pipefail
cd "$(dirname "$0")/.."

if [[ ! -f ./shellforge ]]; then
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

The existence check uses [[ ! -f ./shellforge ]], but the script later executes ./shellforge. If the file exists but isn’t executable (e.g., permissions changed), this will skip the build and then fail at exec. Consider checking -x (or ensuring executable via chmod +x) so the script reliably produces a runnable binary when needed.

Suggested change
if [[ ! -f ./shellforge ]]; then
if [[ ! -x ./shellforge ]]; then

Copilot uses AI. Check for mistakes.
Comment on lines +5 to 10
if [[ ! -f ./shellforge ]]; then
echo "[run-qa-agent] Building shellforge..."
go build -o shellforge ./cmd/shellforge
fi

exec ./shellforge qa "${1:-.}"
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

This build-and-run logic duplicates scripts/run-agent.sh (which already builds ./shellforge when missing). Consider delegating to run-agent.sh qa ... to avoid the runners drifting (e.g., differing build flags or checks) as future changes happen.

Suggested change
if [[ ! -f ./shellforge ]]; then
echo "[run-qa-agent] Building shellforge..."
go build -o shellforge ./cmd/shellforge
fi
exec ./shellforge qa "${1:-.}"
exec ./scripts/run-agent.sh qa "${1:-.}"

Copilot uses AI. Check for mistakes.
@jpleva91 jpleva91 merged commit f153c7e into main Apr 4, 2026
10 checks passed
@jpleva91 jpleva91 deleted the cata/brain-26-1775284725 branch April 4, 2026 11:41
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