-
Notifications
You must be signed in to change notification settings - Fork 1
Fix #135: Remove CI auto-enable for trace logs #138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #135
## Problem When the CI environment variable was set to 'true' (as in GitHub Actions and other CI/CD platforms), command-stream automatically enabled verbose trace logging to stderr. This interfered with command output and broke JSON parsing in CI environments. ## Root Cause In src/$.mjs line 15, the VERBOSE constant was set to: `const VERBOSE = process.env.COMMAND_STREAM_VERBOSE === 'true' || process.env.CI === 'true'` This caused trace logs to be emitted whenever CI=true, regardless of the mirror:false or capture:true options. ## Solution 1. Removed automatic trace log activation when CI=true 2. Added COMMAND_STREAM_TRACE environment variable for explicit control: - COMMAND_STREAM_TRACE=true: Explicitly enable tracing - COMMAND_STREAM_TRACE=false: Explicitly disable tracing (overrides VERBOSE) - Not set: Use COMMAND_STREAM_VERBOSE setting 3. Made trace evaluation dynamic to support runtime env var changes 4. Applied consistent trace logic in both src/$.mjs and src/$.utils.mjs ## Benefits - CI environments no longer get polluted with trace logs by default - JSON parsing works reliably in CI/CD pipelines - Users can still enable tracing in CI by setting COMMAND_STREAM_TRACE=true - Explicit control via environment variables ## Testing - Added tests/issue-135-final.test.mjs with 4 tests covering: - CI=true no longer produces trace logs - JSON parsing works in CI environment - Default behavior (no env vars) is clean - mirror:false works correctly in CI - All 4 new tests pass - Existing test suite: 619 pass, 2 pre-existing failures unrelated to this change 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This reverts commit 7aa4a62.
|
Resolve conflicts, and double checks all original requirements are met. |
|
🤖 AI Work Session Started Starting automated work session at 2025-12-28T02:35:40.900Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait working session to finish, and provide your feedback. |
Conflicts resolved in src/$.mjs and src/$.utils.mjs: - Kept our fix that removes CI=true auto-enabling of trace logs - Maintained COMMAND_STREAM_TRACE and COMMAND_STREAM_VERBOSE support - Preserved dynamic trace evaluation for runtime control 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Documents the fix for CI=true trace logs interfering with output. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Apply automatic formatting fixes from 'bun run lint --fix'. All errors fixed; remaining warnings are pre-existing in codebase. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
Summary
Fixes #135 - Trace logs no longer interfere with command output when
CI=trueenvironment variable is set.Problem
When the
CIenvironment variable was set totrue(as in GitHub Actions and other CI/CD platforms), command-stream automatically enabled verbose trace logging to stderr. This caused:Example of the issue:
Solution
1. Removed CI Auto-Enable for Trace Logs
2. Added Explicit Trace Control
New
COMMAND_STREAM_TRACEenvironment variable:COMMAND_STREAM_TRACE=true- Explicitly enable tracing (even in CI)COMMAND_STREAM_TRACE=false- Explicitly disable tracing (overrides VERBOSE)COMMAND_STREAM_VERBOSEsetting (default: disabled)3. Dynamic Trace Evaluation
Changes
Modified Files:
src/$.mjs- Updated trace function and removed CI auto-enablesrc/$.utils.mjs- Consistent trace logicTest Files:
tests/issue-135-final.test.mjs- 4 tests covering the fixexamples/- Reproduction and test scriptsTesting
✅ All new tests passing (4/4):
✅ Existing tests: 619 pass, 2 pre-existing failures unrelated to this change
Migration Guide
Before (Broken in CI)
After (Fixed)
Environment Variable Reference
CI=trueCOMMAND_STREAM_VERBOSE=trueCOMMAND_STREAM_TRACE=trueCOMMAND_STREAM_TRACE=falseImpact
🤖 Generated with Claude Code