Skip to content

Relocate Claude debug log outside agent data directory - #59450

Merged
pelikhan merged 1 commit into
mainfrom
copilot/update-debug-log-location
Sep 8, 2026
Merged

pelikhan merged 1 commit into
mainfrom
copilot/update-debug-log-location

Conversation

Copilot AI commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Claude’s debug log was stored under /tmp/gh-aw/agent, which is reserved for user-generated data. This could mix engine diagnostics with agent outputs.

Changes

  • Move the debug log to /tmp/gh-aw/claude-debug.log.
  • Preserve restrictive file permissions and artifact collection.
  • Update generated workflows, golden fixtures, and path assertions.
  • Add a patch changeset.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from pelikhan September 8, 2026 12:03
@pelikhan
pelikhan marked this pull request as ready for review September 8, 2026 12:03
Copilot AI balanced review requested due to automatic review settings September 8, 2026 12:03
@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Lean already. Ship.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • ab.chatgpt.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "ab.chatgpt.com"

See Network Configuration for more information.

Generated by Ponytail Reviewer for #59450

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

🔍 Design Decision Gate 🏗️ is checking for design decision records on this pull request...

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

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

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Comment Memory

reviewed_at: 2026-09-08T12:08:17Z
review_event: COMMENT
top_themes:
  - no blocking issues found in debug-log relocation
  - artifact and AWF path wiring stayed consistent
files_reviewed:
  - .changeset/patch-relocate-claude-debug-log.md
  - pkg/workflow/claude_engine.go
  - pkg/workflow/claude_engine_network_test.go
  - pkg/workflow/claude_engine_test.go
  - pkg/workflow/logs_test.go
  - pkg/workflow/testdata/TestWasmGolden_AllEngines/claude.golden
comment_count: 0

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 34.3 AIC · ⌖ 7.34 AIC · ⊞ 23.5K · ◷
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.

Verdict

Non-blocking change. The debug-log relocation looks internally consistent across the Claude engine, generated workflow output, and artifact declarations.

Highlights

I checked the only plausible failure mode here — breaking the AWF host/container artifact contract by moving the file out of /tmp/gh-aw/agent — and this patch updates every relevant surface in the diff: host-side pre-creation, --debug-file, declared output files, generated workflow golden output, and tests. The grumpy sub-agent raised the same concern, but it does not hold up against the actual wiring in buildClaudeFullCommand and GetDeclaredOutputFiles.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 34.3 AIC · ⌖ 7.34 AIC · ⊞ 23.5K
Comment /review to run again

@pelikhan
pelikhan merged commit 313f1a6 into main Sep 8, 2026
94 of 106 checks passed

@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.

Reviewed the Claude debug log relocation (/tmp/gh-aw/agent/claude-debug.log → /tmp/gh-aw/claude-debug.log). Applied impeccable harden/audit lenses (bug-fix/path-change scope).

Findings:

  • Core change in claude_engine.go is consistent: constant, PathSetup mkdir/touch, and printf format string all updated in sync.
  • Matching test updates in claude_engine_test.go, claude_engine_network_test.go, logs_test.go, and the claude.golden fixture (mkdir path, --debug-file path, umask touch, artifact upload path) all correctly reflect the new location.
  • No other Go source references the old /tmp/gh-aw/agent/claude-debug.log path; constants.TmpGhAwAgentDir is still used correctly elsewhere for genuine user-data paths (unrelated to this fix).
  • Ran go test ./pkg/workflow/... — all tests pass.

No blocking issues found; the change is minimal, self-consistent, and fully covered by tests/golden fixtures.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · copilot · sonnet50 · 34.7 AIC · ⌖ 13.4 AIC · ⊞ 8.3K

@pelikhan
pelikhan deleted the copilot/update-debug-log-location branch September 8, 2026 12:12

@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 /codebase-design to check the debug-log relocation for architectural fit.

📋 Analysis

What changed

claudeDebugLogFile moved from /tmp/gh-aw/agent/claude-debug.log to /tmp/gh-aw/claude-debug.log, with matching updates to:

  • PathSetup mkdir/touch commands in claude_engine.go
  • All 62 generated .lock.yml fixtures (mechanical, consistent with the source change)
  • Unit test assertions (claude_engine_test.go, claude_engine_network_test.go, logs_test.go)
  • The wasm golden fixture

Why this holds up

  • /tmp/gh-aw/agent/ is documented elsewhere in the codebase (sandbox.go, compiler_validators.go) as the reserved root for user-generated agent data — moving engine-internal diagnostics out of it is the right call and matches the existing precedent set by RedactedURLsLogPath and agent_usage.json, which already live directly under /tmp/gh-aw/.
  • getEngineArtifactPaths/generateCleanupStep in engine_output.go treat any path under constants.TmpGhAwDirSlash identically (no explicit cleanup needed, since it's not a workspace file) — so this relocation doesn't change artifact collection or cleanup behavior, just where the file physically lives.
  • File permissions (umask 177) are preserved verbatim in the new location.
  • Verified the full set of .go and .lock.yml references are updated consistently; go build ./... succeeds.

No functional or architectural concerns — this is a safe, well-scoped, mechanical move with corresponding test/fixture updates.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 58 AIC · ⌖ 14.6 AIC · ⊞ 10.3K
Comment /matt to run again

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.

🟢 Approval recommended

The debug log relocation is consistently applied across engine code, regenerated workflows/fixtures, and updated tests without introducing functional changes beyond the intended path move.

Pull request overview

This PR relocates the Claude Code CLI debug log from the user-data-reserved /tmp/gh-aw/agent/ directory to a top-level path (/tmp/gh-aw/claude-debug.log) to avoid mixing engine diagnostics with agent-generated outputs, while keeping restrictive file permissions and artifact upload coverage intact.

Changes:

  • Update the Claude engine to write its debug log to /tmp/gh-aw/claude-debug.log and adjust pre-run path setup accordingly.
  • Refresh workflow lockfiles, WASM golden fixtures, and tests to assert the new debug log path and upload it as part of the agent artifact set.
  • Add a patch changeset documenting the behavior change.
File summaries
File Description
pkg/workflow/claude_engine.go Switch Claude debug log path to /tmp/gh-aw/claude-debug.log and update path setup strings.
pkg/workflow/logs_test.go Update expected lockfile fragments to match the new debug log path and pre-touch behavior.
pkg/workflow/claude_engine_test.go Update assertions to expect the new --debug-file path.
pkg/workflow/claude_engine_network_test.go Update network-permissions test expectations for the new debug log path and touch command.
pkg/workflow/testdata/TestWasmGolden_AllEngines/claude.golden Refresh golden workflow output for new debug log location and artifact path.
.github/workflows/step-name-alignment.lock.yml Regenerate lockfile to touch/upload /tmp/gh-aw/claude-debug.log instead of the agent subdir.
.github/workflows/static-analysis-report.lock.yml Regenerate lockfile to reflect the updated debug log path in setup, invocation, and artifacts.
.github/workflows/smoke-github-claude.lock.yml Regenerate lockfile to reflect the updated debug log path in setup, invocation, and artifacts.
.github/workflows/smoke-claude.lock.yml Regenerate lockfile to reflect the updated debug log path in setup, invocation, and artifacts.
.github/workflows/smoke-claude-on-copilot.lock.yml Regenerate lockfile to reflect the updated debug log path in setup, invocation, and artifacts.
.github/workflows/sergo.lock.yml Regenerate lockfile to reflect the updated debug log path in setup, invocation, and artifacts.
.github/workflows/scout.lock.yml Regenerate lockfile to reflect the updated debug log path in setup, invocation, and artifacts.
.github/workflows/safe-output-health.lock.yml Regenerate lockfile to reflect the updated debug log path in setup, invocation, and artifacts.
.github/workflows/ruflo-backed-task.lock.yml Regenerate lockfile to reflect the updated debug log path in setup, invocation, and artifacts.
.github/workflows/prompt-clustering-analysis.lock.yml Regenerate lockfile to reflect the updated debug log path in setup, invocation, and artifacts.
.github/workflows/portfolio-analyst.lock.yml Regenerate lockfile to reflect the updated debug log path in setup, invocation, and artifacts.
.github/workflows/lockfile-stats.lock.yml Regenerate lockfile to reflect the updated debug log path in setup, invocation, and artifacts.
.github/workflows/instructions-janitor.lock.yml Regenerate lockfile to reflect the updated debug log path in setup, invocation, and artifacts.
.github/workflows/hourly-ci-cleaner.lock.yml Regenerate lockfile to reflect the updated debug log path in setup, invocation, and artifacts.
.github/workflows/go-pattern-detector.lock.yml Regenerate lockfile to reflect the updated debug log path in setup, invocation, and artifacts.
.github/workflows/go-fan.lock.yml Regenerate lockfile to reflect the updated debug log path in setup, invocation, and artifacts.
.github/workflows/github-mcp-tools-report.lock.yml Regenerate lockfile to reflect the updated debug log path in setup, invocation, and artifacts.
.github/workflows/github-mcp-structural-analysis.lock.yml Regenerate lockfile to reflect the updated debug log path in setup, invocation, and artifacts.
.github/workflows/example-workflow-analyzer.lock.yml Regenerate lockfile to reflect the updated debug log path in setup, invocation, and artifacts.
.github/workflows/daily-yamllint-fixer.lock.yml Regenerate lockfile to reflect the updated debug log path in setup, invocation, and artifacts.
.github/workflows/daily-safeoutputs-git-simulator.lock.yml Regenerate lockfile to reflect the updated debug log path in setup, invocation, and artifacts.
.github/workflows/daily-safe-outputs-conformance.lock.yml Regenerate lockfile to reflect the updated debug log path in setup, invocation, and artifacts.
.github/workflows/daily-choice-test.lock.yml Regenerate lockfile to reflect the updated debug log path in setup, invocation, and artifacts.
.github/workflows/ci-doctor.lock.yml Regenerate lockfile to reflect the updated debug log path in setup, invocation, and artifacts.
.github/workflows/copilot-session-insights.lock.yml Regenerate lockfile to reflect the updated debug log path in setup, invocation, and artifacts.
.changeset/patch-relocate-claude-debug-log.md Add patch changeset describing the debug log relocation.
Review details
  • Files reviewed: 62/62 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.88.7

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.

3 participants