Add env snapshot capture for session debugging#448
Merged
Conversation
Every session now captures a redacted environment variable snapshot at startup using the debug-env tool (reuses existing redaction logic). The snapshot is stored in the session record and displayed in the UI under a new "Environment" tab on the session detail page. This enables debugging env var issues (like missing GH_HOST, wrong proxy settings, or credential conflicts) by showing exactly what was set when the session ran. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Every session now captures a redacted environment variable snapshot at startup. Reuses the
debug-envbinary (already baked into Skiff) for env classification, redaction, and formatting — single source of truth.Changes
/usr/local/bin/debug-envat startup, sends output to Ledgerenv_snapshot TEXTcolumn on sessions table (migration 032)POST /api/v1/sessions/{id}/env-snapshotingestion endpoint (auth bypass for session token, same as transcript/status)env_snapshotfield[REDACTED]in red,[DUMMY]in yellowTest evidence
Verified in local dev environment: dispatched session, env snapshot captured (2285 chars), visible in API response with all env vars properly categorized and redacted.
🤖 Generated with Claude Code