fix(p1-11): redact CLI top-level exception text before stderr#435
fix(p1-11): redact CLI top-level exception text before stderr#435
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 49 minutes and 39 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Redacts top-level autosearch query failure messages before they are emitted to stderr or the JSON envelope, preventing secrets embedded in exception text from leaking to terminal output or log consumers.
Changes:
- Apply
autosearch.core.redact.redact()inside_exit_query_failure()for both stderr and--jsonoutputs. - Add a unit test to exercise redaction for a top-level exception from the query pipeline.
- Add an end-to-end smoke test that forces a failing pipeline via
sitecustomize.pyand asserts redaction in subprocess stderr.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
autosearch/cli/main.py |
Redacts query failure messages before emitting them in human and JSON error paths. |
tests/unit/test_mcp_error_redaction.py |
Adds unit coverage for redacting a top-level query exception message. |
tests/smoke/test_first_use_flow.py |
Adds subprocess smoke coverage to ensure secrets don’t leak on the CLI error path. |
Summary
P1 fix for
reports/autosearch-p0-fix-plan.md§11 —autosearch/cli/main.py_exit_query_failure()wrote raw exception text to stderr / JSON output. Secrets embedded in exception messages (API keys, tokens, signed URLs) leaked to terminal output and any logging consumers.Changes
cli/main.py_exit_query_failure(): redact viaautosearch.core.redact.redact()before writing to stderr or stdout (JSON path).test_cli_query_top_level_exception_redacted.test_first_use_flow.pyfor end-to-end redacted error path via subprocess.Plan
docs/exec-plans/active/autosearch-0426-p0-fix-plan-execution.md§ F013 (S1-S3).Commits
Test plan
pytest tests/unit/test_mcp_error_redaction.py tests/smoke/test_first_use_flow.py— 7 passedpytest tests/unit/ -m "not real_llm and not slow and not network"— 674 passed, 3 skipped🤖 Generated with Claude Code