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
4 changes: 2 additions & 2 deletions .github/workflows/copilot-sdk-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ jobs:
}
EOF

# Run the client
DEBUG=copilot-client cat /tmp/test/config.json | node dist/cli.js
# Run the client (using index.js which exports main())
DEBUG=copilot-client cat /tmp/test/config.json | node -e "import('./dist/index.js').then(m => m.main())"
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

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

DEBUG=copilot-client is being set for cat rather than the Node process because of the pipe, so the client won't actually run with debug logging as the comment suggests. Prefer feeding the config via stdin redirection into the node command (or otherwise apply DEBUG to node), and add a .catch(...) on the import(...).then(...) chain to ensure module load / execution failures consistently fail the step with a non-zero exit code.

Suggested change
DEBUG=copilot-client cat /tmp/test/config.json | node -e "import('./dist/index.js').then(m => m.main())"
DEBUG=copilot-client node -e "import('./dist/index.js').then(m => m.main()).catch(err => { console.error(err); process.exit(1); })" < /tmp/test/config.json

Copilot uses AI. Check for mistakes.

# Verify event log was created
if [ ! -f /tmp/test/events.jsonl ]; then
Expand Down
2 changes: 1 addition & 1 deletion copilot-client/test-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ cat /tmp/copilot-client-test/config.json
# Run the client with debug logging
echo ""
echo "Running copilot-client..."
DEBUG=copilot-client cat /tmp/copilot-client-test/config.json | node dist/cli.js
DEBUG=copilot-client cat /tmp/copilot-client-test/config.json | node -e "import('./dist/index.js').then(m => m.main())"
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

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

DEBUG=copilot-client is currently applied to cat (left side of the pipe), not to the Node process. That means debug logging won't be enabled for the client. Consider redirecting stdin into Node (e.g., node … < config.json) or otherwise ensuring DEBUG is set on the node command in the pipeline; also add an explicit .catch(...) on the dynamic import chain so a failed import/main invocation reliably fails the script with a non-zero exit code.

Suggested change
DEBUG=copilot-client cat /tmp/copilot-client-test/config.json | node -e "import('./dist/index.js').then(m => m.main())"
DEBUG=copilot-client node -e 'import("./dist/index.js").then(m => m.main()).catch(err => { console.error(err); process.exit(1); });' < /tmp/copilot-client-test/config.json

Copilot uses AI. Check for mistakes.

# Check results
echo ""
Expand Down