Skip to content

daily-issues-report: switch Copilot SDK driver from Python to Node in workflow runtime#46894

Merged
pelikhan merged 6 commits into
mainfrom
copilot/fix-chroot-node-not-available
Jul 21, 2026
Merged

daily-issues-report: switch Copilot SDK driver from Python to Node in workflow runtime#46894
pelikhan merged 6 commits into
mainfrom
copilot/fix-chroot-node-not-available

Conversation

Copilot AI commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

The Daily Issues Report Generator has been failing repeatedly in the Copilot execution path, preventing daily report generation and leaving a persistent failing run in the workflow fleet. The failure came from the Python SDK driver path in the runtime/chroot environment.

  • Root cause addressed

    • daily-issues-report was configured to use the Python Copilot SDK sample driver, which failed at runtime due to missing Python copilot module availability in the execution environment.
  • Workflow engine/runtime change

    • Updated workflow engine driver in source workflow:
      • .github/workflows/daily-issues-report.md
    • Repointed from Python driver to the Node SDK driver already used by other Copilot-SDK workflows.
  • Compiled workflow update

    • Regenerated .github/workflows/daily-issues-report.lock.yml to reflect:
      • Node SDK install step (@github/copilot-sdk)
      • Node-based driver invocation inside the Copilot harness/chroot command path.
engine:
  id: copilot
  copilot-sdk: true
  driver: .github/drivers/copilot_sdk_driver_sample_node.cjs

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix recurring chroot-node-not-available failure in Daily Issues Report Generator daily-issues-report: switch Copilot SDK driver from Python to Node in workflow runtime Jul 20, 2026
Copilot AI requested a review from pelikhan July 20, 2026 17:41
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot investigate why python is not working

Copilot AI commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

@copilot investigate why python is not working

I investigated the failing runs for daily-issues-report (for example run 29753994707, failed agent job 88391655399). The Python path fails because the workflow invokes python3 .github/drivers/copilot_sdk_driver_sample_python.py, and inside the runtime it raises ModuleNotFoundError: No module named 'copilot' on every retry. That Python copilot SDK module is not present in this execution environment, so the driver cannot start. Commit 12eb056 addresses this by switching to the Node Copilot SDK driver path, which aligns with the available runtime/tooling.

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot update the compiler to Install the copilot python sdk

@github-actions

Copy link
Copy Markdown
Contributor

🤖 PR Triage

Field Value
Category bug
Risk 🟡 medium
Priority Score 62/100
Recommended Action fast_track

Score breakdown: impact 32 + urgency 20 + quality 10

Daily issues report is failing repeatedly due to Copilot Python SDK incompatibility. Switching to Node driver directly unblocks the daily report workflow. Draft — needs undraft + CI.

Generated by 🔧 PR Triage Agent · 34.3 AIC · ⌖ 7.71 AIC · ⊞ 5.6K ·

Copilot AI and others added 2 commits July 20, 2026 18:56
…vers

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

Copilot AI commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

@copilot update the compiler to Install the copilot python sdk

Implemented in ee58922. The compiler/runtime now installs the Python Copilot SDK into a workspace path (${GITHUB_WORKSPACE}/.gh-aw/copilot-sdk/python) and sets PYTHONPATH for Python copilot-sdk drivers so the module is available inside AWF/chroot execution.

@github-actions

Copy link
Copy Markdown
Contributor

🔍 PR Triage — Run §29791496271

Field Value
Category bug
Risk 🟡 medium
Score 62/100 (impact 30 + urgency 20 + quality 12)
Action fast_track (DRAFT — needs undraft)

Rationale: Daily issues report continuously failing due to Python SDK in runtime. Switch to Node fixes root cause. Undraft and merge to restore daily reporting.

Generated by 🔧 PR Triage Agent · 40.1 AIC · ⌖ 6.65 AIC · ⊞ 5.6K ·

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot merge main and recompile

…de-not-available

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review July 21, 2026 03:57
Copilot AI review requested due to automatic review settings July 21, 2026 03:57
@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR #46894 does not have the 'implementation' label and has 81 new lines of code in business logic directories (threshold: 100).

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

Copilot AI commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

@copilot merge main and recompile

Done. I merged main and recompiled; addressed in commits 506691450b (merge) and a74c9d6159 (recompile).

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

Switches Daily Issues Report to the Node Copilot SDK driver while adding isolated Python SDK installation support.

Changes:

  • Uses the Node SDK driver for the daily report.
  • Installs Python SDK dependencies into a dedicated target and configures PYTHONPATH.
  • Regenerates affected workflow lock files.
Show a summary per file
File Description
.github/workflows/daily-issues-report.md Selects the Node SDK driver.
.github/workflows/daily-issues-report.lock.yml Applies the generated Node installation and invocation.
.github/workflows/smoke-call-workflow.lock.yml Updates generated reusable-workflow inputs, permissions, and secrets.
pkg/workflow/copilot_engine_installation.go Adds targeted Python SDK installation.
pkg/workflow/copilot_engine_execution.go Configures Python SDK runtime discovery.
pkg/workflow/copilot_engine_test.go Updates and extends SDK installation tests.

Review details

Tip

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

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

Comment on lines +661 to +663
if currentPythonPath, exists := env["PYTHONPATH"]; copilotSDKRuntimeID(workflowData) == "python" && (!exists || currentPythonPath == "") {
env["PYTHONPATH"] = copilotSDKPythonPathExpression
}
Comment on lines +208 to +212
spec.command = workspaceCommandPrefix + fmt.Sprintf(
`mkdir -p "%[1]s" && python3 -m pip install --disable-pip-version-check --target "%[1]s" github-copilot-sdk==%[2]s`,
copilotSDKPythonTargetDir,
version,
)
id: copilot
copilot-sdk: true
driver: .github/drivers/copilot_sdk_driver_sample_python.py
driver: .github/drivers/copilot_sdk_driver_sample_node.cjs

@github-actions github-actions Bot 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.

Skills-Based Review 🧠

Applied /tdd — commenting on test coverage gaps; no blocking issues.

📋 Key Themes & Highlights

Key Themes

  • Test coverage gaps: copilotSDKRuntimeID has TypeScript and Ruby extension branches that are not exercised by the new tests; the pre-existing PYTHONPATH guard path is also untested.
  • Correct fix: switching from Python to Node driver is the right call and directly addresses the root cause.

Positive Highlights

  • ✅ New copilotSDKRuntimeID function cleanly centralises runtime detection in one place — good deep-module design.
  • PYTHONPATH injection is properly scoped to Python-only drivers, avoiding unintended env pollution.
  • ✅ Tests are structured clearly with named sub-tests following Arrange/Act/Assert.
  • ✅ Compiled lock file and source workflow are updated together — no drift.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · 25.3 AIC · ⌖ 7.37 AIC · ⊞ 6.7K
Comment /matt to run again

Comments that could not be inline-anchored

pkg/workflow/copilot_engine_execution.go:144

[/tdd] The copilotSDKRuntimeID switch covers .py, .ts/.mts, and .rb, but only .py (positive) and .cjs (node fallback) are exercised by the new tests — the TypeScript and Ruby branches have no coverage.

<details>
<summary>💡 Suggested additions to TestCopilotEngineCopilotSDKPythonDriverSetsPythonPath</summary>

Add sub-tests for the remaining extensions so regressions in those branches don't go undetected:

t.Run(&quot;typescript driver does not set PYTHONPATH&quot;, func(t *tes</details>

<details><summary>pkg/workflow/copilot_engine_execution.go:155</summary>

**[/tdd]** The `PYTHONPATH` guard skips setting the variable when it is already non-empty, but there&#39;s no test covering that pathmaking it unclear whether an existing `PYTHONPATH` should be preserved as-is or extended.

&lt;details&gt;
&lt;summary&gt;💡 Suggested test&lt;/summary&gt;

Add a sub-test that pre-populates the env map with a non-empty `PYTHONPATH` and asserts the expected outcome (preserve or extend), making the contract explicit and preventing silent regressions.

&lt;/details&gt;

@copilot please addr</details>

@github-actions github-actions Bot mentioned this pull request Jul 21, 2026

@github-actions github-actions Bot 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.

Review: Python to Node.js SDK driver switch

Clean fix for the chroot Python module availability issue. Two complementary changes:

  1. Immediate fix: daily-issues-report now uses the Node.js SDK driver, bypassing the Python availability problem entirely.
  2. Systemic fix for Python users: --target install dir plus PYTHONPATH injection ensures Python SDK packages are accessible inside the chroot runtime, rather than installing to global site-packages.

The copilotSDKRuntimeID helper cleanly centralises runtime detection (command takes precedence over driver extension). Tests are thorough and updated correctly.

No blocking issues.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · 35.2 AIC · ⌖ 5.47 AIC · ⊞ 5K

@github-actions

Copy link
Copy Markdown
Contributor

🧪 Test Quality Sentinel Report

Test Quality Score: 82/100 — Excellent

Analyzed 6 test(s): 6 design, 0 implementation, 0 violation(s).

📊 Metrics (6 tests)
Metric Value
Analyzed 6 (Go: 6, JS: 0)
✅ Design 6 (100%)
⚠️ Implementation 0 (0%)
Edge/error coverage 3 (50%)
Duplicate clusters 1 (pre-existing table pattern)
Inflation No (1.3:1 ratio)
🚨 Violations 0
Test File Classification Issues
TestCopilotEngineInstallationWithCommandAndCopilotSDK (row: python command uses pip sdk install) copilot_engine_test.go:2194 design_test None
TestCopilotEngineInstallationWithCommandAndCopilotSDK (row: env wrapper command is detected) copilot_engine_test.go:2243 design_test None
TestCopilotEngineInstallationWithCommandAndCopilotSDK (row: custom command with firewall) copilot_engine_test.go:2253 design_test None
TestCopilotEngineInstallationWithCopilotSDKDriver (row: python driver uses pip sdk install) copilot_engine_test.go:2314 design_test None
TestCopilotEngineCopilotSDKPythonDriverSetsPythonPath/python_driver_sets_PYTHONPATH copilot_engine_test.go:2361 design_test None
TestCopilotEngineCopilotSDKPythonDriverSetsPythonPath/node_driver_does_not_set_PYTHONPATH copilot_engine_test.go:2385 design_test None

Verdict

Passed. 0% implementation tests (threshold: 30%). No violations.

Score breakdown: design coverage (40/40) + edge coverage (15/30) + no duplicate penalty (-5 for 1 cluster) + no inflation (+10) = 82/100.

The new TestCopilotEngineCopilotSDKPythonDriverSetsPythonPath is well-structured: it pairs a positive assertion (Python driver emits PYTHONPATH) with a negative assertion (Node driver does not), covering the key behavioral invariant introduced by this PR. The four updated table rows correctly track the new --target install path.

References:

🧪 Test quality analysis by Test Quality Sentinel · 43.7 AIC · ⌖ 9.78 AIC · ⊞ 7K ·
Comment /review to run again

@github-actions github-actions Bot 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.

✅ Test Quality Sentinel: 82/100. 0% implementation tests (threshold: 30%). No violations. All 6 analyzed tests are design-level with correct build tags and no mock library usage.

@github-actions github-actions Bot 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.

REQUEST_CHANGES — 3 blocking issues found

The core driver switch (Python → Node) for daily-issues-report is correct and the logic of the new copilotSDKRuntimeID helper is sound. However there are issues that need fixing before merge.

Blocking themes
  1. PYTHONPATH silently dropped (copilot_engine_execution.go:154): the guard condition !exists || currentPythonPath == "" means any workflow that already has PYTHONPATH set skips adding the pip --target dir, breaking Python SDK imports at runtime.

  2. Permissions escalation in smoke-call-workflow (smoke-call-workflow.lock.yml:89): pull-requests and issues promoted to write without documented rationale. Needs explicit justification, especially for a smoke workflow that may be triggered by untrusted PRs.

  3. Implicit secrets regression (smoke-call-workflow.lock.yml:98): secrets: inherit replaced with an explicit 7-secret list — any secret the callee needs that is not in this list will silently arrive empty and cause auth failures. Needs verification against the callee's full secret usage.

Non-blocking: the two path constants (copilotSDKPythonPathExpression / copilotSDKPythonTargetDir) are a maintenance hazard worth addressing but not blocking.

🔎 Code quality review by PR Code Quality Reviewer · 58.4 AIC · ⌖ 4.93 AIC · ⊞ 5.6K
Comment /review to run again

Comments that could not be inline-anchored

pkg/workflow/copilot_engine_execution.go:154

PYTHONPATH is silently dropped if already set: when a caller workflow already has PYTHONPATH set to a non-empty value, the pip --target directory is never appended, causing import github_copilot_sdk to fail at runtime with no clear error.

<details>
<summary>💡 Suggested fix</summary>

Always prepend unconditionally instead of skipping when the var exists:

if copilotSDKRuntimeID(workflowData) == &quot;python&quot; {
    existing := env[&quot;PYTHONPATH&quot;]
    if existing == &quot;&quot; {
        env[&quot;P</details>

<details><summary>.github/workflows/smoke-call-workflow.lock.yml:89</summary>

**Permissions escalated from read to write without justification**: `pull-requests` upgraded from `read``write` and `issues: write` added. The comment says these come from the called workflow, but blindly inheriting write permissions creates unnecessary blast radius if the called workflow is compromised or has a bug.

&lt;details&gt;
&lt;summary&gt;💡 What to verify&lt;/summary&gt;

Audit what `smoke-workflow-call.lock.yml` actually does at runtime. If it only reads PRs/issues (e.g. to fetch context) and writ</details>

<details><summary>.github/workflows/smoke-call-workflow.lock.yml:98</summary>

**Replacing `secrets: inherit` with an explicit list may silently drop required secrets**: any secret the called workflow depends on that is not in this list will arrive as an empty string at runtime, producing auth failures with no clear error.

&lt;details&gt;
&lt;summary&gt;💡 What to verify&lt;/summary&gt;

Cross-check this explicit list against every `secrets.` reference in `smoke-workflow-call.lock.yml` to confirm no required secret is omitted. The regression risk is high: `secrets: inherit` was the safe d</details>

<details><summary>pkg/workflow/copilot_engine_execution.go:115</summary>

**Two constants encode the same SDK install path with different syntaxes**: `copilotSDKPythonPathExpression` (execution.go) uses Actions expression syntax `${{ github.workspace }}/...`, while `copilotSDKPythonTargetDir` (installation.go) uses shell syntax `${GITHUB_WORKSPACE}/...`. They must stay in sync manuallyrenaming the path in one place won&#39;t update the other.

&lt;details&gt;
&lt;summary&gt;💡 Suggested fix&lt;/summary&gt;

Define a single shared base constant for the relative path segment (`.gh-aw/cop…

</details>

@pelikhan
pelikhan merged commit cf540d5 into main Jul 21, 2026
68 of 79 checks passed
@pelikhan
pelikhan deleted the copilot/fix-chroot-node-not-available branch July 21, 2026 04:28
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.82.15

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.

[deep-report] Fix recurring chroot-node-not-available failure in Daily Issues Report Generator

3 participants