Repository navigation
fix(cli): diagram in the canonical smoke matrix; scoped machine-output console redirect - #1655
Merged
Merged
Conversation
…p the machine-output console rebind leaking a captured stream The canonical inventory test caught that 'cgc diagram' was never smoke-run; adding it exposed a real leak in the #1333/#1287 stderr redirect: reading console.file MATERIALIZES the current (possibly CliRunner-captured, soon closed) stream, so saving and 'restoring' it pinned the helpers console to a dead file and every later in-process invocation raised 'I/O operation on closed file'. The dynamic state lives in Console._file (None while the console follows sys.stdout live); the redirect now saves/restores that, scoped to the service-init window only.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Hi! 👋 Join our CodeGraphContext Discord channel to collaborate: https://discord.gg/dR4QY32uYQ |
Contributor
🔍 PR Code Graph Analysisfix(cli): diagram in the canonical smoke matrix; scoped machine-output console redirect (#1655) 📊 Interactive VisualizationView the blast radius graph: PR Reviewer Dashboard 📦 ArtifactsThe graph JSON has been uploaded as a build artifact: Generated by CodeGraphContext using FalkorDB Lite |
Shashankss1205
pushed a commit
that referenced
this pull request
Sep 24, 2026
) `main.py` had a single module-level `Console(stderr=True)`, so every `analyze` command rendered its result table to stderr while init chatter went to stdout — the split was inverted for exactly the commands whose job is emitting data. `cgc analyze callers X > out.txt` captured a banner and no table. Adds a separate `analyze_result_console = Console()` and routes the result prints across the ten `analyze_*` commands through it. Empty-result notices move with the tables (a script reading stdout still needs to see that the query ran); argument-validation errors stay on stderr. Leaves the #1650/#1655 `_file` save/restore mechanism untouched — verified no `.file` materialization leak via the unmodified CliRunner and complexity-CI suites. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This branch was successfully deployed
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.
Follow-up to #1650: the canonical-CLI inventory test flagged
cgc diagramas never smoke-run. Registering it exposed a genuine leak in the machine-output stderr redirect —Console.file's getter materializes the transient captured stream, so save/restore via the property pinned the helper console to a closed file and poisoned later in-process invocations. The redirect now saves/restoresConsole._file(the real dynamic state), scoped to the service-init window.CLI + complexity + diagram integration files: 25 passed, including the ordering case that reproduced the leak. Unit suite green.