Skip to content

Fix TypeScript SDK driver: resolve ts-node from workspace-local node_modules/.bin#48018

Merged
pelikhan merged 7 commits into
mainfrom
copilot/aw-fix-daily-github-docs-seo-optimizer
Jul 25, 2026
Merged

Fix TypeScript SDK driver: resolve ts-node from workspace-local node_modules/.bin#48018
pelikhan merged 7 commits into
mainfrom
copilot/aw-fix-daily-github-docs-seo-optimizer

Conversation

Copilot AI commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

The Daily GitHub Docs SEO Optimizer failed immediately because the copilot harness tried to spawn ts-node as a bare command, but npm installs it locally into ${GITHUB_WORKSPACE}/node_modules/.bin/ which is not in the firewall container's PATH.

Changes

  • pkg/workflow/copilot_engine_execution.gocopilotSDKDriverExecArgs now returns the full workspace-relative path for .ts/.mts drivers instead of a bare command name:
// Before
case ".ts", ".mts":
    return "ts-node", driverName

// After
case ".ts", ".mts":
    return `"${GITHUB_WORKSPACE}/node_modules/.bin/ts-node"`, driverName
  • pkg/workflow/copilot_engine_test.go — Updated assertion to verify the full path rather than the bare ts-node name.

  • .github/workflows/daily-github-docs-seo-optimizer.lock.yml — Recompiled to pick up the fix.

The install step (npm install --ignore-scripts --no-save ... ts-node typescript) is unchanged; only the execution invocation is corrected to match where npm actually places the binary.


Generated by 👨‍🍳 PR Sous Chef · gpt54 · 10 AIC · ⌖ 6.99 AIC · ⊞ 7.1K ·
Comment /souschef to run again


Generated by 👨‍🍳 PR Sous Chef · gpt54 · 28.9 AIC · ⌖ 8.1 AIC · ⊞ 7.1K ·
Comment /souschef to run again

The copilot engine harness failed to spawn ts-node because it was installed
locally via npm into ${GITHUB_WORKSPACE}/node_modules/.bin/ which is not in
PATH inside the firewall container.

Change copilotSDKDriverExecArgs to use the full workspace-relative path
"${GITHUB_WORKSPACE}/node_modules/.bin/ts-node" instead of bare "ts-node"
for .ts/.mts driver files, matching how npm installs it locally.

Recompile the daily-github-docs-seo-optimizer workflow to pick up the fix.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix daily GitHub Docs SEO Optimizer workflow failure Fix TypeScript SDK driver: resolve ts-node from workspace-local node_modules/.bin Jul 25, 2026
Copilot AI requested a review from pelikhan July 25, 2026 15:10
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot do not use ts-node, node 24 runs typescript natively

… drivers

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

Copilot AI commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

@copilot do not use ts-node, node 24 runs typescript natively

Done. Switched .ts/.mts drivers to use native Node.js (via $GH_AW_NODE_EXEC) instead of ts-node. Changes in the commit above:

  • copilotSDKDriverExecArgs now returns "$GH_AW_NODE_EXEC" for .ts/.mts (same as .js)
  • sdkDriverInstallCommand no longer generates a ts-node command for TypeScript drivers, so the install step just installs the SDK via npm (no ts-node typescript packages)
  • Recompiled workflows — the daily-github-docs-seo-optimizer lock now runs "$GH_AW_NODE_EXEC" ... driver.ts with a plain npm install --ignore-scripts --no-save @github/copilot-sdk@...

@pelikhan
pelikhan marked this pull request as ready for review July 25, 2026 16:43
Copilot AI review requested due to automatic review settings July 25, 2026 16:43
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot resolve the merge conflicts on this branch.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Attempts to fix TypeScript SDK driver startup by switching execution from ts-node to native Node.js.

Changes:

  • Runs .ts/.mts drivers with GH_AW_NODE_EXEC.
  • Removes TypeScript toolchain installation.
  • Recompiles the affected workflow.
Show a summary per file
File Description
pkg/workflow/copilot_engine_execution.go Changes TypeScript driver execution.
pkg/workflow/copilot_engine_installation.go Removes ts-node and TypeScript installation.
pkg/workflow/copilot_engine_test.go Updates execution and installation assertions.
.github/workflows/daily-github-docs-seo-optimizer.lock.yml Regenerates the workflow.

Review details

Tip

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

  • Files reviewed: 4/4 changed files
  • Comments generated: 3
  • Review effort level: Medium

Comment on lines +149 to +150
// Node 24 runs TypeScript natively; use the same node executor as .js drivers.
return `"$GH_AW_NODE_EXEC"`, driverName
Comment on lines +271 to +273
case "typescript":
spec.stepName = "Install GitHub Copilot SDK (TypeScript)"
spec.command = workspaceCommandPrefix + "npm install --ignore-scripts --no-save @github/copilot-sdk@" + version + " ts-node typescript"
spec.command = workspaceCommandPrefix + "npm install --ignore-scripts --no-save @github/copilot-sdk@" + version
Comment thread pkg/workflow/copilot_engine_test.go Outdated
Comment on lines 548 to 550
if !strings.Contains(stepContent, "GH_AW_NODE_EXEC") {
t.Fatalf("Expected TypeScript SDK driver mode to use native node executor, got:\n%s", stepContent)
}
…github-docs-seo-optimizer

# Conflicts:
#	.github/workflows/daily-github-docs-seo-optimizer.lock.yml

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

Copilot AI commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts on this branch.

Done. Merged origin/main into this branch. The only conflict was in daily-github-docs-seo-optimizer.lock.yml — resolved by keeping our native Node.js approach (no ts-node) while adopting the updated version numbers from main (Copilot CLI 1.0.75, SDK 1.0.8). All lock files are in sync and tests pass.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, address the unresolved review feedback below, and rerun checks once the branch is up to date.

Unresolved review feedback (newest first):

Generated by 👨🍳 PR Sous Chef
Comment /souschef to run again

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 10 AIC · ⌖ 6.99 AIC · ⊞ 7.1K ·
Comment /souschef to run again

… for engine.command: ts-node, improve tests

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, address the unresolved review feedback below, and rerun checks once the branch is up to date.

Unresolved review feedback (newest first):...

Done. Three review threads addressed in commit c7c0cf8:

  • execution.go:149-150 (Node 24 not guaranteed): Added requiresNode24ForTypeScriptSDKDriver in runtime_detection.go — TypeScript Copilot SDK drivers (.ts/.mts extension) now emit a setup-node node-version: '24' step in the agent job before execution. The daily-github-docs-seo-optimizer lock file confirms the new step.

  • installation.go:271-273 (ts-node packages removed): Restored ts-node typescript to the typescript install spec in getCopilotSDKInstallSpec. This case is only reached when engine.command: ts-node ... is explicitly configured. File-extension-based .ts detection routes through the node spec (no ts-node needed).

  • test.go:548-550 (weak assertion): Added TestCopilotSDKDriverExecArgs — a direct table-driven unit test for copilotSDKDriverExecArgs covering all extensions, explicitly asserting .ts/.mts returns "$GH_AW_NODE_EXEC" and NOT ts-node. Strengthened TestCopilotEngineExecutionStepsWithCopilotSDKTypeScriptDriver to check the harness argument sequence (copilot_harness.cjs "$GH_AW_NODE_EXEC") and confirm ts-node is absent.

CI needs a human re-trigger (close/reopen PR or push from a maintainer) before merge.

Copilot AI requested a review from gh-aw-bot July 25, 2026 17:45
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, address the remaining review feedback and failed checks, and rerun checks once the branch is up to date.

Unresolved review feedback (newest first):

Failed checks:

The branch has a follow-up response, but the review threads still appear unresolved and lint-go is failing. Please finish the outstanding fixes, resolve any addressed threads, and leave the PR ready for maintainer review.

Generated by 👨🍳 PR Sous Chef
Comment /souschef to run again

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 28.9 AIC · ⌖ 8.1 AIC · ⊞ 7.1K ·
Comment /souschef to run again

…ime_detection.go

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, address the remaining review feedback and failed checks, and rerun checks once the branch is up to date.

Unresolved review feedback (newest first):...

Fixed the lint-go failure in commit above: runtime_detection.go:183 was using strings.ToLower(filepath.Ext(...)) == ".ts" — replaced with strings.EqualFold(filepath.Ext(...), ".ts") as the -tolowerequalfold linter requires. make fmt, make lint, and make test-unit all pass locally.

All three review threads were addressed in the prior commit (5ebd7ac):

  • Node 24 for .ts drivers: requiresNode24ForTypeScriptSDKDriver now emits a setup-node node-version: '24' step before execution.
  • ts-node install for engine.command: ts-node ...: Restored ts-node typescript to the typescript install spec in getCopilotSDKInstallSpec.
  • Weak test assertion: Added TestCopilotSDKDriverExecArgs table-driven unit test directly testing copilotSDKDriverExecArgs for all extensions.

CI needs a human re-trigger (close/reopen or push from maintainer) before merge.

@github-actions

Copy link
Copy Markdown
Contributor

🤖 PR Triage

Field Value
Category bug
Risk Medium
Priority Score 72/100
Score Breakdown impact: 35, urgency: 22, quality: 15
Recommended Action ⚡ fast_track
CI Status ✅ build/windows passing, in-progress

Rationale: Fixes a real runtime failure (ts-node not found in PATH) in the Copilot engine execution path, affecting TypeScript SDK workflows. Changes are focused (6 files, path resolution logic). CI checks are passing. Medium risk due to touching core workflow runtime code.

Generated by 🔧 PR Triage Agent · sonnet46 · 36.7 AIC · ⌖ 8.07 AIC · ⊞ 5.7K ·

@pelikhan
pelikhan merged commit d8dc0d3 into main Jul 25, 2026
@pelikhan
pelikhan deleted the copilot/aw-fix-daily-github-docs-seo-optimizer branch July 25, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[aw] Daily GitHub Docs SEO Optimizer failed

4 participants