Repository navigation
Keep standalone CLI output IDs readable across processes - #388
Conversation
Keep the standalone cache private to the local account, configuration and team. Leave MCP output in process memory so CLI logs cannot be retrieved through a server endpoint.
[Medium impact] The change reaches standalone CLI output across several tool workflows. The PR appears safe to merge, with non-blocking improvements for cache failures and process-exit test coverage.
|
| # A second standalone invocation starts with no in-process cache. | ||
| monkeypatch.setattr(server, "_output_cache", OutputCache()) | ||
| args = ["read_output", output_id, "lines", "1001", "1001"] | ||
| server._run_call(args) |
There was a problem hiding this comment.
Fresh processes are not tested
test_read_output_survives_cli_exit_without_exposing_it_to_mcp never exits a process. Both calls share the imported server, patched settings, and tool registry. Replacing _output_cache checks repeated calls, not a fresh CLI.
Add a test that writes in one process and reads the ID in another, using the same temporary home directory and configuration. That would protect the main promise of this change against restart-related regressions.
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/test_cli_call.py
Line: 167-170
Comment:
**Fresh processes are not tested**
`test_read_output_survives_cli_exit_without_exposing_it_to_mcp` never exits a process. Both calls share the imported server, patched settings, and tool registry. Replacing `_output_cache` checks repeated calls, not a fresh CLI.
Add a test that writes in one process and reads the ID in another, using the same temporary home directory and configuration. That would protect the main promise of this change against restart-related regressions.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Comments Outside DiffThese findings could not be posted inline.
|
A real service command produced 2,000 lines. Before: a fresh CLI immediately lost the ID. After: a fresh CLI recovered lines 1222–1224, without sharing MCP-visible output. The private local cache is bounded and scoped to OS user, config and team.